Skip to content

Commit 1cfdd5d

Browse files
feat(web): update links on sidebar [VIZ-2201] (#1788)
2 parents 59d72ce + bf4e8d9 commit 1cfdd5d

File tree

6 files changed

+55
-17
lines changed

6 files changed

+55
-17
lines changed

web/src/app/features/Dashboard/index.tsx

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import Tooltip from "@reearth/app/lib/reearth-ui/components/Tooltip";
21
import { DEFAULT_SIDEBAR_WIDTH } from "@reearth/app/ui/components/Sidebar";
3-
import { useT } from "@reearth/services/i18n";
2+
import { useLang, useT } from "@reearth/services/i18n";
43
import { styled } from "@reearth/services/theme";
54
import { FC, useMemo } from "react";
65

@@ -18,6 +17,8 @@ export type DashboardProps = {
1817

1918
const Dashboard: FC<DashboardProps> = ({ workspaceId }) => {
2019
const t = useT();
20+
const lang = useLang();
21+
2122
const topTabItems: Omit<TabItems[], "active"> = useMemo(
2223
() => [
2324
{ id: "projects", text: t("Projects"), icon: "grid" },
@@ -33,29 +34,31 @@ const Dashboard: FC<DashboardProps> = ({ workspaceId }) => {
3334
id: "plugin",
3435
text: t("Plugin Playground"),
3536
icon: "puzzlePiece",
36-
tileComponent: <Tooltip type="experimental" />,
3737
path: "/plugin-playground"
3838
},
3939
{
4040
id: "documentation",
4141
text: t("Documentation"),
4242
icon: "book",
43-
disabled: true
43+
path:
44+
lang === "ja"
45+
? "https://eukarya.notion.site/Visualizer-1a816e0fb16580bda8b2c2699f80399c"
46+
: "https://eukarya.notion.site/Visualizer-User-manual-1a816e0fb16580e3a26ac6e35f23a166"
4447
},
4548
{
46-
id: "community",
47-
text: t("Community"),
48-
icon: "usersFour",
49-
disabled: true
49+
id: "discord",
50+
text: t("Discord"),
51+
icon: "discord",
52+
path: "https://discord.com/invite/XJhYkQQDAu"
5053
},
5154
{
52-
id: "help",
53-
text: t("Help & Support"),
55+
id: "faq",
56+
text: t("FAQ"),
5457
icon: "question",
55-
disabled: true
58+
path: "https://eukarya.notion.site/FAQ-19616e0fb16580f190aace7a918bfdd2"
5659
}
5760
],
58-
[t]
61+
[t, lang]
5962
);
6063

6164
const {
Lines changed: 8 additions & 0 deletions
Loading

web/src/app/lib/reearth-ui/components/Icon/icons.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import Dashboard from "./Icons/Dashboard.svg?react";
4848
import Data from "./Icons/Data.svg?react";
4949
import Desktop from "./Icons/Desktop.svg?react";
5050
import DeviceMobile from "./Icons/DeviceMobile.svg?react";
51+
import Discord from "./Icons/Discord.svg?react";
5152
import DotsSixVertical from "./Icons/DotsSixVertical.svg?react";
5253
import DotsThreeVertical from "./Icons/DotsThreeVertical.svg?react";
5354
import DownloadSimple from "./Icons/DownloadSimple.svg?react";
@@ -224,6 +225,7 @@ export default {
224225
data: Data,
225226
desktop: Desktop,
226227
deviceMobile: DeviceMobile,
228+
discord: Discord,
227229
dotsSixVertical: DotsSixVertical,
228230
dotsThreeVertical: DotsThreeVertical,
229231
downloadSimple: DownloadSimple,

web/src/app/ui/components/Sidebar/index.tsx

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,32 @@ export const SidebarMenuItem: FC<
113113
);
114114
};
115115

116-
const StyledLinkButton = styled(Link)<{ disabled?: boolean }>(
116+
const StyledLinkButton = styled(
117+
({
118+
disabled,
119+
to,
120+
children,
121+
...props
122+
}: {
123+
disabled?: boolean;
124+
to: string;
125+
children?: React.ReactNode;
126+
}) => {
127+
const isExternal = /^https?:\/\//.test(to);
128+
if (isExternal) {
129+
return (
130+
<a href={to} target="_blank" rel="noopener noreferrer" {...props}>
131+
{children}
132+
</a>
133+
);
134+
}
135+
return (
136+
<Link to={to} {...props}>
137+
{children}
138+
</Link>
139+
);
140+
}
141+
)<{ disabled?: boolean; to: string; children?: React.ReactNode }>(
117142
({ disabled }) => ({
118143
pointerEvents: disabled ? "none" : "auto",
119144
textDecoration: "none"

web/src/services/i18n/translations/en.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ Members: ''
112112
Recycle bin: ''
113113
Plugin Playground: ''
114114
Documentation: ''
115-
Community: ''
116-
Help & Support: ''
115+
Discord: ''
116+
FAQ: ''
117117
Switch workspace: ''
118118
Personal: ''
119119
Team Workspace: ''

web/src/services/i18n/translations/ja.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ Members: メンバー
114114
Recycle bin: ゴミ箱
115115
Plugin Playground: プラグインプレイグラウンド
116116
Documentation: ドキュメント
117-
Community: コミュニティ
118-
Help & Support: ヘルプ&サポート
117+
Discord: ''
118+
FAQ: ''
119119
Switch workspace: ワークスペース切り替え
120120
Personal: 個人
121121
Team Workspace: チームワークスペース

0 commit comments

Comments
 (0)