-
Notifications
You must be signed in to change notification settings - Fork 14
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 Comma Separator (#3867)
**What does this PR do?** A clear and concise description with your runway ticket url. **Screenshots:** Screenshots to visualize your addition/change **How to test?** Steps to confirm the desired behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See addition/change #### Checklist: - [ ] **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. - [ ] **DEPLOY** I have added the `milano` label to show I'm ready for a review. - [ ] **TESTS** I have added test coverage to my code.
- Loading branch information
1 parent
b5cc921
commit c965ab7
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