@@ -3,7 +3,7 @@ import { TouchableOpacity, View } from 'react-native';
33import { DeepPartial } from 'ts-essentials' ;
44
55import { Intent } from '../../constants/Intent' ;
6- import { Theme , useTheme } from '../../theme' ;
6+ import { useTheme } from '../../theme' ;
77import { mergeStyles , ReplaceReturnType } from '../../utils/mergeStyles' ;
88import { Box } from '../Box' ;
99import { Icon } from '../Icon' ;
@@ -24,26 +24,16 @@ export interface AlertProps {
2424 getStyles ?: ReplaceReturnType < GetAlertStyles , DeepPartial < AlertStyles > > ;
2525}
2626
27- const resolveIcon = ( intent : Intent , theme : Theme ) => {
27+ const resolveIcon = ( intent : Intent ) => {
2828 switch ( intent ) {
2929 case 'success' :
30- return (
31- < Icon name = "check-circle" size = { 24 } color = { theme . colors . text . success } />
32- ) ;
30+ return < Icon name = "check-circle" size = { 24 } color = "success" /> ;
3331 case 'warning' :
34- return (
35- < Icon
36- name = "alert-triangle"
37- size = { 24 }
38- color = { theme . colors . text . warning }
39- />
40- ) ;
32+ return < Icon name = "alert-triangle" size = { 24 } color = "warning" /> ;
4133 case 'danger' :
42- return (
43- < Icon name = "alert-circle" size = { 24 } color = { theme . colors . text . danger } />
44- ) ;
34+ return < Icon name = "alert-circle" size = { 24 } color = "danger" /> ;
4535 default :
46- return < Icon name = "info" size = { 24 } color = { theme . colors . text . info } /> ;
36+ return < Icon name = "info" size = { 24 } color = " info" /> ;
4737 }
4838} ;
4939
@@ -71,7 +61,7 @@ export const Alert = (props: AlertProps) => {
7161 < View style = { containerStyle } testID = { testID } >
7262 { icon || (
7363 < Box paddingRight = { 16 } justifyContent = "center" >
74- { resolveIcon ( intent , theme ) }
64+ { resolveIcon ( intent ) }
7565 </ Box >
7666 ) }
7767 { component || (
0 commit comments