Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

fix: resolve i18n review issues and improve UI components

Andrej7a2172f0742b
diff --git a/apps/api/src/activity/index.ts b/apps/api/src/activity/index.ts
index 243230049..1d1776496 100644
--- a/apps/api/src/activity/index.ts
+++ b/apps/api/src/activity/index.ts
@@ -193,12 +193,12 @@ subscribeToEvent<{
taskId: string;
userId: string;
type: string;
- content: string;
+ content: string | null;
}>("task.created", async (data) => {
- if (!data.userId || !data.taskId || !data.type || !data.content) {
+ if (!data.userId || !data.taskId || !data.type) {
return;
}
- await createActivity(data.taskId, data.type, data.userId, data.content, null);
+ await createActivity(data.taskId, data.type, data.userId, null, {});
});
subscribeToEvent<{
diff --git a/apps/api/src/search/controllers/global-search.ts b/apps/api/src/search/controllers/global-search.ts
index 83689f3ad..311b29e29 100644
--- a/apps/api/src/search/controllers/global-search.ts
+++ b/apps/api/src/search/controllers/global-search.ts
@@ -1,4 +1,4 @@
-import { and, desc, eq, ilike, or, sql } from "drizzle-orm";
+import { and, desc, eq, ilike, inArray, or, sql } from "drizzle-orm";
import db from "../../database";
import {
activityTable,
@@ -87,6 +87,8 @@ function getActivitySearchContent(
return `changed due date from ${String(data.oldDueDate)} to ${String(data.newDueDate)}`;
case "title_changed":
return `changed title from "${String(data.oldTitle ?? "")}" to "${String(data.newTitle ?? "")}"`;
+ case "task":
+ return "created the task";
default:
return undefined;
}
@@ -142,7 +144,7 @@ async function globalSearch(params: SearchParams): Promise<{
const workspaceFilter = workspaceId
? eq(projectTable.workspaceId, workspaceId)
- : sql`${projectTable.workspaceId} IN ${accessibleWorkspaceIds}`;
+ : inArray(projectTable.workspaceId, accessibleWorkspaceIds);
// Check if query matches short-id pattern (e.g. "DEP-23")
const shortIdMatch = query.match(/^([A-Za-z][\w-]*)-(\d+)$/);
@@ -151,12 +153,9 @@ async function globalSearch(params: SearchParams): Promise<{
const seenTaskIds = new Set<string>();
// If query matches short-id pattern, look up by project slug + task number first
- if (shortIdMatch) {
+ if (shortIdMatch?.[1] && shortIdMatch[2]) {
const slug = shortIdMatch[1];
const numberStr = shortIdMatch[2];
- if (!slug || !numberStr) {
- return { results: [], totalCount: 0, searchQuery: query };
- }
const taskNumber = Number.parseInt(numberStr, 10);
const shortIdTasks = await db
@@ -361,7 +360,7 @@ async function globalSearch(params: SearchParams): Promise<{
)
.where(
and(
- sql`${workspaceTable.id} IN ${accessibleWorkspaceIds}`,
+ inArray(workspaceTable.id, accessibleWorkspaceIds),
or(
ilike(workspaceTable.name, searchPattern),
ilike(workspaceTable.description, searchPattern),
diff --git a/apps/api/src/task/controllers/create-task.ts b/apps/api/src/task/controllers/create-task.ts
index e1aadcbce..1dbc75496 100644
--- a/apps/api/src/task/controllers/create-task.ts
+++ b/apps/api/src/task/controllers/create-task.ts
@@ -86,7 +86,7 @@ async function createTask({
taskId: createdTask.id,
userId: createdTask.userId ?? "",
type: "task",
- content: "created the task",
+ content: null,
});
return {
diff --git a/apps/web/src/components/board/board-toolbar.tsx b/apps/web/src/components/board/board-toolbar.tsx
index 2b3f8c5da..0fc1e8d56 100644
--- a/apps/web/src/components/board/board-toolbar.tsx
+++ b/apps/web/src/components/board/board-toolbar.tsx
@@ -651,7 +651,7 @@ export default function BoardToolbar({
onClick={() => setViewMode("board")}
>
<PanelsTopLeft className="h-3 w-3" />
- Board
+ {t("tasks:view.board")}
</button>
<button
type="button"
@@ -663,7 +663,7 @@ export default function BoardToolbar({
onClick={() => setViewMode("list")}
>
<Rows3 className="h-3 w-3" />
- List
+ {t("tasks:view.list")}
</button>
</div>
</div>
diff --git a/apps/web/src/components/bulk-selection/backlog-bulk-toolbar.tsx b/apps/web/src/components/bulk-selection/backlog-bulk-toolbar.tsx
index 3b57f24b2..13e4dd29f 100644
--- a/apps/web/src/components/bulk-selection/backlog-bulk-toolbar.tsx
+++ b/apps/web/src/components/bulk-selection/backlog-bulk-toolbar.tsx
@@ -12,6 +12,7 @@ import {
type ReactNode,
useCallback,
useEffect,
+ useMemo,
useState,
} from "react";
import { useTranslation } from "react-i18next";
@@ -74,13 +75,16 @@ function BacklogBulkToolbar() {
const { selectedTaskIds, clearSelection, selectAll } =
useBacklogBulkSelectionStore();
- const priorityOptions = [
- { value: "urgent", label: getPriorityLabel("urgent") },
- { value: "high", label: getPriorityLabel("high") },
- { value: "medium", label: getPriorityLabel("medium") },
- { value: "low", label: getPriorityLabel("low") },
- { value: "no-priority", label: getPriorityLabel("no-priority") },
- ];
+ const priorityOptions = useMemo(
+ () => [
+ { value: "urgent", label: getPriorityLabel("urgent") },
+ { value: "high", label: getPriorityLabel("high") },
+ { value: "medium", label: getPriorityLabel("medium") },
+ { value: "low", label: getPriorityLabel("low") },
+ { value: "no-priority", label: getPriorityLabel("no-priority") },
+ ],
+ [],
+ );
const { project } = useProjectStore();
const {
bulkMoveToBoard,
diff --git a/apps/web/src/components/bulk-selection/bulk-toolbar.tsx b/apps/web/src/components/bulk-selection/bulk-toolbar.tsx
index 45b6d535c..ffde1a2f3 100644
--- a/apps/web/src/components/bulk-selection/bulk-toolbar.tsx
+++ b/apps/web/src/components/bulk-selection/bulk-toolbar.tsx
@@ -11,6 +11,7 @@ import {
type ReactNode,
useCallback,
useEffect,
+ useMemo,
useState,
} from "react";
import { useTranslation } from "react-i18next";
@@ -67,13 +68,16 @@ function BulkToolbar() {
const { selectedTaskIds, clearSelection, selectAll } =
useBulkSelectionStore();
- const priorityOptions = [
- { value: "urgent", label: getPriorityLabel("urgent") },
- { value: "high", label: getPriorityLabel("high") },
- { value: "medium", label: getPriorityLabel("medium") },
- { value: "low", label: getPriorityLabel("low") },
- { value: "no-priority", label: getPriorityLabel("no-priority") },
- ];
+ const priorityOptions = useMemo(
+ () => [
+ { value: "urgent", label: getPriorityLabel("urgent") },
+ { value: "high", label: getPriorityLabel("high") },
+ { value: "medium", label: getPriorityLabel("medium") },
+ { value: "low", label: getPriorityLabel("low") },
+ { value: "no-priority", label: getPriorityLabel("no-priority") },
+ ],
+ [],
+ );
const { project } = useProjectStore();
const {
bulkMoveToBacklog,
diff --git a/apps/web/src/components/list-view/index.tsx b/apps/web/src/components/list-view/index.tsx
index 517a8f656..2ad8fa399 100644
--- a/apps/web/src/components/list-view/index.tsx
+++ b/apps/web/src/components/list-view/index.tsx
@@ -14,7 +14,10 @@ import {
useSensors,
} from "@dnd-kit/core";
import { snapCenterToCursor } from "@dnd-kit/modifiers";
-import { verticalListSortingStrategy } from "@dnd-kit/sortable";
+import {
+ SortableContext,
+ verticalListSortingStrategy,
+} from "@dnd-kit/sortable";
import { useNavigate } from "@tanstack/react-router";
import { produce } from "immer";
import { Archive, ChevronRight, Flag, Plus } from "lucide-react";
diff --git a/apps/web/src/components/project/workflow-editor.tsx b/apps/web/src/components/project/workflow-editor.tsx
index 39f111e80..07e61e536 100644
--- a/apps/web/src/components/project/workflow-editor.tsx
+++ b/apps/web/src/components/project/workflow-editor.tsx
@@ -104,7 +104,11 @@ export default function WorkflowEditor({ projectId }: WorkflowEditorProps) {
placeholder={t(
"settings:workflowEditor.selectColumnPlaceholder",
)}
- />
+ >
+ {columns.find((c) => c.id === currentRule?.columnId)
+ ?.name ??
+ t("settings:workflowEditor.selectColumnPlaceholder")}
+ </SelectValue>
</SelectTrigger>
<SelectContent>
{columns.map((col) => (
diff --git a/apps/web/src/components/settings/create-api-key-dialog.tsx b/apps/web/src/components/settings/create-api-key-dialog.tsx
index 34ae56912..fe5d2b105 100644
--- a/apps/web/src/components/settings/create-api-key-dialog.tsx
+++ b/apps/web/src/components/settings/create-api-key-dialog.tsx
@@ -203,7 +203,11 @@ export function CreateApiKeyDialog({
placeholder={t(
"settings:apiKey.createDialog.expirationPlaceholder",
)}
- />
+ >
+ {expirationOptions.find(
+ (o) => o.value === field.value,
+ )?.label ?? field.value}
+ </SelectValue>
</SelectTrigger>
<SelectContent>
{expirationOptions.map((option) => (
diff --git a/apps/web/src/hooks/use-locale.ts b/apps/web/src/hooks/use-locale.ts
index dbde07745..71449c917 100644
--- a/apps/web/src/hooks/use-locale.ts
+++ b/apps/web/src/hooks/use-locale.ts
@@ -1,3 +1,4 @@
+import type { AppLocale } from "@i18n/resources";
import { useQueryClient } from "@tanstack/react-query";
import { useMemo } from "react";
import { useTranslation } from "react-i18next";
@@ -13,14 +14,16 @@ export function useLocale() {
[i18n.resolvedLanguage],
);
- const setLocale = async (nextLocale: string) => {
+ const setLocale = async (nextLocale: AppLocale) => {
const { error } = await authClient.updateUser({ locale: nextLocale });
if (error) {
throw new Error(error.message || "Failed to update locale");
}
+ const resolved = resolveLocale(nextLocale, null);
+ document.documentElement.lang = resolved;
await queryClient.invalidateQueries({ queryKey: ["session"] });
- await i18n.changeLanguage(resolveLocale(nextLocale, null));
+ await i18n.changeLanguage(resolved);
};
return {
diff --git a/apps/web/src/lib/i18n/index.ts b/apps/web/src/lib/i18n/index.ts
index 8c63a3a5d..93a3333de 100644
--- a/apps/web/src/lib/i18n/index.ts
+++ b/apps/web/src/lib/i18n/index.ts
@@ -44,6 +44,7 @@ void i18n.use(initReactI18next).init({
resources,
lng: resolveLocale(null, getBrowserLocale()),
fallbackLng: defaultLocale,
+ ns: Object.keys(resources[defaultLocale]),
defaultNS: "common",
interpolation: {
escapeValue: false,
diff --git a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/account/preferences.tsx b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/account/preferences.tsx
index ef7414560..64d5ca028 100644
--- a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/account/preferences.tsx
+++ b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/account/preferences.tsx
@@ -1,5 +1,6 @@
+import type { AppLocale } from "@i18n/resources";
import { createFileRoute } from "@tanstack/react-router";
-import { LayoutGrid, List, RotateCcw } from "lucide-react";
+import { RotateCcw } from "lucide-react";
import { useTranslation } from "react-i18next";
import { Button } from "@/components/ui/button";
import { Label } from "@/components/ui/label";
@@ -29,8 +30,6 @@ function RouteComponent() {
setTheme,
viewMode,
setViewMode,
- compactMode,
- setCompactMode,
showTaskNumbers,
setShowTaskNumbers,
showAssignees,
@@ -46,6 +45,22 @@ function RouteComponent() {
setSidebarDefaultOpen,
} = useUserPreferencesStore();
+ const themeLabels: Record<string, string> = {
+ light: t("settings:preferencesPage.themeLight"),
+ dark: t("settings:preferencesPage.themeDark"),
+ system: t("settings:preferencesPage.themeSystem"),
+ };
+
+ const viewLabels: Record<string, string> = {
+ board: t("settings:preferencesPage.board"),
+ list: t("settings:preferencesPage.list"),
+ };
+
+ const localeLabels: Record<string, string> = {
+ "en-US": t("common:language.english"),
+ "de-DE": t("common:language.german"),
+ };
+
return (
<div className="max-w-4xl mx-auto space-y-8">
<div className="space-y-2">
@@ -81,42 +96,22 @@ function RouteComponent() {
value={theme}
onValueChange={(value) => value && setTheme(value)}
>
- <SelectTrigger className="!py-4">
+ <SelectTrigger size="sm" className="w-40">
<SelectValue
placeholder={t("settings:preferencesPage.selectTheme")}
- />
+ >
+ {themeLabels[theme]}
+ </SelectValue>
</SelectTrigger>
<SelectContent>
<SelectItem value="light">
- <div className="flex items-center gap-3">
- <div className="flex items-center gap-1 rounded-md border border-border bg-muted p-1">
- <span className="rounded-full size-2 bg-primary" />
- <span className="text-xs font-normal text-foreground">
- Aa
- </span>
- </div>
- <span className="text-xs font-normal">
- {t("settings:preferencesPage.themeLight")}
- </span>
- </div>
+ {t("settings:preferencesPage.themeLight")}
</SelectItem>
<SelectItem value="dark">
- <div className="flex items-center gap-3">
- <div className="flex items-center gap-1 rounded-md border border-border bg-card p-1">
- <span className="rounded-full size-2 bg-primary" />
- <span className="text-xs font-normal text-foreground">
- Aa
- </span>
- </div>
- <span className="text-xs font-normal">
- {t("settings:preferencesPage.themeDark")}
- </span>
- </div>
+ {t("settings:preferencesPage.themeDark")}
</SelectItem>
<SelectItem value="system">
- <span className="text-xs font-normal">
- {t("settings:preferencesPage.themeSystem")}
- </span>
+ {t("settings:preferencesPage.themeSystem")}
</SelectItem>
</SelectContent>
</Select>
@@ -137,14 +132,16 @@ function RouteComponent() {
value={locale ?? "en-US"}
onValueChange={(value) => {
if (value) {
- void setLocale(value);
+ void setLocale(value as AppLocale);
}
}}
>
- <SelectTrigger className="!py-4">
+ <SelectTrigger size="sm" className="w-40">
<SelectValue
placeholder={t("settings:preferencesPage.selectLanguage")}
- />
+ >
+ {localeLabels[locale ?? "en-US"]}
+ </SelectValue>
</SelectTrigger>
<SelectContent>
<SelectItem value="en-US">
@@ -172,27 +169,19 @@ function RouteComponent() {
value={viewMode}
onValueChange={(value) => value && setViewMode(value)}
>
- <SelectTrigger className="!py-4">
+ <SelectTrigger size="sm" className="w-40">
<SelectValue
placeholder={t("settings:preferencesPage.selectViewMode")}
- />
+ >
+ {viewLabels[viewMode]}
+ </SelectValue>
</SelectTrigger>
<SelectContent>
<SelectItem value="board">
- <div className="flex items-center gap-3">
- <LayoutGrid className="h-4 w-4 mr-1" />
- <span className="text-xs font-normal">
- {t("settings:preferencesPage.board")}
- </span>
- </div>
+ {t("settings:preferencesPage.board")}
</SelectItem>
<SelectItem value="list">
- <div className="flex items-center gap-3">
- <List className="h-4 w-4 mr-1" />
- <span className="text-xs font-normal">
- {t("settings:preferencesPage.list")}
- </span>
- </div>
+ {t("settings:preferencesPage.list")}
</SelectItem>
</SelectContent>
</Select>
@@ -200,20 +189,6 @@ function RouteComponent() {
<Separator />
- <div className="flex items-center justify-between">
- <div className="space-y-0.5">
- <Label className="text-sm font-medium">
- {t("settings:preferencesPage.compactMode")}
- </Label>
- <p className="text-xs text-muted-foreground">
- {t("settings:preferencesPage.compactModeDescription")}
- </p>
- </div>
- <Switch checked={compactMode} onCheckedChange={setCompactMode} />
- </div>
-
- <Separator />
-
<div className="flex items-center justify-between">
<div className="space-y-0.5">
<Label className="text-sm font-medium">
diff --git a/apps/web/src/routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/board.tsx b/apps/web/src/routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/board.tsx
index bad878c62..01ca53d9a 100644
--- a/apps/web/src/routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/board.tsx
+++ b/apps/web/src/routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/board.tsx
@@ -34,6 +34,46 @@ export const Route = createFileRoute(
}),
});
+const skeletonColumns = [
+ { key: "col-todo", cards: 3 },
+ { key: "col-progress", cards: 4 },
+ { key: "col-review", cards: 2 },
+ { key: "col-done", cards: 1 },
+];
+
+function BoardSkeleton() {
+ return (
+ <div className="flex h-full w-full gap-4 p-4 overflow-hidden">
+ {skeletonColumns.map((col) => (
+ <div key={col.key} className="flex w-72 shrink-0 flex-col gap-3">
+ <div className="flex items-center gap-2 px-1">
+ <div className="h-3 w-3 rounded-full bg-muted animate-pulse" />
+ <div className="h-4 w-24 rounded bg-muted animate-pulse" />
+ <div className="h-4 w-5 rounded bg-muted animate-pulse" />
+ </div>
+ <div className="flex flex-col gap-2.5">
+ {Array.from({ length: col.cards }, (_, i) => `${col.key}-${i}`).map(
+ (cardKey) => (
+ <div
+ key={cardKey}
+ className="rounded-lg border border-border bg-card p-3 space-y-2.5"
+ >
+ <div className="h-3.5 w-4/5 rounded bg-muted animate-pulse" />
+ <div className="h-3 w-3/5 rounded bg-muted animate-pulse" />
+ <div className="flex items-center gap-2 pt-1">
+ <div className="h-5 w-5 rounded-full bg-muted animate-pulse" />
+ <div className="h-3 w-16 rounded bg-muted animate-pulse" />
+ </div>
+ </div>
+ ),
+ )}
+ </div>
+ </div>
+ ))}
+ </div>
+ );
+}
+
function RouteComponent() {
const { t } = useTranslation();
const { projectId, workspaceId } = Route.useParams();
@@ -209,9 +249,7 @@ function RouteComponent() {
/>
)
) : (
- <div className="flex h-full items-center justify-center">
- <div className="h-8 w-8 animate-spin rounded-full border-2 border-border border-t-foreground" />
- </div>
+ <BoardSkeleton />
)}
</div>
diff --git a/i18n/de-DE.json b/i18n/de-DE.json
index 5f9800c5e..7f6873071 100644
--- a/i18n/de-DE.json
+++ b/i18n/de-DE.json
@@ -335,8 +335,7 @@
"selectViewMode": "Ansicht auswählen",
"board": "Board",
"list": "Liste",
- "compactMode": "Kompakter Modus",
- "compactModeDescription": "Verwende geringere Abstände für mehr Inhalt",
+ "gantt": "Gantt",
"sidebarDefault": "Standard-Sidebar",
"sidebarDefaultDescription": "Sidebar beim Start erweitert geöffnet halten",
"displayOptions": "Anzeigeoptionen",
diff --git a/i18n/en-US.json b/i18n/en-US.json
index bc682d5e1..5af2121f0 100644
--- a/i18n/en-US.json
+++ b/i18n/en-US.json
@@ -335,8 +335,7 @@
"selectViewMode": "Select a view mode",
"board": "Board",
"list": "List",
- "compactMode": "Compact Mode",
- "compactModeDescription": "Use reduced spacing for more content",
+ "gantt": "Gantt",
"sidebarDefault": "Sidebar Default",
"sidebarDefaultDescription": "Keep sidebar expanded on startup",
"displayOptions": "Display options",
diff --git a/packages/email/src/templates/magic-link.tsx b/packages/email/src/templates/magic-link.tsx
index 1005b37d7..60ff28fcc 100644
--- a/packages/email/src/templates/magic-link.tsx
+++ b/packages/email/src/templates/magic-link.tsx
@@ -1,5 +1,6 @@
import { Link, Section, Text } from "@react-email/components";
import React from "react";
+import { resolveEmailLocale } from "./resolve-locale";
import { EmailShell, styles } from "./shell";
void React;
@@ -33,9 +34,7 @@ const messages = {
} as const;
const MagicLinkEmail = ({ magicLink, locale }: MagicLinkEmailProps) => {
- const copy = locale?.toLowerCase().startsWith("de")
- ? messages.de
- : messages.en;
+ const copy = messages[resolveEmailLocale(locale)];
return (
<EmailShell
diff --git a/packages/email/src/templates/otp.tsx b/packages/email/src/templates/otp.tsx
index 69167e661..db77cd3a0 100644
--- a/packages/email/src/templates/otp.tsx
+++ b/packages/email/src/templates/otp.tsx
@@ -1,5 +1,6 @@
import { Section, Text } from "@react-email/components";
import React from "react";
+import { resolveEmailLocale } from "./resolve-locale";
import { EmailShell, styles } from "./shell";
void React;
@@ -32,9 +33,7 @@ const messages = {
} as const;
const OtpEmail = ({ otp, locale }: OtpEmailProps) => {
- const copy = locale?.toLowerCase().startsWith("de")
- ? messages.de
- : messages.en;
+ const copy = messages[resolveEmailLocale(locale)];
return (
<EmailShell
diff --git a/packages/email/src/templates/resolve-locale.ts b/packages/email/src/templates/resolve-locale.ts
new file mode 100644
index 000000000..7802032bd
--- /dev/null
+++ b/packages/email/src/templates/resolve-locale.ts
@@ -0,0 +1,20 @@
+const supportedLocales = ["en", "de"] as const;
+
+type EmailLocale = (typeof supportedLocales)[number];
+
+const defaultLocale: EmailLocale = "en";
+
+export function resolveEmailLocale(locale?: string | null): EmailLocale {
+ if (!locale) return defaultLocale;
+
+ const normalized = locale.toLowerCase();
+
+ const exact = supportedLocales.find((l) => l === normalized);
+ if (exact) return exact;
+
+ const languageCode = normalized.split("-")[0];
+ const match = supportedLocales.find((l) => l === languageCode);
+ if (match) return match;
+
+ return defaultLocale;
+}
diff --git a/packages/email/src/templates/workspace-invitation.tsx b/packages/email/src/templates/workspace-invitation.tsx
index e5e828801..d54678844 100644
--- a/packages/email/src/templates/workspace-invitation.tsx
+++ b/packages/email/src/templates/workspace-invitation.tsx
@@ -1,5 +1,6 @@
import { Link, Section, Text } from "@react-email/components";
import React from "react";
+import { resolveEmailLocale } from "./resolve-locale";
import { EmailShell, styles } from "./shell";
void React;
@@ -51,30 +52,28 @@ const WorkspaceInvitationEmail = ({
invitationLink,
to,
locale,
-}: WorkspaceInvitationEmailProps) =>
- (() => {
- const localeKey = locale?.toLowerCase().startsWith("de") ? "de" : "en";
- const copy = messages[localeKey];
- const values = { workspaceName, inviterName, inviterEmail };
+}: WorkspaceInvitationEmailProps) => {
+ const copy = messages[resolveEmailLocale(locale)];
+ const values = { workspaceName, inviterName, inviterEmail };
- return (
- <EmailShell
- preview={interpolate(copy.preview, values)}
- title={interpolate(copy.title, values)}
- subtitle={interpolate(copy.subtitle, values)}
- >
- <Section>
- <Link style={styles.button} href={`${invitationLink}?email=${to}`}>
- {copy.cta}
- </Link>
- <Text style={styles.paragraph}>{copy.sameEmail}</Text>
- <Text style={styles.muted}>{copy.ignore}</Text>
- <Section style={styles.divider} />
- <Text style={styles.footer}>{copy.footer}</Text>
- </Section>
- </EmailShell>
- );
- })();
+ return (
+ <EmailShell
+ preview={interpolate(copy.preview, values)}
+ title={interpolate(copy.title, values)}
+ subtitle={interpolate(copy.subtitle, values)}
+ >
+ <Section>
+ <Link style={styles.button} href={`${invitationLink}?email=${to}`}>
+ {copy.cta}
+ </Link>
+ <Text style={styles.paragraph}>{copy.sameEmail}</Text>
+ <Text style={styles.muted}>{copy.ignore}</Text>
+ <Section style={styles.divider} />
+ <Text style={styles.footer}>{copy.footer}</Text>
+ </Section>
+ </EmailShell>
+ );
+};
WorkspaceInvitationEmail.PreviewProps = {
workspaceName: "Acme Inc",