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(email): fix gmail mobile layout and icons

Andrej2a41318ab9e0
diff --git a/apps/web/public/email/arrow-up-right-light-dm.png b/apps/web/public/email/arrow-up-right-light-dm.png
deleted file mode 100644
index 7919a9beb..000000000
Binary files a/apps/web/public/email/arrow-up-right-light-dm.png and /dev/null differ
diff --git a/apps/web/public/email/check-circle-light-dm.png b/apps/web/public/email/check-circle-light-dm.png
deleted file mode 100644
index 7cb4b2c7a..000000000
Binary files a/apps/web/public/email/check-circle-light-dm.png and /dev/null differ
diff --git a/apps/web/public/email/credit-card-light-dm.png b/apps/web/public/email/credit-card-light-dm.png
deleted file mode 100644
index 94f33a02f..000000000
Binary files a/apps/web/public/email/credit-card-light-dm.png and /dev/null differ
diff --git a/apps/web/public/email/key-round-light-dm.png b/apps/web/public/email/key-round-light-dm.png
deleted file mode 100644
index 157cc270d..000000000
Binary files a/apps/web/public/email/key-round-light-dm.png and /dev/null differ
diff --git a/apps/web/public/email/log-in-light-dm.png b/apps/web/public/email/log-in-light-dm.png
deleted file mode 100644
index b31538f15..000000000
Binary files a/apps/web/public/email/log-in-light-dm.png and /dev/null differ
diff --git a/apps/web/public/email/users-circle-dm.png b/apps/web/public/email/users-circle-dm.png
new file mode 100644
index 000000000..585f25c54
Binary files /dev/null and b/apps/web/public/email/users-circle-dm.png differ
diff --git a/apps/web/public/email/users-circle.png b/apps/web/public/email/users-circle.png
new file mode 100644
index 000000000..9e6684a6f
Binary files /dev/null and b/apps/web/public/email/users-circle.png differ
diff --git a/apps/web/public/email/users-dark-dm.png b/apps/web/public/email/users-dark-dm.png
deleted file mode 100644
index 758e71456..000000000
Binary files a/apps/web/public/email/users-dark-dm.png and /dev/null differ
diff --git a/apps/web/public/email/users-dark.png b/apps/web/public/email/users-dark.png
deleted file mode 100644
index 9861107ce..000000000
Binary files a/apps/web/public/email/users-dark.png and /dev/null differ
diff --git a/packages/email/src/components/board-column.tsx b/packages/email/src/components/board-column.tsx
index 8ea3b63b4..1a7a2ec27 100644
--- a/packages/email/src/components/board-column.tsx
+++ b/packages/email/src/components/board-column.tsx
@@ -1,5 +1,6 @@
-import { Section, Text } from "@react-email/components";
+import { Text } from "@react-email/components";
import React from "react";
+import { Section } from "./section";
import { ThemedImg } from "./themed-img";
import { colors, shadow } from "./tokens";
@@ -27,7 +28,7 @@ export function BoardColumn({
children,
}: BoardColumnProps) {
return (
- <Section align={undefined} width="320" className="k-column" style={column}>
+ <Section className="k-column" style={column}>
<Section className="k-divider" style={header}>
<Text style={headerText}>
<ThemedImg
@@ -52,8 +53,8 @@ export function BoardColumn({
}
const column = {
- width: "320px",
- maxWidth: "100%",
+ width: "100%",
+ maxWidth: "320px",
margin: "0",
borderRadius: "14px",
borderWidth: "1px",
diff --git a/packages/email/src/components/detail-rows.tsx b/packages/email/src/components/detail-rows.tsx
index 968db29b9..4b8d58ee2 100644
--- a/packages/email/src/components/detail-rows.tsx
+++ b/packages/email/src/components/detail-rows.tsx
@@ -1,5 +1,6 @@
-import { Column, Row } from "@react-email/components";
+import { Column } from "@react-email/components";
import React from "react";
+import { Row } from "./row";
import { colors } from "./tokens";
void React;
@@ -56,6 +57,8 @@ const cell = {
const label = {
...cell,
+ paddingRight: "16px",
+ whiteSpace: "nowrap" as const,
color: colors.mutedForeground,
};
diff --git a/packages/email/src/components/email-button.tsx b/packages/email/src/components/email-button.tsx
index f7da425c9..efdb36b8d 100644
--- a/packages/email/src/components/email-button.tsx
+++ b/packages/email/src/components/email-button.tsx
@@ -1,6 +1,6 @@
-import { Button } from "@react-email/components";
+import { Button, Img } from "@react-email/components";
import React from "react";
-import { ThemedImg } from "./themed-img";
+import { emailAsset } from "./assets";
import { colors, fontFamily } from "./tokens";
void React;
@@ -29,7 +29,13 @@ export function EmailButton({
}}
>
{icon ? (
- <ThemedImg name={icon} width={16} height={16} style={iconStyle} />
+ <Img
+ src={emailAsset(icon)}
+ width="16"
+ height="16"
+ alt=""
+ style={iconStyle}
+ />
) : null}
{children}
</Button>
@@ -61,6 +67,9 @@ const block = {
};
const iconStyle = {
+ display: "inline-block",
+ border: "0",
+ mixBlendMode: "difference" as const,
margin: "0 8px 0 0",
verticalAlign: "-3px",
opacity: "0.8",
diff --git a/packages/email/src/components/email-footer.tsx b/packages/email/src/components/email-footer.tsx
index 3805136cf..5a3836560 100644
--- a/packages/email/src/components/email-footer.tsx
+++ b/packages/email/src/components/email-footer.tsx
@@ -1,5 +1,6 @@
-import { Link, Section, Text } from "@react-email/components";
+import { Link, Text } from "@react-email/components";
import React from "react";
+import { Section } from "./section";
import { colors } from "./tokens";
void React;
diff --git a/packages/email/src/components/email-note.tsx b/packages/email/src/components/email-note.tsx
index bd40a27f6..50c389bad 100644
--- a/packages/email/src/components/email-note.tsx
+++ b/packages/email/src/components/email-note.tsx
@@ -1,5 +1,6 @@
-import { Heading, Section, Text } from "@react-email/components";
+import { Heading, Text } from "@react-email/components";
import React from "react";
+import { Section } from "./section";
import { colors } from "./tokens";
void React;
diff --git a/packages/email/src/components/email-shell.tsx b/packages/email/src/components/email-shell.tsx
index 9316f3ac6..6ca3a54d3 100644
--- a/packages/email/src/components/email-shell.tsx
+++ b/packages/email/src/components/email-shell.tsx
@@ -5,9 +5,9 @@ import {
Html,
Img,
Preview,
- Row,
} from "@react-email/components";
import React from "react";
+import { Row } from "./row";
import { emailAsset } from "./assets";
import { themeCss } from "./theme";
import { colors, fontFamily } from "./tokens";
@@ -31,12 +31,17 @@ export function EmailShell({
<Html lang={lang} dir="ltr">
<Head>
<title>{title}</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="color-scheme" content="light dark" />
<meta name="supported-color-schemes" content="light dark" />
+ <meta
+ name="format-detection"
+ content="telephone=no, date=no, address=no, email=no, url=no"
+ />
<style>{themeCss}</style>
</Head>
<Preview>{preview}</Preview>
- <body className="k-bg" style={body}>
+ <body id="body" className="k-bg" style={body}>
<div
role="article"
aria-roledescription="email"
diff --git a/packages/email/src/components/format-date.ts b/packages/email/src/components/format-date.ts
index 1caea5308..15d241722 100644
--- a/packages/email/src/components/format-date.ts
+++ b/packages/email/src/components/format-date.ts
@@ -22,7 +22,7 @@ export function formatDateTime(value: DateInput, lang: string) {
year: "numeric",
month: "short",
day: "numeric",
- hour: "2-digit",
+ hour: "numeric",
minute: "2-digit",
timeZoneName: "short",
});
diff --git a/packages/email/src/components/frame.tsx b/packages/email/src/components/frame.tsx
index 2618f3b76..ce64642fe 100644
--- a/packages/email/src/components/frame.tsx
+++ b/packages/email/src/components/frame.tsx
@@ -1,5 +1,6 @@
-import { Heading, Section, Text } from "@react-email/components";
+import { Heading, Text } from "@react-email/components";
import React from "react";
+import { Section } from "./section";
import { colors, shadow } from "./tokens";
void React;
diff --git a/packages/email/src/components/invitation-card.tsx b/packages/email/src/components/invitation-card.tsx
index 0ce15b2f1..4f40bd41c 100644
--- a/packages/email/src/components/invitation-card.tsx
+++ b/packages/email/src/components/invitation-card.tsx
@@ -1,5 +1,6 @@
-import { Heading, Section, Text } from "@react-email/components";
+import { Heading, Text } from "@react-email/components";
import React from "react";
+import { Section } from "./section";
import { EmailButton } from "./email-button";
import { ThemedImg } from "./themed-img";
import { colors, shadow } from "./tokens";
@@ -21,8 +22,8 @@ export function InvitationCard({
}: InvitationCardProps) {
return (
<Section className="k-card" style={card}>
- <div className="k-icon-circle" style={iconCircle}>
- <ThemedImg name="users-dark" width={24} height={24} style={icon} />
+ <div style={iconWrap}>
+ <ThemedImg name="users-circle" width={48} height={48} />
</div>
<Heading as="h2" className="k-text" style={name}>
{workspaceName}
@@ -48,15 +49,9 @@ const card = {
textAlign: "center" as const,
};
-const iconCircle = {
- width: "48px",
- margin: "0 auto 16px",
- borderRadius: "50%",
- backgroundColor: colors.primarySubtle,
-};
-
-const icon = {
- padding: "12px",
+const iconWrap = {
+ margin: "0 0 16px",
+ lineHeight: "0",
};
const name = {
diff --git a/packages/email/src/components/otp-code.tsx b/packages/email/src/components/otp-code.tsx
index 7ab8db0c6..a89449b26 100644
--- a/packages/email/src/components/otp-code.tsx
+++ b/packages/email/src/components/otp-code.tsx
@@ -1,5 +1,7 @@
-import { Column, Row, Section, Text } from "@react-email/components";
+import { Column, Text } from "@react-email/components";
import React from "react";
+import { Row } from "./row";
+import { Section } from "./section";
import { colors, shadow } from "./tokens";
void React;
@@ -22,15 +24,12 @@ export function OtpCode({ code, label, hint }: OtpCodeProps) {
<Text className="k-text" style={labelStyle}>
{label}
</Text>
- <Row
- align={undefined}
- width={String(slots.length * (SLOT_WIDTH + SLOT_GAP))}
- >
+ <Row style={{ maxWidth: `${slots.length * (SLOT_WIDTH + SLOT_GAP)}px` }}>
{slots.map(({ digit, slot }) => (
<Column
key={slot}
style={{
- width: `${SLOT_WIDTH}px`,
+ width: `${100 / slots.length}%`,
paddingRight: slot < last ? `${SLOT_GAP}px` : 0,
}}
>
diff --git a/packages/email/src/components/progress.tsx b/packages/email/src/components/progress.tsx
index 10ee09c5d..4139b2f6e 100644
--- a/packages/email/src/components/progress.tsx
+++ b/packages/email/src/components/progress.tsx
@@ -1,5 +1,6 @@
-import { Column, Row } from "@react-email/components";
+import { Column } from "@react-email/components";
import React from "react";
+import { Row } from "./row";
import { colors } from "./tokens";
void React;
diff --git a/packages/email/src/components/row.tsx b/packages/email/src/components/row.tsx
new file mode 100644
index 000000000..e07dff977
--- /dev/null
+++ b/packages/email/src/components/row.tsx
@@ -0,0 +1,12 @@
+import { Row as EmailRow } from "@react-email/components";
+import React from "react";
+
+void React;
+
+type RowProps = React.ComponentProps<typeof EmailRow>;
+
+export function Row({ align, style, ...props }: RowProps) {
+ return (
+ <EmailRow {...props} align={align} style={{ width: "100%", ...style }} />
+ );
+}
diff --git a/packages/email/src/components/section.tsx b/packages/email/src/components/section.tsx
new file mode 100644
index 000000000..0977de5d8
--- /dev/null
+++ b/packages/email/src/components/section.tsx
@@ -0,0 +1,16 @@
+import { Section as EmailSection } from "@react-email/components";
+import React from "react";
+
+void React;
+
+type SectionProps = React.ComponentProps<typeof EmailSection>;
+
+export function Section({ align, style, ...props }: SectionProps) {
+ return (
+ <EmailSection
+ {...props}
+ align={align}
+ style={{ width: "100%", ...style }}
+ />
+ );
+}
diff --git a/packages/email/src/components/task-card.tsx b/packages/email/src/components/task-card.tsx
index a5de632b4..9535575b6 100644
--- a/packages/email/src/components/task-card.tsx
+++ b/packages/email/src/components/task-card.tsx
@@ -1,5 +1,7 @@
-import { Column, Row, Section, Text } from "@react-email/components";
+import { Column, Text } from "@react-email/components";
import React from "react";
+import { Row } from "./row";
+import { Section } from "./section";
import { ThemedImg } from "./themed-img";
import { colors, shadow } from "./tokens";
@@ -63,7 +65,7 @@ export function TaskCard({
</Column>
<Column align="right" style={avatarCell}>
{assigneeInitials ? (
- <div className="k-chip k-text" style={avatar}>
+ <div className="k-chip k-text k-divider" style={avatar}>
{assigneeInitials}
</div>
) : null}
@@ -137,26 +139,31 @@ const card = {
};
const ticketCell = {
- paddingBottom: "8px",
- verticalAlign: "top" as const,
+ width: "100%",
+ paddingBottom: "4px",
+ verticalAlign: "middle" as const,
color: colors.mutedForeground,
fontSize: "11px",
- lineHeight: "16px",
+ lineHeight: "20px",
fontWeight: "500",
};
const avatarCell = {
width: "20px",
- verticalAlign: "top" as const,
+ paddingBottom: "4px",
+ verticalAlign: "middle" as const,
};
const avatar = {
- width: "20px",
+ width: "18px",
+ borderWidth: "1px",
+ borderStyle: "solid",
+ borderColor: colors.input,
borderRadius: "50%",
backgroundColor: colors.muted,
color: colors.foreground,
- fontSize: "12px",
- lineHeight: "20px",
+ fontSize: "10px",
+ lineHeight: "18px",
fontWeight: "500",
textAlign: "center" as const,
};
diff --git a/packages/email/src/components/theme.ts b/packages/email/src/components/theme.ts
index b2e400bd8..34ace03f6 100644
--- a/packages/email/src/components/theme.ts
+++ b/packages/email/src/components/theme.ts
@@ -13,7 +13,6 @@ export const darkColors = {
input: "#272727",
control: "#1A1A1A",
muted: "#1E1E1E",
- primarySubtle: "#2E2E2E",
warningForeground: "#FFB900",
destructiveForeground: "#FF6467",
} as const;
@@ -57,7 +56,6 @@ const rules: Array<[string, string]> = [
],
[".k-track", `background-color:${darkColors.input}`],
[".k-bar", `background-color:${darkColors.foreground}`],
- [".k-icon-circle", `background-color:${darkColors.primarySubtle}`],
[".k-link", `color:${darkColors.foreground}`],
];
@@ -79,8 +77,13 @@ const outlookRules = rules
)
.join("");
+const autolinkReset =
+ "color:inherit!important;text-decoration:none!important;font-size:inherit!important;font-family:inherit!important;font-weight:inherit!important;line-height:inherit!important";
+
export const themeCss = [
":root{color-scheme:light dark;supported-color-schemes:light dark}",
+ `a[x-apple-data-detectors]{${autolinkReset}}`,
+ "u + #body a{color:inherit;text-decoration:none;font-size:inherit;font-family:inherit;font-weight:inherit;line-height:inherit}",
".k-dark-img{display:none;max-height:0;overflow:hidden}",
"@media (prefers-color-scheme: dark){",
darkRules,
diff --git a/packages/email/src/components/tokens.ts b/packages/email/src/components/tokens.ts
index 11ea5747b..d457d9e07 100644
--- a/packages/email/src/components/tokens.ts
+++ b/packages/email/src/components/tokens.ts
@@ -13,7 +13,6 @@ export const colors = {
column: "#FCFCFC",
columnBorder: "#EFEFEF",
columnHeaderBorder: "#F2F2F2",
- primarySubtle: "#E9E9E9",
warningForeground: "#BB4D00",
destructiveForeground: "#C10007",
} as const;