Skip to content

Commit e82a8d9

Browse files
committed
Failed attempt to use react icons in emails
1 parent 4527a0d commit e82a8d9

File tree

9 files changed

+2542
-13760
lines changed

9 files changed

+2542
-13760
lines changed

backend/api/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,8 @@
6666
"devDependencies": {
6767
"@types/cors": "2.8.17",
6868
"@types/ws": "8.5.10"
69+
},
70+
"resolutions": {
71+
"glob": "10.4.5"
6972
}
7073
}

backend/api/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"esModuleInterop": true,
1212
"target": "esnext",
1313
"skipLibCheck": true,
14+
"forceConsistentCasingInFileNames": true,
1415
"jsx": "react-jsx",
1516
"paths": {
1617
"common/*": ["../../common/src/*", "../../../common/lib/*"],
@@ -28,5 +29,6 @@
2829
{ "path": "../email" }
2930
],
3031
"compileOnSave": true,
31-
"include": ["src/**/*.ts"]
32+
"include": ["src/**/*.ts"],
33+
"exclude": ["../../node_modules/@types/glob"]
3234
}

backend/email/emails/utils.tsx

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
import {Link, Row, Section, Text} from "@react-email/components";
2-
import {SocialIcon} from "web/components/user/social";
2+
import {
3+
TbBrandBluesky,
4+
TbBrandDiscord,
5+
TbBrandFacebook,
6+
TbBrandGithub,
7+
TbBrandInstagram,
8+
TbBrandLinkedin,
9+
TbBrandMastodon,
10+
TbBrandPatreon,
11+
TbBrandPaypal,
12+
TbBrandSpotify,
13+
TbBrandX
14+
} from "react-icons/tb";
15+
16+
import {LinkIcon} from '@heroicons/react/solid'
17+
import {Site} from 'common/src/socials'
18+
import {LuBookmark} from 'react-icons/lu'
319

420
interface Props {
521
email?: string
@@ -19,7 +35,7 @@ export const Footer = ({
1935
<Row>
2036
<div></div>
2137
<Link href="https://github.com/CompassMeet/Compass">
22-
<SocialIcon site={'github'} size={36} color={'black'} />
38+
<SocialIcon site={'github'} size={36} color={'black'}/>
2339
</Link>
2440
<Link href="https://discord.gg/8Vd7jzqjun">
2541
<SocialIcon site={'discord'} size={36} color={'black'}/>
@@ -42,6 +58,37 @@ export const Footer = ({
4258
</Section>
4359
}
4460

61+
62+
export const PLATFORM_ICONS: {
63+
[key in Site]: (props: { className?: string }) => any
64+
} = {
65+
site: LinkIcon,
66+
x: TbBrandX,
67+
discord: TbBrandDiscord,
68+
bluesky: TbBrandBluesky,
69+
mastodon: TbBrandMastodon,
70+
substack: LuBookmark,
71+
instagram: TbBrandInstagram,
72+
github: TbBrandGithub,
73+
linkedin: TbBrandLinkedin,
74+
facebook: TbBrandFacebook,
75+
spotify: TbBrandSpotify,
76+
patreon: TbBrandPatreon,
77+
paypal: TbBrandPaypal,
78+
}
79+
80+
export const SocialIcon = (props: {
81+
site: string;
82+
className?: string;
83+
size?: number;
84+
color?: string;
85+
}): React.ReactElement | null => {
86+
const {site, ...rest} = props
87+
const Icon = PLATFORM_ICONS[site as Site] || PLATFORM_ICONS.site
88+
89+
return <Icon {...rest} />
90+
}
91+
4592
export const footer = {
4693
margin: '20px 0',
4794
textAlign: 'center' as const,

backend/email/yarn.lock

Lines changed: 0 additions & 1633 deletions
This file was deleted.

common/yarn.lock

Lines changed: 0 additions & 2704 deletions
This file was deleted.

package.json

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
},
2323
"dependencies": {
2424
"@playwright/test": "^1.54.2",
25+
"@react-email/components": "^0.5.3",
26+
"@react-email/render": "^1.2.3",
2527
"@tiptap/core": "2.3.2",
2628
"@tiptap/extension-blockquote": "2.3.2",
2729
"@tiptap/extension-bold": "2.3.2",
@@ -31,14 +33,18 @@
3133
"@tiptap/extension-link": "2.3.2",
3234
"@tiptap/extension-mention": "2.3.2",
3335
"@tiptap/html": "2.3.2",
36+
"@tiptap/pm": "2.3.2",
3437
"@tiptap/starter-kit": "2.3.2",
3538
"@tiptap/suggestion": "2.3.2",
39+
"@types/react": "18.2.0",
40+
"@types/react-dom": "18.2.0",
3641
"colorette": "^2.0.20",
3742
"prismjs": "^1.30.0",
38-
"react-markdown": "*",
43+
"react": "18.2.0",
44+
"react-dom": "18.2.0",
3945
"react-email": "3.0.7",
40-
"@react-email/components": "^0.5.3",
41-
"@react-email/render": "^1.2.3"
46+
"react-icons": "5.5.0",
47+
"react-markdown": "*"
4248
},
4349
"devDependencies": {
4450
"@testing-library/jest-dom": "^6.6.4",
@@ -71,5 +77,40 @@
7177
"@tiptap/html": "2.3.2",
7278
"@tiptap/starter-kit": "2.3.2",
7379
"@tiptap/suggestion": "2.3.2"
80+
},
81+
"resolutions": {
82+
"@tiptap/core": "2.3.2",
83+
"@tiptap/extension-blockquote": "2.3.2",
84+
"@tiptap/extension-bold": "2.3.2",
85+
"@tiptap/extension-bubble-menu": "2.3.2",
86+
"@tiptap/extension-floating-menu": "2.3.2",
87+
"@tiptap/extension-image": "2.3.2",
88+
"@tiptap/extension-link": "2.3.2",
89+
"@tiptap/extension-mention": "2.3.2",
90+
"@tiptap/html": "2.3.2",
91+
"@tiptap/starter-kit": "2.3.2",
92+
"@tiptap/suggestion": "2.3.2",
93+
"@tiptap/extension-bullet-list": "2.3.2",
94+
"@tiptap/extension-character-count": "2.3.2",
95+
"@tiptap/extension-code": "2.3.2",
96+
"@tiptap/extension-code-block": "2.3.2",
97+
"@tiptap/extension-document": "2.3.2",
98+
"@tiptap/extension-dropcursor": "2.3.2",
99+
"@tiptap/extension-gapcursor": "2.3.2",
100+
"@tiptap/extension-hard-break": "2.3.2",
101+
"@tiptap/extension-heading": "2.3.2",
102+
"@tiptap/extension-history": "2.3.2",
103+
"@tiptap/extension-horizontal-rule": "2.3.2",
104+
"@tiptap/extension-italic": "2.3.2",
105+
"@tiptap/extension-list-item": "2.3.2",
106+
"@tiptap/extension-ordered-list": "2.3.2",
107+
"@tiptap/extension-paragraph": "2.3.2",
108+
"@tiptap/extension-placeholder": "2.3.2",
109+
"@tiptap/extension-strike": "2.3.2",
110+
"@tiptap/extension-text": "2.3.2",
111+
"react": "18.2.0",
112+
"react-dom": "18.2.0",
113+
"@types/react": "18.2.0",
114+
"@types/react-dom": "18.2.0"
74115
}
75116
}

web/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
"@tailwindcss/typography": "^0.5.1",
6868
"@types/d3": "7.4.0",
6969
"@types/lodash": "4.14.178",
70-
"@types/react": "18.3.5",
71-
"@types/react-dom": "18.3.0",
70+
"@types/react": "18.2.0",
71+
"@types/react-dom": "18.2.0",
7272
"autoprefixer": "10.2.6",
7373
"concurrently": "8.2.2",
7474
"cross-env": "7.0.3",

0 commit comments

Comments
 (0)