Skip to content

Commit 931968d

Browse files
committed
rename iconlist to customOptionsOnlyIconList
1 parent c248192 commit 931968d

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed
1.73 KB
Loading

manager-dashboard/app/utils/common.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import twoTapIcon from '#resources/icons/2_Tap_Black.png';
3535
import threeTapIcon from '#resources/icons/3_Tap_Black.png';
3636
import angularTapIcon from '#resources/icons/tap_icon_angular.png';
3737
import swipeIcon from '#resources/icons/swipeleft_icon_black.png';
38+
import check from '#resources/icons/tick_green_on_white.png';
3839

3940
export function valueSelector<T>(item: { value: T }) {
4041
return item.value;
@@ -81,6 +82,7 @@ export type IconKey = 'add-outline'
8182
| 'ban-outline'
8283
| 'check'
8384
| 'close-outline'
85+
| 'checkmark-outline'
8486
| 'egg-outline'
8587
| 'ellipse-outline'
8688
| 'flag-outline'
@@ -131,7 +133,7 @@ function getPngIcon(src: string, alt: string) {
131133
return element;
132134
}
133135

134-
export const iconList: IconItem[] = [
136+
export const customOptionsOnlyIconList: IconItem[] = [
135137
{
136138
key: 'add-outline',
137139
label: 'Add',
@@ -147,6 +149,11 @@ export const iconList: IconItem[] = [
147149
label: 'Ban',
148150
component: IoBanOutline,
149151
},
152+
{
153+
key: 'checkmark-outline',
154+
label: 'Checkmark',
155+
component: IoCheckmarkOutline,
156+
},
150157
{
151158
key: 'close-outline',
152159
label: 'Close',
@@ -259,7 +266,9 @@ export const iconList: IconItem[] = [
259266
},
260267
];
261268

262-
const instructionsIconList: IconItem[] = [
269+
// Icon List for scenario pages only.
270+
// They need to be treated diffrently as they are loaded as pngs
271+
const scenarioOnlyIconList: IconItem[] = [
263272
{
264273
key: 'tap',
265274
label: 'Tap',
@@ -288,11 +297,11 @@ const instructionsIconList: IconItem[] = [
288297
{
289298
key: 'check',
290299
label: 'Check',
291-
component: IoCheckmarkOutline,
300+
component: getPngIcon(check, 'check'),
292301
},
293302
];
294303

295-
export const combinedIconList = [...instructionsIconList, ...iconList];
304+
export const combinedIconList = [...scenarioOnlyIconList, ...customOptionsOnlyIconList];
296305

297306
export const iconMap = listToMap(
298307
combinedIconList,

manager-dashboard/app/views/NewTutorial/CustomOptionInput/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import TextInput from '#components/TextInput';
1414
import NumberInput from '#components/NumberInput';
1515
import SelectInput from '#components/SelectInput';
1616
import NonFieldError from '#components/NonFieldError';
17-
import { iconList, keySelector, labelSelector } from '#utils/common';
17+
import { customOptionsOnlyIconList, keySelector, labelSelector } from '#utils/common';
1818

1919
import SubOptionInput from './SubOptionInput';
2020
import {
@@ -103,7 +103,7 @@ export default function CustomOptionInput(props: Props) {
103103
name="icon"
104104
label="Icon"
105105
value={value?.icon}
106-
options={iconList}
106+
options={customOptionsOnlyIconList}
107107
keySelector={keySelector}
108108
labelSelector={labelSelector}
109109
onChange={onOptionChange}

0 commit comments

Comments
 (0)