Skip to content

Commit

Permalink
Mobile - Color settings: Update the label to "Select a color above" a…
Browse files Browse the repository at this point in the history
…nd display the selected hex color. (#33973)
  • Loading branch information
Gerardo Pacheco authored Aug 19, 2021
1 parent 89ef4b2 commit d473726
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
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

0 comments on commit d473726

Please sign in to comment.