Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Amount): add new props & remove prefix #1987

Merged
merged 14 commits into from
Jan 24, 2024

Conversation

snitin315
Copy link
Member

@snitin315 snitin315 commented Jan 22, 2024

  • Removed prefix prop in favor of the new currencyIndicator prop.
  • Following new props have been added:
    • currencyIndicator: Determines the visual representation of the currency (symbol or code).
    • isStrikethrough: If true, the amount value will have a line through it.
  • Updated the codemod & migration guide.

Copy link

changeset-bot bot commented Jan 22, 2024

⚠️ No Changeset found

Latest commit: 7d7db80

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Jan 22, 2024

✅ PR title follows Conventional Commits specification.

@snitin315 snitin315 changed the title Rebrand amount i18n feat(Amount): add new props & remove \prefix\ Jan 22, 2024
@snitin315 snitin315 changed the title feat(Amount): add new props & remove \prefix\ feat(Amount): add new props & remove prefix Jan 22, 2024
Copy link

codesandbox-ci bot commented Jan 22, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7d7db80:

Sandbox Source
razorpay/blade: basic Configuration

@snitin315 snitin315 added the Review - L1 First level of review label Jan 23, 2024
*
* @default false
*/
isStrikethrough?: boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: wouldn't shouldStrikethrough be more suitable?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All our booleans are either has* or is*. We don't use should* for booleans anywhere. I think isStrikethrough makes sense here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with either isStrikethrough or hasStrikethrough .

borderBottomStyle="solid"
position="absolute"
width="100%"
top="50%"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will top 50% be always correct? we use rems and if we increase or decrease fontsize of browser then I hope the place of line doesn't changes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, 50% will always be in the middle of the amount value.

@@ -84,6 +87,7 @@ export const BaseText = ({
textAlign={textAlign}
numberOfLines={truncateAfterLines}
wordBreak={wordBreak}
opacity={opacity}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should expose opacity. This will make base text colors unpredictable and will always rely on the background color. Lets speak with the design team once to confirm this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As consulted with design, we have now increased the opacity to 64%.

@chaitanyadeorukhkar
Copy link
Collaborator

it should strikethrough across the whole amount right? So the rupee symbol should also have a strikethrough? But seems like its only the numbers that have it right now

Screenshot 2024-01-23 at 4 32 28 PM

@snitin315
Copy link
Member Author

it should strikethrough across the whole amount right? So the rupee symbol should also have a strikethrough? But seems like its only the numbers that have it right now

@chaitanyadeorukhkar This is as per the designs.

Screenshot 2024-01-23 at 4 39 33 PM

@snitin315
Copy link
Member Author

it should strikethrough across the whole amount right? So the rupee symbol should also have a strikethrough? But seems like its only the numbers that have it right now

@chaitanyadeorukhkar This is as per the designs.

We have updated it to strike through whole component (including currency-symbol/code) after consulting with the designers.

Comment on lines +223 to +228
const currencyPositionMapping: Record<string, string> = {
DZD: 'right',
BHD: 'right',
OMR: 'right',
KWD: 'right',
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will these get filled with more currencies later?

Copy link
Member Author

@snitin315 snitin315 Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kamleshchandnani kamleshchandnani merged commit f9a5e27 into rebranding/master Jan 24, 2024
12 of 14 checks passed
@kamleshchandnani kamleshchandnani deleted the rebrand-amount-i18n branch January 24, 2024 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review - L1 First level of review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants