-
Notifications
You must be signed in to change notification settings - Fork 26
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
fix: change high precision money display #661
Conversation
src/components/tooltip/README.md
Outdated
@@ -111,3 +111,4 @@ In the following example, the tooltip text only appears on hover when the button | |||
| `horizontalConstraint` | `object` | - | `xs`, `s`, `m`, `l`, `xl`, `scale` | `scale` | Horizontal size limit of the tooltip | | |||
| `children` | `node` | ✅ | - | - | Content rendered within the tooltip | | |||
| `components` | `object` | - | `WrapperComponent`, `BodyComponent` | - | If passed, the tooltip will wrap your component with this element | | |||
| `customBodyStyles` | `object` | - | - | - | If passed, these styles will be spread onto the div surrounding the tooltip body | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if I am overly picky with the name again. But given we tend to like the components={{header, footer}}
pattern. How about going with styles={ body }
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure can do
src/components/tooltip/README.md
Outdated
@@ -111,4 +111,4 @@ In the following example, the tooltip text only appears on hover when the button | |||
| `horizontalConstraint` | `object` | - | `xs`, `s`, `m`, `l`, `xl`, `scale` | `scale` | Horizontal size limit of the tooltip | | |||
| `children` | `node` | ✅ | - | - | Content rendered within the tooltip | | |||
| `components` | `object` | - | `WrapperComponent`, `BodyComponent` | - | If passed, the tooltip will wrap your component with this element | | |||
| `customBodyStyles` | `object` | - | - | - | If passed, these styles will be spread onto the div surrounding the tooltip body | | |||
| `styles` | `object` | - | - | - | If passed, these styles will be spread onto the div surrounding the tooltip body | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
styles.body
getAmountInputStyles({ ...this.props, hasFocus }), | ||
// accounts for size of icon | ||
css` | ||
padding-right: 24px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
padding-right: 24px; | |
padding-right: ${vars.spacing24}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -111,3 +111,4 @@ In the following example, the tooltip text only appears on hover when the button | |||
| `horizontalConstraint` | `object` | - | `xs`, `s`, `m`, `l`, `xl`, `scale` | `scale` | Horizontal size limit of the tooltip | | |||
| `children` | `node` | ✅ | - | - | Content rendered within the tooltip | | |||
| `components` | `object` | - | `WrapperComponent`, `BodyComponent` | - | If passed, the tooltip will wrap your component with this element | | |||
| `styles.body` | `object` | - | - | - | If passed, these styles will be spread onto the div surrounding the tooltip body | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the proptypes says it's required.
Should we update the propTypes, or the readme?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's required because it's set with a default though, so for the user it's not required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the explanation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Malcolm.
It gave me very hard times because of the jumping :D
@@ -29,4 +29,20 @@ const getAmountInputStyles = props => [ | |||
`, | |||
]; | |||
|
|||
export { getCurrencyLabelStyles, getAmountInputStyles }; | |||
const getHighPrecisionWrapperStyles = props => css` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit just pass isDisabled
? to be more specific? Not sure what the pattern is on UIKit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
116a248
to
d90361f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍 🚀
Summary
Currently, when a price is
highPrecision
, the MoneyField "jumps", as it is rendering a label above the field. This is not desired. Instead, we replace it with the use of an icon, and an accompanying tooltip in the MoneyInput.Before
After
Also adds new
FractionDigitsIcon