Skip to content

Commit

Permalink
feat: add info alert type
Browse files Browse the repository at this point in the history
  • Loading branch information
salembaira committed Nov 25, 2023
1 parent 9f3bbf1 commit 694984b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 0 deletions.
Binary file added src/assets/info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/config/ENV.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ enum ALERT_TYPE {
SUCCESS = 'SUCCESS',
DANGER = 'DANGER',
WARNING = 'WARNING',
INFO = 'INFO',
}

enum TOAST_POSITION {
Expand Down Expand Up @@ -57,6 +58,11 @@ const ENV = {
android: ['@android:color/holo_orange_light', '@android:color/holo_orange_dark'],
default: ['rgb(255,149,0)', 'rgb(255,159,10)'],
},
info: {
ios: 'systemBlue',
android: ['@android:color/holo_blue_light', '@android:color/holo_blue_dark'],
default: ['rgb(80,122,189)', 'rgb(80,122,190)'],
},
},
};

Expand Down
6 changes: 6 additions & 0 deletions src/containers/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ const __styles = (isDark: boolean) =>
[ALERT_TYPE.WARNING]: {
backgroundColor: Color.get('warning', isDark),
},
[ALERT_TYPE.INFO]: {
backgroundColor: Color.get('info', isDark),
},
backendImage: {
position: 'absolute',
alignSelf: 'center',
Expand Down Expand Up @@ -337,4 +340,7 @@ const __styles = (isDark: boolean) =>
[`${ALERT_TYPE.WARNING}Image`]: {
tintColor: Color.get('warning', isDark),
},
[`${ALERT_TYPE.INFO}Image`]: {
tintColor: Color.get('info', isDark),
},
});
3 changes: 3 additions & 0 deletions src/containers/ToastRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,7 @@ const __styles = (isDark: boolean) =>
[`${ALERT_TYPE.WARNING}Image`]: {
tintColor: Color.get('warning', isDark),
},
[`${ALERT_TYPE.INFO}Image`]: {
tintColor: Color.get('info', isDark),
},
});
1 change: 1 addition & 0 deletions src/service/color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type IColors = {
success: string;
danger: string;
warning: string;
info: string;
};

export class Color {
Expand Down
2 changes: 2 additions & 0 deletions src/service/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ export const getImage = (type: IConfigDialog['type']): ImageRequireSource => {
return require('../assets/warning.png');
case ALERT_TYPE.DANGER:
return require('../assets/danger.png');
case ALERT_TYPE.INFO:
return require('../assets/info.png');
}
};

0 comments on commit 694984b

Please sign in to comment.