Skip to content

Commit 5441b36

Browse files
authored
migrate floatingButton and exampleScreenPresenter to designTokens (#1934)
1 parent 0130e09 commit 5441b36

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

demo/src/screens/ExampleScreenPresenter.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface RadioGroupOptions {
2424

2525
export function renderHeader(title: string, others: TextProps) {
2626
return (
27-
<Text text30 grey10 {...others}>
27+
<Text text30 $textDefault {...others}>
2828
{title}
2929
</Text>
3030
);
@@ -35,7 +35,7 @@ export function renderBooleanOption(title: string, key: string) {
3535
const value = this.state[key];
3636
return (
3737
<View row centerV spread marginB-s4 key={key}>
38-
<Text flex>{title}</Text>
38+
<Text $textDefault flex>{title}</Text>
3939
<Switch
4040
useCustomTheme
4141
key={key}
@@ -51,7 +51,7 @@ export function renderBooleanOption(title: string, key: string) {
5151
export function renderBooleanGroup(title: string, options: string[]) {
5252
return (
5353
<View marginB-s2>
54-
<Text text70M marginB-s2>
54+
<Text text70M $textDefault marginB-s2>
5555
{title}
5656
</Text>
5757
<View row style={styles.rowWrap}>
@@ -69,7 +69,7 @@ export function renderBooleanGroup(title: string, options: string[]) {
6969
// @ts-ignore
7070
onValueChange={value => this.setState({[key]: value})}
7171
/>
72-
<Text text70 marginR-s3 marginB-s2>
72+
<Text text70 marginR-s3 $textDefault marginB-s2>
7373
{key}
7474
</Text>
7575
</View>
@@ -89,7 +89,7 @@ export function renderRadioGroup(title: string,
8989
return (
9090
<View marginB-s2>
9191
{!_.isUndefined(title) && (
92-
<Text text70M marginB-s2>
92+
<Text text70M $textDefault marginB-s2>
9393
{title}
9494
</Text>
9595
)}
@@ -125,7 +125,7 @@ export function renderColorOption(title: string,
125125
const value = this.state[key];
126126
return (
127127
<View marginV-s2>
128-
<Text text70M>{title}</Text>
128+
<Text text70M $textDefault>{title}</Text>
129129
<ColorPalette
130130
value={value}
131131
colors={colors}
@@ -143,7 +143,7 @@ export function renderSliderOption(title: string,
143143
const value = this.state[key] || initial;
144144
return (
145145
<View marginV-s2>
146-
<Text marginB-s1 text70M>
146+
<Text marginB-s1 text70M $textDefault>
147147
{title}
148148
</Text>
149149
<View row centerV>
@@ -157,7 +157,7 @@ export function renderSliderOption(title: string,
157157
// @ts-ignore
158158
onValueChange={value => this.setState({[key]: value})}
159159
/>
160-
<Text marginL-s4 text70 style={styles.text}>
160+
<Text marginL-s4 text70 $textDefault style={styles.text}>
161161
{sliderText}
162162
{value}
163163
</Text>
@@ -173,7 +173,7 @@ export function renderMultipleSegmentOptions(title: string, key: string, options
173173

174174
return (
175175
<View row centerV spread marginB-s4 key={key}>
176-
{!!title && <Text marginR-s2>{title}</Text>}
176+
{!!title && <Text $textDefault marginR-s2>{title}</Text>}
177177
<SegmentedControl
178178
initialIndex={index}
179179
segments={options}

demo/src/screens/componentScreens/FloatingButtonScreen.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ export default class FloatingButtonScreen extends Component<{}, State> {
2828
const {showSecondary} = this.state;
2929
return (
3030
<View style={styles.container}>
31-
<Text text60 center marginB-s4>
31+
<Text text60 center $textDefault marginB-s4>
3232
Trigger Floating Button
3333
</Text>
3434
{renderBooleanOption.call(this, 'Show Floating Button', 'showButton')}
3535
{renderBooleanOption.call(this, 'Show Secondary Button', 'showSecondary')}
3636

3737
<ScrollView showsVerticalScrollIndicator={false}>
3838
<View paddingT-20>
39-
<Text text70 style={{fontWeight: 'bold'}}>
39+
<Text text70 $textDefault style={{fontWeight: 'bold'}}>
4040
Scroll behind a FloatingButton
4141
</Text>
42-
<Text text80 marginT-10 style={{lineHeight: 24}}>
42+
<Text text80 $textDefault marginT-10 style={{lineHeight: 24}}>
4343
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
4444
industry standard dummy text ever since the 1500s, when an unknown printer took a galley of type and
4545
scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into
@@ -70,7 +70,7 @@ export default class FloatingButtonScreen extends Component<{}, State> {
7070
? {
7171
label: 'Not now',
7272
onPress: this.notNow,
73-
color: Colors.red30
73+
color: Colors.$textDangerLight
7474
}
7575
: undefined
7676
}
@@ -88,6 +88,6 @@ const styles = StyleSheet.create({
8888
padding: 30,
8989
paddingBottom: 0,
9090
flex: 1,
91-
backgroundColor: Colors.white
91+
backgroundColor: Colors.$backgroundDefault
9292
}
9393
});

src/components/floatingButton/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ class FloatingButton extends PureComponent<FloatingButtonProps> {
115115
style={styles.image}
116116
source={gradientImage()}
117117
resizeMode={'stretch'}
118+
tintColor={Colors.$backgroundDefault}
118119
/>
119120
</View>
120121
);
@@ -177,7 +178,7 @@ const styles = StyleSheet.create({
177178
height: '100%'
178179
},
179180
shadow: {
180-
shadowColor: Colors.grey40,
181+
shadowColor: Colors.$backgroundNeutralIdle,
181182
shadowOffset: {height: 5, width: 0},
182183
shadowOpacity: 0.35,
183184
shadowRadius: 12,

0 commit comments

Comments
 (0)