feat: i18n refactor and style adjustment

This commit is contained in:
Yidadaa
2023-04-28 00:34:37 +08:00
parent 6c1144f6f4
commit fb32770486
23 changed files with 266 additions and 156 deletions

View File

@@ -87,6 +87,8 @@ export function SideBar(props: { className?: string }) {
const { onDragMouseDown, shouldNarrow } = useDragSideBar();
const navigate = useNavigate();
const config = useAppConfig();
return (
<div
className={`${styles.sidebar} ${props.className} ${
@@ -106,14 +108,14 @@ export function SideBar(props: { className?: string }) {
<div className={styles["sidebar-header-bar"]}>
<IconButton
icon={<MaskIcon />}
text="Mask"
text={shouldNarrow ? undefined : Locale.Mask.Name}
className={styles["sidebar-bar-button"]}
onClick={() => navigate(Path.Masks)}
onClick={() => navigate(Path.NewChat, { state: { fromHome: true } })}
shadow
/>
<IconButton
icon={<PluginIcon />}
text="Plugins"
text={shouldNarrow ? undefined : Locale.Plugin.Name}
className={styles["sidebar-bar-button"]}
onClick={() => showToast(Locale.WIP)}
shadow
@@ -155,7 +157,11 @@ export function SideBar(props: { className?: string }) {
icon={<AddIcon />}
text={shouldNarrow ? undefined : Locale.Home.NewChat}
onClick={() => {
navigate(Path.NewChat);
if (config.dontShowMaskSplashScreen) {
chatStore.newSession();
} else {
navigate(Path.NewChat);
}
}}
shadow
/>