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

[Mobile] - Color settings - Update label and show the selected color value #33973

Merged
merged 1 commit into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ const PaletteScreen = () => {
styles.clearButton,
styles.clearButtonDark
);
const selectedColorTextStyle = usePreferredColorSchemeStyle(
styles.colorText,
styles.colorTextDark
);

const isSolidSegment = currentSegment === segments[ 0 ];
const isCustomGadientShown = ! isSolidSegment && isGradientColor;
Expand Down Expand Up @@ -136,12 +140,22 @@ const PaletteScreen = () => {
/>
) }
</View>
<Text
style={ styles.selectColorText }
maxFontSizeMultiplier={ 2 }
>
{ __( 'Select a color' ) }
</Text>
{ currentValue ? (
<Text
style={ selectedColorTextStyle }
maxFontSizeMultiplier={ 2 }
selectable
>
{ currentValue.toUpperCase() }
</Text>
) : (
<Text
style={ styles.selectColorText }
maxFontSizeMultiplier={ 2 }
>
{ __( 'Select a color above' ) }
</Text>
) }
<View style={ styles.flex }>
{ currentValue && getClearButton() }
</View>
Expand Down
11 changes: 11 additions & 0 deletions packages/components/src/mobile/color-settings/style.native.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@
line-height: 24px;
}

.colorText {
font-family: $default-monospace-font;
color: $light-primary;
font-size: 16px;
font-weight: 400;
}

.colorTextDark {
color: $dark-primary;
}

.flex {
flex: 1;
}
Expand Down