Skip to content

Commit 6ec66be

Browse files
committed
Merge branch 'main' into feat/token
2 parents b14b830 + 9b58d62 commit 6ec66be

File tree

5 files changed

+25
-7
lines changed

5 files changed

+25
-7
lines changed

packages/web/public/locales/translation/en.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,7 @@ setting:
742742
login_status: Login status
743743
rag_enabled: RAG (Amazon Kendra) Enabled
744744
rag_kb_enabled: RAG (Knowledge Base) Enabled
745+
show_email: Show Email
745746
show_tools: Show Tools
746747
show_use_case_builder: Show Use Case Builder
747748
stats: Statistics

packages/web/public/locales/translation/ja.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,7 @@ setting:
583583
login_status: ログイン状態
584584
rag_enabled: RAG (Amazon Kendra) 有効
585585
rag_kb_enabled: RAG (Knowledge Base) 有効
586+
show_email: メールアドレスの表示
586587
show_tools: ツールの表示
587588
show_use_case_builder: ユースケースビルダーの表示
588589
stats: 利用統計

packages/web/src/components/DrawerBase.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import useVersion from '../hooks/useVersion';
66
import IconWithDot from './IconWithDot';
77
import { PiChartBar, PiGear } from 'react-icons/pi';
88
import { fetchAuthSession } from 'aws-amplify/auth';
9+
import useUserSetting from '../hooks/useUserSetting';
910
import { useTranslation } from 'react-i18next';
1011

1112
type Props = BaseProps & {
@@ -15,6 +16,7 @@ type Props = BaseProps & {
1516

1617
const DrawerBase: React.FC<Props> = (props) => {
1718
const { getHasUpdate } = useVersion();
19+
const { settingShowEmail } = useUserSetting();
1820
const { t } = useTranslation();
1921

2022
// The first argument is not required, but if it is not included, the request will not be made, so 'user' string is entered
@@ -38,17 +40,13 @@ const DrawerBase: React.FC<Props> = (props) => {
3840
className={`bg-aws-squid-ink flex h-screen w-64 flex-col justify-between text-sm text-white print:hidden`}>
3941
<div className="flex h-full flex-col">
4042
{props.children}
41-
<div className="flex flex-none items-center gap-2 border-t border-gray-400 px-3 py-2">
42-
<Link
43-
to={settingUrl}
44-
className="mr-2 overflow-x-hidden hover:brightness-75">
45-
<span className="text-sm">{email}</span>
46-
</Link>
43+
<div className="flex flex-none items-center justify-between gap-x-2 border-t border-gray-400 px-3 py-2">
44+
{settingShowEmail && <div className="text-sm">{email}</div>}
4745
<div className="grow" />
4846
<Link to="/stats" title={t('stat.title')}>
4947
<PiChartBar className="text-lg" />
5048
</Link>
51-
<Link to={settingUrl} title={t('navigation.settings')}>
49+
<Link to={settingUrl}>
5250
<IconWithDot showDot={hasUpdate}>
5351
<PiGear className="text-lg" />
5452
</IconWithDot>

packages/web/src/hooks/useUserSetting.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ const useUserSetting = () => {
99
'showTools',
1010
true
1111
);
12+
const [settingShowEmail, setSettingShowEmail] = useLocalStorageBoolean(
13+
'showEmail',
14+
true
15+
);
1216

1317
return {
1418
settingTypingAnimation,
@@ -17,6 +21,8 @@ const useUserSetting = () => {
1721
setSettingShowUseCaseBuilder,
1822
settingShowTools,
1923
setSettingShowTools,
24+
settingShowEmail,
25+
setSettingShowEmail,
2026
};
2127
};
2228

packages/web/src/pages/Setting.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ const Setting = () => {
6363
setSettingShowUseCaseBuilder,
6464
settingShowTools,
6565
setSettingShowTools,
66+
settingShowEmail,
67+
setSettingShowEmail,
6668
} = useUserSetting();
6769

6870
const onClickSignout = useCallback(() => {
@@ -145,6 +147,16 @@ const Setting = () => {
145147
/>
146148
}></SettingItem>
147149

150+
<SettingItem
151+
name={t('setting.items.show_email')}
152+
value={
153+
<Switch
154+
checked={settingShowEmail}
155+
label=""
156+
onSwitch={setSettingShowEmail}
157+
/>
158+
}></SettingItem>
159+
148160
<SettingItem
149161
name={t('setting.items.login_status')}
150162
value={

0 commit comments

Comments
 (0)