File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change 11// @flow
22
33export const icons = {
4- oldMain : require ( './about/IconTrans.png' ) ,
5- windmill : require ( '../ios/AllAboutOlaf/windmill-icon/windmill.png' ) ,
4+ oldMain : require ( './about/IconTrans.png' ) ,
5+ windmill : require ( '../ios/AllAboutOlaf/windmill-icon/windmill.png' ) ,
6+ }
7+
8+ export const defaultIcon = icons . oldMain
9+
10+ // eslint-disable camelcase
11+ export const iosToNamedIconsMap : { [ key : string ] : $Keys < typeof icons > } = {
12+ icon_type_windmill : 'windmill' ,
13+ default : 'oldMain' ,
14+ }
15+ // eslint-enable camelcase
16+
17+ export function lookup ( iosIconName : $Keys < typeof iosToNamedIconsMap > ) : number {
18+ const iconName = iosToNamedIconsMap [ iosIconName ]
19+ if ( ! iconName ) {
20+ return defaultIcon
21+ }
22+
23+ const icon = icons [ iconName ]
24+ if ( ! icon ) {
25+ return defaultIcon
26+ }
27+
28+ return icon
629}
You can’t perform that action at this time.
0 commit comments