Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 0 additions & 12 deletions apps/app/src/hooks/use-translate.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
SettingsNotice,
SettingsSectionHeaderDescription,
} from "../settings-section";
import { useTranslate } from "@/hooks/use-translate";
import { t } from "@/i18n";

export interface CloudAccountSectionProps {
activeOrgId: string;
Expand All @@ -43,10 +43,9 @@ export function CloudAccountSection({
onRefreshOrgs,
onSignOut,
}: CloudAccountSectionProps) {
const { tr } = useTranslate();
const activeOrgOptions = orgs.map((org) => ({
value: org.id,
label: `${org.name} ${org.role === "owner" ? tr("den.org_owner_suffix") : tr("den.org_member_suffix")}`,
label: `${org.name} ${org.role === "owner" ? t("den.org_owner_suffix") : t("den.org_member_suffix")}`,
}));
const handleActiveOrgChange = (orgId: string | null) => {
if (orgId === null) {
Expand All @@ -59,8 +58,8 @@ export function CloudAccountSection({
return (
<section className="flex flex-col gap-y-8">
<div>
<div className="text-sm font-medium text-dls-text">{tr("den.cloud_account_title")}</div>
<SettingsSectionHeaderDescription>{tr("den.cloud_account_hint")}</SettingsSectionHeaderDescription>
<div className="text-sm font-medium text-dls-text">{t("den.cloud_account_title")}</div>
<SettingsSectionHeaderDescription>{t("den.cloud_account_hint")}</SettingsSectionHeaderDescription>
</div>

<div className="flex flex-col gap-8">
Expand All @@ -79,14 +78,14 @@ export function CloudAccountSection({
disabled={[authBusy, sessionBusy].some(Boolean)}
>
<LogOut className="size-4" />
{authBusy ? tr("den.signing_out") : tr("den.sign_out")}
{authBusy ? t("den.signing_out") : t("den.sign_out")}
</Button>
</div>

<div className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
<div className="min-w-0 flex flex-col gap-y-1">
<div className="text-sm font-medium text-dls-text">{tr("den.active_org_title")}</div>
<div className=" text-xs text-muted-foreground">{tr("den.active_org_hint")}</div>
<div className="text-sm font-medium text-dls-text">{t("den.active_org_title")}</div>
<div className=" text-xs text-muted-foreground">{t("den.active_org_hint")}</div>
</div>
<div className="flex shrink-0 items-center gap-2">
<div className="w-[260px] max-w-full">
Expand All @@ -98,9 +97,9 @@ export function CloudAccountSection({
>
<SelectTrigger
className="w-full"
aria-label={tr("den.active_org_title")}
aria-label={t("den.active_org_title")}
>
<SelectValue placeholder={tr("den.no_org_selected")} />
<SelectValue placeholder={t("den.no_org_selected")} />
</SelectTrigger>
<SelectContent>
<SelectGroup>
Expand All @@ -118,7 +117,7 @@ export function CloudAccountSection({
disabled={orgsBusy}
onRefresh={onRefreshOrgs}
>
{tr("den.refresh")}
{t("den.refresh")}
</RefreshButton>
</div>
</div>
Expand Down
13 changes: 6 additions & 7 deletions apps/app/src/react-app/domains/settings/cloud/dev-mode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ArrowUpRight } from "lucide-react";
import { DEFAULT_DEN_BASE_URL } from "../../../../app/lib/den";
import { Button } from "../../../design-system/button";
import { TextInput } from "../../../design-system/text-input";
import { useTranslate } from "@/hooks/use-translate";
import { t } from "@/i18n";

type CloudDevModeProps = {
authBusy: boolean;
Expand All @@ -17,17 +17,16 @@ type CloudDevModeProps = {
};

export function CloudDevMode(props: CloudDevModeProps) {
const { tr } = useTranslate();
const controlsDisabled = [props.authBusy, props.sessionBusy].some(Boolean);

return (
<div className="grid gap-3 lg:grid-cols-[minmax(0,1fr)_auto] lg:items-end">
<TextInput
label={tr("den.cloud_control_plane_url_label")}
label={t("den.cloud_control_plane_url_label")}
value={props.baseUrlDraft}
onChange={(event) => props.onBaseUrlDraftChange(event.currentTarget.value)}
placeholder={DEFAULT_DEN_BASE_URL}
hint={tr("den.cloud_control_plane_url_hint")}
hint={t("den.cloud_control_plane_url_hint")}
disabled={controlsDisabled}
/>
<div className="flex flex-wrap items-center gap-2">
Expand All @@ -37,18 +36,18 @@ export function CloudDevMode(props: CloudDevModeProps) {
onClick={props.onResetBaseUrl}
disabled={controlsDisabled}
>
{tr("den.cloud_control_plane_reset")}
{t("den.cloud_control_plane_reset")}
</Button>
<Button
variant="secondary"
className="h-9 px-3 text-xs"
onClick={props.onApplyBaseUrl}
disabled={controlsDisabled}
>
{tr("den.cloud_control_plane_save")}
{t("den.cloud_control_plane_save")}
</Button>
<Button variant="outline" className="h-9 px-3 text-xs" onClick={props.onOpenControlPlane}>
{tr("den.cloud_control_plane_open")}
{t("den.cloud_control_plane_open")}
<ArrowUpRight size={13} />
</Button>
</div>
Expand Down
Loading
Loading