|
| 1 | +import React from 'react'; |
1 | 2 | import { |
2 | 3 | IoAddOutline, |
3 | 4 | IoAlertOutline, |
@@ -29,6 +30,12 @@ import { |
29 | 30 | import { isDefined, listToMap } from '@togglecorp/fujs'; |
30 | 31 | import { IconType } from 'react-icons'; |
31 | 32 |
|
| 33 | +import oneTapIcon from '#resources/icons/1_Tap_Black.png'; |
| 34 | +import twoTapIcon from '#resources/icons/2_Tap_Black.png'; |
| 35 | +import threeTapIcon from '#resources/icons/3_Tap_Black.png'; |
| 36 | +import tapIcon from '#resources/icons/tap_icon.png'; |
| 37 | +import angularTapIcon from '#resources/icons/tap_icon_angular.png'; |
| 38 | + |
32 | 39 | export function valueSelector<T>(item: { value: T }) { |
33 | 40 | return item.value; |
34 | 41 | } |
@@ -90,14 +97,35 @@ export type IconKey = 'addOutline' |
90 | 97 | | 'thumbsDownOutline' |
91 | 98 | | 'thumbsUpOutline' |
92 | 99 | | 'triangleOutline' |
93 | | - | 'warningOutline'; |
| 100 | + | 'warningOutline' |
| 101 | + | 'generalTap' |
| 102 | + | 'tap' |
| 103 | + | 'oneTap' |
| 104 | + | 'twoTap' |
| 105 | + | 'threeTap'; |
94 | 106 |
|
95 | 107 | export interface IconItem { |
96 | 108 | key: IconKey; |
97 | 109 | label: string; |
98 | 110 | component: IconType; |
99 | 111 | } |
100 | 112 |
|
| 113 | +function getPngIcon(src: string, alt: string) { |
| 114 | + const element = () => ( |
| 115 | + <img |
| 116 | + src={src} |
| 117 | + alt={alt} |
| 118 | + style={{ |
| 119 | + height: '1em', |
| 120 | + width: '1em', |
| 121 | + objectFit: 'contain', |
| 122 | + }} |
| 123 | + /> |
| 124 | + ); |
| 125 | + |
| 126 | + return element; |
| 127 | +} |
| 128 | + |
101 | 129 | export const iconList: IconItem[] = [ |
102 | 130 | { |
103 | 131 | key: 'addOutline', |
@@ -229,6 +257,31 @@ export const iconList: IconItem[] = [ |
229 | 257 | label: 'Warning', |
230 | 258 | component: IoWarningOutline, |
231 | 259 | }, |
| 260 | + { |
| 261 | + key: 'generalTap', |
| 262 | + label: 'General Tap', |
| 263 | + component: getPngIcon(tapIcon, 'general tap'), |
| 264 | + }, |
| 265 | + { |
| 266 | + key: 'tap', |
| 267 | + label: 'Tap', |
| 268 | + component: getPngIcon(angularTapIcon, 'tap'), |
| 269 | + }, |
| 270 | + { |
| 271 | + key: 'oneTap', |
| 272 | + label: '1-Tap', |
| 273 | + component: getPngIcon(oneTapIcon, 'one tap'), |
| 274 | + }, |
| 275 | + { |
| 276 | + key: 'twoTap', |
| 277 | + label: '2-Tap', |
| 278 | + component: getPngIcon(twoTapIcon, 'two tap'), |
| 279 | + }, |
| 280 | + { |
| 281 | + key: 'threeTap', |
| 282 | + label: '3-Tap', |
| 283 | + component: getPngIcon(threeTapIcon, 'three tap'), |
| 284 | + }, |
232 | 285 | ]; |
233 | 286 |
|
234 | 287 | export const iconMap = listToMap( |
|
0 commit comments