Skip to content

Commit

Permalink
add string extension setting type
Browse files Browse the repository at this point in the history
  • Loading branch information
xgi committed Sep 20, 2022
1 parent 4650baf commit 3d67542
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/extensions/ExtensionSettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
import { ipcRenderer } from 'electron';
import log from 'electron-log';
import { SettingType } from 'houdoku-extension-lib';
import { Button, Group, Modal, Switch, Text } from '@mantine/core';
import { Button, Group, Input, Modal, Switch, Text } from '@mantine/core';
import ipcChannels from '../../constants/ipcChannels.json';
import storeKeys from '../../constants/storeKeys.json';
import persistantStore from '../../util/persistantStore';
Expand Down Expand Up @@ -55,6 +55,13 @@ const ExtensionSettingsModal: React.FC<Props> = (props: Props) => {
switch (settingType) {
case SettingType.BOOLEAN:
return <Switch defaultChecked={curVal} onChange={(e) => onChangeFn(e.target.checked)} />;
case SettingType.STRING:
return (
<Input
value={curVal}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => onChangeFn(e.target.value)}
/>
);
default:
return <></>;
}
Expand Down

0 comments on commit 3d67542

Please sign in to comment.