Skip to content

refactor: Refactor template resources #4789

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add translation
  • Loading branch information
BrunoQuaresma committed Oct 27, 2022
commit 6c5cfd555154df540aab5a1abaeb346decdcd786
9 changes: 6 additions & 3 deletions site/src/components/AppLink/ShareIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,24 @@ import GroupOutlinedIcon from "@material-ui/icons/GroupOutlined"
import { FC } from "react"
import * as TypesGen from "../../api/typesGenerated"
import Tooltip from "@material-ui/core/Tooltip"
import { useTranslation } from "react-i18next"

export interface ShareIconProps {
app: TypesGen.WorkspaceApp
}

export const ShareIcon: FC<ShareIconProps> = ({ app }) => {
const { t } = useTranslation("agent")

let shareIcon = <LockOutlinedIcon />
let shareTooltip = "Private, only accessible by you"
let shareTooltip = t("shareTooltip.private")
if (app.sharing_level === "authenticated") {
shareIcon = <GroupOutlinedIcon />
shareTooltip = "Shared with all authenticated users"
shareTooltip = t("shareTooltip.authenticated")
}
if (app.sharing_level === "public") {
shareIcon = <PublicOutlinedIcon />
shareTooltip = "Shared publicly"
shareTooltip = t("shareTooltip.public")
}

return <Tooltip title={shareTooltip}>{shareIcon}</Tooltip>
Expand Down
7 changes: 7 additions & 0 deletions site/src/i18n/en/agent.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"shareTooltip": {
"private": "Private, only accessible by you",
"authenticated": "Shared with all authenticated users",
"public": "Shared publicly"
}
}
2 changes: 2 additions & 0 deletions site/src/i18n/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import createWorkspacePage from "./createWorkspacePage.json"
import templatePage from "./templatePage.json"
import templatesPage from "./templatesPage.json"
import workspacePage from "./workspacePage.json"
import agent from "./agent.json"

export const en = {
common,
Expand All @@ -12,4 +13,5 @@ export const en = {
templatePage,
templatesPage,
createWorkspacePage,
agent,
}