forked from XiaoMo/ChatGPT-Next-Web
Fix & Refactor UI/UX Page [Settings]
- [+] fix(settings.tsx): fix conditional rendering of ListItem based on clientConfig.isApp - [+] refactor(settings.tsx): improve readability of conditional rendering code
This commit is contained in:
parent
7df868e22a
commit
dda40e29f4
@ -914,21 +914,26 @@ export function Settings() {
|
|||||||
|
|
||||||
{!accessStore.hideUserApiKey && (
|
{!accessStore.hideUserApiKey && (
|
||||||
<>
|
<>
|
||||||
<ListItem
|
{
|
||||||
title={Locale.Settings.Access.CustomEndpoint.Title}
|
// Conditionally render the following ListItem based on clientConfig.isApp
|
||||||
subTitle={Locale.Settings.Access.CustomEndpoint.SubTitle}
|
!clientConfig?.isApp && ( // only show if isApp is false
|
||||||
>
|
<ListItem
|
||||||
<input
|
title={Locale.Settings.Access.CustomEndpoint.Title}
|
||||||
type="checkbox"
|
subTitle={Locale.Settings.Access.CustomEndpoint.SubTitle}
|
||||||
checked={accessStore.useCustomConfig}
|
>
|
||||||
onChange={(e) =>
|
<input
|
||||||
accessStore.update(
|
type="checkbox"
|
||||||
(access) =>
|
checked={accessStore.useCustomConfig}
|
||||||
(access.useCustomConfig = e.currentTarget.checked),
|
onChange={(e) =>
|
||||||
)
|
accessStore.update(
|
||||||
}
|
(access) =>
|
||||||
></input>
|
(access.useCustomConfig = e.currentTarget.checked),
|
||||||
</ListItem>
|
)
|
||||||
|
}
|
||||||
|
></input>
|
||||||
|
</ListItem>
|
||||||
|
)
|
||||||
|
}
|
||||||
{accessStore.useCustomConfig && (
|
{accessStore.useCustomConfig && (
|
||||||
<>
|
<>
|
||||||
<ListItem
|
<ListItem
|
||||||
|
Loading…
Reference in New Issue
Block a user