From 694984b3818f97a36e5782eb7875f375b99769da Mon Sep 17 00:00:00 2001 From: Mohamed Salem Baira Date: Sat, 25 Nov 2023 13:27:57 +0000 Subject: [PATCH] feat: add info alert type --- src/assets/info.png | Bin 0 -> 1413 bytes src/config/ENV.ts | 6 ++++++ src/containers/Dialog.tsx | 6 ++++++ src/containers/ToastRender.tsx | 3 +++ src/service/color.ts | 1 + src/service/image.ts | 2 ++ 6 files changed, 18 insertions(+) create mode 100644 src/assets/info.png diff --git a/src/assets/info.png b/src/assets/info.png new file mode 100644 index 0000000000000000000000000000000000000000..793b4b5aa09ce18a5b9dbb56ac2f1137a6fe5387 GIT binary patch literal 1413 zcmV;01$z34P)V!eH%UZ6RCt{2ozHRNNEC-ZDBtl$FrEm849qHlQ3hrsSf5uH?Lp_o z5g0NM0gP5;fFl?j!I}uzLpKA+5~4-_lh9X1xe9~y`0;q%{rYwHV7J@h17Vas0OO;_ zz5F|>dFvKf10VA58d#@EurXz;3IkUHhf#J9gup~TzG%M1JCMsqnkK=A=IdXCRe_I0 z4T100ZY)>=DVD{yBC!1VKLbP$unY%t;8Dv3-LV3uy26GQ4-TVjis*l~ zU0e{KVJ$z?)m$xb7-ciy75BXZos582`Pr_bafpx&SxPs&_8co9Y}x=e5?G3x1K*n5 zw1vC@lO`f7hlm>#7sO}Hr zs>!HJ`MpluJzcEvaw0cm{Q9Kp;0B30?W*j?H2pJVUi`+Y=;Vu=dy660?RI0Y|5fDY%IS|7jaep zxXOcPbSrsdnh_Ok)hB^v(00}JX&RCyI*n+^Q(1#o=E1RXQ_j#Z58LEDCWwnqob-d` zH}KP*J*B(@<4cF4vVr->tVv3IJ#MIr9;|&%ssUf9>H6#mqil>{;zB{gUmh%5!43X2 zZf}U;@}}&c9(wMcE%31a1s*4RLi`aIL{jBv7-b6%HD~vT1}#K?sg*892>a&nSzsS| zqFp5ba3t_xx7+Q*!+%aq>K?zPN$|06HfekanU1j1eupLs- zRqD~gddOkzL)-Cj(DKoHuvyl)V!$DwIt8}VxJ&mP<6r{j%E^O)4oKxDq*nGL4Up&r5_~yl`_|zNvrDajz zHs>XL8If)&6Ii6s?M3_oWHd}AfGDy42#c}gED&atItA^KT?WzhCv{j#sr zZi8D}7a`X~yl670OT45>P@BKGsPIJY57x)y1FK8+OaryzzYxt^D~3^)>$+AAI`hkK zD6EWC+TQlYHwT3V+uSPErpXIW@N?;^X&UVztX%weqaxeepczg?zJ-QwMMH5x!!ZvI zc4oE7MLVpXL(4fDazEcWer-u}4O_$@;_7)yEd|)pkTKl|87suLVp=AFwV!1qcY}&) zpEqw2Suw5CX8mDN0%M0o^~asH@wl@h{egX!@Zrcw+dHQ8ho&0FnZQN5dhGB2j8+W9 T=8sbC00000NkvXXu0mjfg&3Wa literal 0 HcmV?d00001 diff --git a/src/config/ENV.ts b/src/config/ENV.ts index ba6bdc5..c2784be 100644 --- a/src/config/ENV.ts +++ b/src/config/ENV.ts @@ -13,6 +13,7 @@ enum ALERT_TYPE { SUCCESS = 'SUCCESS', DANGER = 'DANGER', WARNING = 'WARNING', + INFO = 'INFO', } enum TOAST_POSITION { @@ -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)'], + }, }, }; diff --git a/src/containers/Dialog.tsx b/src/containers/Dialog.tsx index 1143bf6..a6afe15 100644 --- a/src/containers/Dialog.tsx +++ b/src/containers/Dialog.tsx @@ -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', @@ -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), + }, }); diff --git a/src/containers/ToastRender.tsx b/src/containers/ToastRender.tsx index d9fe5ed..a37d838 100644 --- a/src/containers/ToastRender.tsx +++ b/src/containers/ToastRender.tsx @@ -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), + }, }); diff --git a/src/service/color.ts b/src/service/color.ts index 4c8bb3c..e78747a 100644 --- a/src/service/color.ts +++ b/src/service/color.ts @@ -9,6 +9,7 @@ export type IColors = { success: string; danger: string; warning: string; + info: string; }; export class Color { diff --git a/src/service/image.ts b/src/service/image.ts index d43aef3..aa436d3 100644 --- a/src/service/image.ts +++ b/src/service/image.ts @@ -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'); } };