Skip to content

Commit 694984b

Browse files
committed
feat: add info alert type
1 parent 9f3bbf1 commit 694984b

File tree

6 files changed

+18
-0
lines changed

6 files changed

+18
-0
lines changed

src/assets/info.png

1.38 KB
Loading

src/config/ENV.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ enum ALERT_TYPE {
1313
SUCCESS = 'SUCCESS',
1414
DANGER = 'DANGER',
1515
WARNING = 'WARNING',
16+
INFO = 'INFO',
1617
}
1718

1819
enum TOAST_POSITION {
@@ -57,6 +58,11 @@ const ENV = {
5758
android: ['@android:color/holo_orange_light', '@android:color/holo_orange_dark'],
5859
default: ['rgb(255,149,0)', 'rgb(255,159,10)'],
5960
},
61+
info: {
62+
ios: 'systemBlue',
63+
android: ['@android:color/holo_blue_light', '@android:color/holo_blue_dark'],
64+
default: ['rgb(80,122,189)', 'rgb(80,122,190)'],
65+
},
6066
},
6167
};
6268

src/containers/Dialog.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,9 @@ const __styles = (isDark: boolean) =>
310310
[ALERT_TYPE.WARNING]: {
311311
backgroundColor: Color.get('warning', isDark),
312312
},
313+
[ALERT_TYPE.INFO]: {
314+
backgroundColor: Color.get('info', isDark),
315+
},
313316
backendImage: {
314317
position: 'absolute',
315318
alignSelf: 'center',
@@ -337,4 +340,7 @@ const __styles = (isDark: boolean) =>
337340
[`${ALERT_TYPE.WARNING}Image`]: {
338341
tintColor: Color.get('warning', isDark),
339342
},
343+
[`${ALERT_TYPE.INFO}Image`]: {
344+
tintColor: Color.get('info', isDark),
345+
},
340346
});

src/containers/ToastRender.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,4 +217,7 @@ const __styles = (isDark: boolean) =>
217217
[`${ALERT_TYPE.WARNING}Image`]: {
218218
tintColor: Color.get('warning', isDark),
219219
},
220+
[`${ALERT_TYPE.INFO}Image`]: {
221+
tintColor: Color.get('info', isDark),
222+
},
220223
});

src/service/color.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export type IColors = {
99
success: string;
1010
danger: string;
1111
warning: string;
12+
info: string;
1213
};
1314

1415
export class Color {

src/service/image.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ export const getImage = (type: IConfigDialog['type']): ImageRequireSource => {
1010
return require('../assets/warning.png');
1111
case ALERT_TYPE.DANGER:
1212
return require('../assets/danger.png');
13+
case ALERT_TYPE.INFO:
14+
return require('../assets/info.png');
1315
}
1416
};

0 commit comments

Comments
 (0)