From cff9a43500d15aab42681965183c0852b4c13abd Mon Sep 17 00:00:00 2001 From: Petr Kadlec Date: Fri, 1 Nov 2024 11:02:05 +0100 Subject: [PATCH] fixup! pr feedback --- .../UserSettingsModal.module.scss | 43 -------- .../user-settings/UserSettingsModal.tsx | 98 ------------------- src/modules/api-keys/manage/ApiKeyModal.tsx | 4 +- 3 files changed, 2 insertions(+), 143 deletions(-) delete mode 100644 src/layout/user-settings/UserSettingsModal.module.scss delete mode 100644 src/layout/user-settings/UserSettingsModal.tsx diff --git a/src/layout/user-settings/UserSettingsModal.module.scss b/src/layout/user-settings/UserSettingsModal.module.scss deleted file mode 100644 index c6678fe..0000000 --- a/src/layout/user-settings/UserSettingsModal.module.scss +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright 2024 IBM Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@use 'styles/common' as *; - -.modal { - :global(.#{$prefix}--modal-container) { - min-block-size: 40vh; - } -} - -.themeToggle { - :global(.#{$prefix}--radio-button-group) { - flex-direction: column; - align-items: flex-start; - gap: $spacing-03; - } - :global(.#{$prefix}--radio-button-wrapper) { - margin: 0; - } - :global(.#{$prefix}--radio-button__appearance) { - margin-block: rem(1px); - } - :global(.#{$prefix}--radio-button__label-text) { - display: flex; - align-items: center; - column-gap: $spacing-02; - padding-block: rem(1px); - } -} diff --git a/src/layout/user-settings/UserSettingsModal.tsx b/src/layout/user-settings/UserSettingsModal.tsx deleted file mode 100644 index 94dddb4..0000000 --- a/src/layout/user-settings/UserSettingsModal.tsx +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Copyright 2024 IBM Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Modal } from '@/components/Modal/Modal'; -import { SettingsFormGroup } from '@/components/SettingsFormGroup/SettingsFormGroup'; -import { Theme, useTheme } from '@/layout/providers/ThemeProvider'; -import { - Checkbox, - FormGroup, - ModalBody, - ModalHeader, - RadioButton, - RadioButtonGroup, - Toggle, -} from '@carbon/react'; -import { Laptop, Moon, Sun } from '@carbon/react/icons'; -import { useId } from 'react'; -import { useUserSetting } from '../hooks/useUserSetting'; -import { ModalProps } from '../providers/ModalProvider'; -import classes from './UserSettingsModal.module.scss'; - -export function UserSettingsModal({ ...props }: ModalProps) { - const id = useId(); - const { getUserSetting, setUserSetting } = useUserSetting(); - const { theme, setTheme } = useTheme(); - - return ( - - -

User Settings

-
- - - { - setUserSetting('chatDebugMode', value); - }} - /> - - setTheme(theme as Theme)} - valueSelected={theme} - > - {THEMES.map(({ name, label, icon: Icon }) => ( - - {label} - - } - value={name} - /> - ))} - - - -
- ); -} - -const THEMES = [ - { - name: Theme.System, - label: 'Sync with system', - icon: Laptop, - }, - { - name: Theme.Light, - label: 'Light', - icon: Sun, - }, - { - name: Theme.Dark, - label: 'Dark', - icon: Moon, - }, -]; diff --git a/src/modules/api-keys/manage/ApiKeyModal.tsx b/src/modules/api-keys/manage/ApiKeyModal.tsx index ca2dab9..e46a486 100644 --- a/src/modules/api-keys/manage/ApiKeyModal.tsx +++ b/src/modules/api-keys/manage/ApiKeyModal.tsx @@ -186,7 +186,7 @@ export function ApiKeyModal({ ); } -ApiKeyModal.Regenerate = function ViewModal({ +ApiKeyModal.Regenerate = function RegenerateModal({ apiKey, ...props }: { @@ -245,7 +245,7 @@ ApiKeyModal.View = function ViewModal({ ); }; -ApiKeyModal.Delete = function ViewModal({ +ApiKeyModal.Delete = function DeleteModal({ apiKey, ...props }: {