mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-09-30 23:26:39 +08:00
Update settings.tsx
display the font size number and example by the font size setting.
This commit is contained in:
parent
8b4db412d8
commit
b8222f5a1b
@ -251,6 +251,13 @@ export function Settings(props: { closeSettings: () => void }) {
|
|||||||
title={Locale.Settings.FontSize.Title}
|
title={Locale.Settings.FontSize.Title}
|
||||||
subTitle={Locale.Settings.FontSize.SubTitle}
|
subTitle={Locale.Settings.FontSize.SubTitle}
|
||||||
>
|
>
|
||||||
|
<>
|
||||||
|
<span
|
||||||
|
id="fontSizeDisplay"
|
||||||
|
style={{ fontSize: `${config.fontSize ?? 14}px` }}
|
||||||
|
>
|
||||||
|
{config.fontSize ?? 14}px
|
||||||
|
</span>
|
||||||
<input
|
<input
|
||||||
type="range"
|
type="range"
|
||||||
title={`${config.fontSize ?? 14}px`}
|
title={`${config.fontSize ?? 14}px`}
|
||||||
@ -261,10 +268,20 @@ export function Settings(props: { closeSettings: () => void }) {
|
|||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
updateConfig(
|
updateConfig(
|
||||||
(config) =>
|
(config) =>
|
||||||
(config.fontSize = Number.parseInt(e.currentTarget.value)),
|
(config.fontSize = Number.parseInt(
|
||||||
|
e.currentTarget.value,
|
||||||
|
)),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
onMouseMove={(e) => {
|
||||||
|
const fontSizeDisplay =
|
||||||
|
document.getElementById("fontSizeDisplay");
|
||||||
|
if (fontSizeDisplay) {
|
||||||
|
fontSizeDisplay.innerText = `${e.currentTarget.value}px`;
|
||||||
|
}
|
||||||
|
}}
|
||||||
></input>
|
></input>
|
||||||
|
</>
|
||||||
</SettingItem>
|
</SettingItem>
|
||||||
|
|
||||||
<div className="no-mobile">
|
<div className="no-mobile">
|
||||||
|
Loading…
Reference in New Issue
Block a user