Skip to content

Feat/ColorPicker - preview text style prop #804

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

Merged
merged 5 commits into from
Jun 8, 2020
Merged

Conversation

ArnonZ
Copy link
Contributor

@ArnonZ ArnonZ commented Jun 3, 2020

  • Added previewTextStyle prop to allow adding styling to the preview text
    (WOAUILIB-823)

@ArnonZ ArnonZ requested a review from ethanshar June 3, 2020 13:01
/**
* Additional styling for the color preview text.
*/
previewTextStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
Copy link
Collaborator

Choose a reason for hiding this comment

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

the style is meant for the input. call it previewInputStyle

@@ -320,7 +324,7 @@ export default class ColorPicker extends PureBaseComponent {
onChangeText={this.onChangeText}
style={[
this.styles.input,
{color: textColor, width: (value.length + 1) * 16.5 * fontScale},
{color: textColor, width: (value.length + 1) * 16.5 * fontScale, ...previewTextStyle},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't spread the style, technically it can be a number that's pointing to a style.
the Input style is already constructed of an array, you can add it as another item of the array.
Also, consider passing it last, to give full control to the user.

@ArnonZ ArnonZ requested a review from ethanshar June 7, 2020 16:46
@ethanshar ethanshar merged commit d5efd35 into master Jun 8, 2020
@ArnonZ ArnonZ deleted the feat/cp_textstyle branch September 21, 2020 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants