Skip to content

Commit 538599b

Browse files
authored
move Incubator.Toast to design tokens (#1865)
1 parent 27a1f1a commit 538599b

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

generatedTypes/src/incubator/toast/helpers/useToastPresets.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import 'react';
22
import { ToastProps } from '../types';
33
declare const _default: ({ preset, icon, iconColor, message }: Pick<ToastProps, 'preset' | 'icon' | 'message' | 'iconColor'>) => {
44
icon: any;
5-
iconColor: any;
5+
iconColor: string | undefined;
66
accessibilityMessage: string;
77
};
88
export default _default;

src/incubator/toast/helpers/useToastPresets.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ const redCloudIcon = require('../assets/redCloud.png');
1010
const TOAST_PRESETS = {
1111
[ToastPresets.GENERAL]: {
1212
icon: infoIcon,
13-
iconColor: Colors.getColorTint(Colors.primary, 50),
13+
iconColor: Colors.$iconPrimaryLight,
1414
accessibilityMessagePrefix: ''
1515
},
1616
[ToastPresets.SUCCESS]: {
1717
icon: checkMarkIcon,
18-
iconColor: Colors.green40,
18+
iconColor: Colors.$iconSuccessLight,
1919
accessibilityMessagePrefix: 'Success'
2020
},
2121
[ToastPresets.FAILURE]: {
2222
icon: exclamationIcon,
23-
iconColor: Colors.red40,
23+
iconColor: Colors.$iconDangerLight,
2424
accessibilityMessagePrefix: 'Alert'
2525
},
2626
[ToastPresets.OFFLINE]: {
2727
icon: redCloudIcon,
28-
iconColor: Colors.getColorTint(Colors.primary, 50),
28+
iconColor: Colors.$iconPrimaryLight,
2929
accessibilityMessagePrefix: 'Offline'
3030
}
3131
};

src/incubator/toast/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ const Toast = (props: PropsWithChildren<ToastProps>) => {
126126
<ActivityIndicator
127127
size={'small'}
128128
testID={`${testID}-loader`}
129-
color={Colors.rgba(Colors.grey30, 0.7)}
129+
color={Colors.rgba(Colors.$backgroundNeutralHeavy, 0.6)}
130130
style={styles.loader}
131131
/>
132132
// <Loader size={Loader.sizes.SMALL} color={loaderColors} style={styles.loader} testID={`${testID}-loader`}/>
@@ -138,11 +138,11 @@ const Toast = (props: PropsWithChildren<ToastProps>) => {
138138
<Button
139139
link
140140
style={styles.action}
141-
color={Colors.grey20}
141+
color={Colors.$backgroundNeutralHeavy}
142142
{...action}
143143
labelStyle={Typography.bodySmallBold}
144144
accessibilityRole={'button'}
145-
activeBackgroundColor={Colors.grey70}
145+
activeBackgroundColor={Colors.$backgroundNeutral}
146146
testID={`${testID}-action`}
147147
/>
148148
);
@@ -234,7 +234,7 @@ const Toast = (props: PropsWithChildren<ToastProps>) => {
234234

235235
const styles = StyleSheet.create({
236236
toastContent: {
237-
backgroundColor: Colors.white,
237+
backgroundColor: Colors.$backgroundElevated,
238238
minHeight: 48,
239239
flexDirection: 'row',
240240
alignSelf: 'center',
@@ -252,7 +252,7 @@ const styles = StyleSheet.create({
252252
},
253253
message: {
254254
...Typography.bodySmall,
255-
color: Colors.grey10,
255+
color: Colors.$textDefault,
256256
marginLeft: Spacings.s2,
257257
marginRight: Spacings.s5
258258
},
@@ -265,7 +265,7 @@ const styles = StyleSheet.create({
265265
marginRight: Spacings.s3
266266
},
267267
action: {
268-
backgroundColor: Colors.grey80,
268+
backgroundColor: Colors.$backgroundNeutralLight,
269269
borderTopRightRadius: BorderRadiuses.br40,
270270
borderBottomRightRadius: BorderRadiuses.br40,
271271
paddingHorizontal: Spacings.s3,

0 commit comments

Comments
 (0)