-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PBNTR-555] Currency Kit Updates (#3832)
**What does this PR do?** A clear and concise description with your runway ticket url. https://runway.powerhrg.com/backlog_items/PBNTR-555 **Screenshots:** Screenshots to visualize your addition/change <img width="652" alt="Screenshot 2024-10-22 at 3 53 03 PM" src="https://github.com/user-attachments/assets/3f32b0ac-17d3-4164-98a7-608f7132eae5"> **How to test?** Steps to confirm the desired behavior: 1. Go to bottom of Currency kit on rails & react. 2. See new doc examples highlighting the new comma_separator prop. #### Checklist: - [X] **LABELS** Add a label: `enhancement`, `bug`, `improvement`, `new kit`, `deprecated`, or `breaking`. See [Changelog & Labels](https://github.com/powerhome/playbook/wiki/Changelog-&-Labels) for details. - [X] **DEPLOY** I have added the `milano` label to show I'm ready for a review. - [X] **TESTS** I have added test coverage to my code.
- Loading branch information
1 parent
ecf834f
commit 27c5726
Showing
10 changed files
with
130 additions
and
18 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
playbook/app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<%= pb_rails("currency", props: { | ||
amount: '1234567.89', | ||
comma_separator: true, | ||
size: 'lg', | ||
emphasized: false, | ||
decimals: 'matching', | ||
}) %> |
18 changes: 18 additions & 0 deletions
18
playbook/app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from "react" | ||
|
||
import Currency from "../_currency" | ||
|
||
const CurrencyCommaSeparator = (props) => { | ||
return ( | ||
<Currency | ||
amount='1234567.89' | ||
commaSeparator | ||
decimals="matching" | ||
emphasized={false} | ||
size="lg" | ||
{...props} | ||
/> | ||
) | ||
} | ||
|
||
export default CurrencyCommaSeparator |
3 changes: 3 additions & 0 deletions
3
playbook/app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
The optional `commaSeparator` can be used to auto-format the use of commas as a thousands separator. | ||
|
||
**NOTE:** If the value passed into the `amount` prop is already comma-dilineated, it will not add additional commas. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters