diff --git a/app/components/settings.tsx b/app/components/settings.tsx index 43d14fc47..81aec2a5a 100644 --- a/app/components/settings.tsx +++ b/app/components/settings.tsx @@ -47,6 +47,37 @@ function SettingItem(props: { ); } +function InputRange({ + title, + min, + max, + step, + value, + onChange, +}: { + title?: string; + min: string; + max: string; + step: string; + value: any; + onChange: (config: any) => void; +}) { + return ( +
+ {value} + +
+ ); +} + export function Settings(props: { closeSettings: () => void }) { const [showEmojiPicker, setShowEmojiPicker] = useState(false); const [config, updateConfig, resetConfig, clearAllData] = useChatStore( @@ -251,8 +282,7 @@ export function Settings(props: { closeSettings: () => void }) { title={Locale.Settings.FontSize.Title} subTitle={Locale.Settings.FontSize.SubTitle} > - void }) { (config.fontSize = Number.parseInt(e.currentTarget.value)), ) } - > + >
@@ -371,8 +401,7 @@ export function Settings(props: { closeSettings: () => void }) { title={Locale.Settings.HistoryCount.Title} subTitle={Locale.Settings.HistoryCount.SubTitle} > - void }) { (config.historyMessageCount = e.target.valueAsNumber), ) } - > + > void }) { title={Locale.Settings.Temperature.Title} subTitle={Locale.Settings.Temperature.SubTitle} > - void }) { e.currentTarget.valueAsNumber), ); }} - > + > void }) { title={Locale.Settings.PresencePenlty.Title} subTitle={Locale.Settings.PresencePenlty.SubTitle} > - { updateConfig( (config) => @@ -479,7 +506,7 @@ export function Settings(props: { closeSettings: () => void }) { e.currentTarget.valueAsNumber), ); }} - > + />
diff --git a/app/styles/globals.scss b/app/styles/globals.scss index b4b25b5cd..df0989afb 100644 --- a/app/styles/globals.scss +++ b/app/styles/globals.scss @@ -146,15 +146,22 @@ input[type="checkbox"]:checked::after { input[type="range"] { appearance: none; + background-color: var(--white); + color: var(--black); +} + +.input-range{ border: var(--border-in-light); border-radius: 10px; padding: 5px 15px 5px 10px; - background-color: var(--white); - color: var(--black); - - &::before { - content: attr(value); - font-size: 12px; + display: flex; + align-items: center; + font-size: 12px; + width: 156px; + height: 27.5px; + box-sizing: border-box; + >input { + width: 110px; } }