-
Notifications
You must be signed in to change notification settings - Fork 824
feat(demo): use Tailwind v4 in notion-magic-link.tsx #2488
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
Open
bukinoshita
wants to merge
18
commits into
chore/basic-setup
Choose a base branch
from
refactor/notion-magic-link-with-tailwind
base: chore/basic-setup
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
8badcdf
chore(demo): tailwind basic setup
bukinoshita 25a005f
fix: minor tweak
bukinoshita e37376d
fix: minor tweak
bukinoshita f8ae674
fix errors
gabrielmfern d0a3ff6
add tailwind config
gabrielmfern 15ce1ca
use the new testing version
gabrielmfern ea728cc
update lock
gabrielmfern 8f05ec9
use pixelBasedPreset on tailwind config
gabrielmfern 47a3cd9
update components
gabrielmfern 4a43831
sort
gabrielmfern 147568d
sort
gabrielmfern 453da8d
fix: minor tweak
bukinoshita f475d61
refactor(demo): use tailwind
bukinoshita 34510c7
move Tailwind component to the right place
gabrielmfern 6d7ab82
use config
gabrielmfern a8f6376
change some things
gabrielmfern c7620ec
add font-notion
gabrielmfern af781e0
remove index.css file
gabrielmfern File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -7,8 +7,10 @@ import { | |||||
Img, | ||||||
Link, | ||||||
Preview, | ||||||
Tailwind, | ||||||
Text, | ||||||
} from '@react-email/components'; | ||||||
import tailwindConfig from '../tailwind.config'; | ||||||
|
||||||
interface NotionMagicLinkEmailProps { | ||||||
loginCode?: string; | ||||||
|
@@ -23,66 +25,54 @@ export const NotionMagicLinkEmail = ({ | |||||
}: NotionMagicLinkEmailProps) => ( | ||||||
<Html> | ||||||
<Head /> | ||||||
<Body style={main}> | ||||||
<Preview>Log in with this magic link</Preview> | ||||||
<Container style={container}> | ||||||
<Heading style={h1}>Login</Heading> | ||||||
<Link | ||||||
href="https://notion.so" | ||||||
target="_blank" | ||||||
style={{ | ||||||
...link, | ||||||
display: 'block', | ||||||
marginBottom: '16px', | ||||||
}} | ||||||
> | ||||||
Click here to log in with this magic link | ||||||
</Link> | ||||||
<Text style={{ ...text, marginBottom: '14px' }}> | ||||||
Or, copy and paste this temporary login code: | ||||||
</Text> | ||||||
<code style={code}>{loginCode}</code> | ||||||
<Text | ||||||
style={{ | ||||||
...text, | ||||||
color: '#ababab', | ||||||
marginTop: '14px', | ||||||
marginBottom: '16px', | ||||||
}} | ||||||
> | ||||||
If you didn't try to login, you can safely ignore this email. | ||||||
</Text> | ||||||
<Text | ||||||
style={{ | ||||||
...text, | ||||||
color: '#ababab', | ||||||
marginTop: '12px', | ||||||
marginBottom: '38px', | ||||||
}} | ||||||
> | ||||||
Hint: You can set a permanent password in Settings & members → My | ||||||
account. | ||||||
</Text> | ||||||
<Img | ||||||
src={`${baseUrl}/static/notion-logo.png`} | ||||||
width="32" | ||||||
height="32" | ||||||
alt="Notion's Logo" | ||||||
/> | ||||||
<Text style={footer}> | ||||||
<Tailwind config={tailwindConfig}> | ||||||
<Body className="bg-white font-notion"> | ||||||
<Preview>Log in with this magic link</Preview> | ||||||
<Container className="px-3 mx-auto"> | ||||||
<Heading className="text-[#333] text-2xl my-10 mx-0 p-0"> | ||||||
Login | ||||||
</Heading> | ||||||
<Link | ||||||
href="https://notion.so" | ||||||
target="_blank" | ||||||
style={{ ...link, color: '#898989' }} | ||||||
className="text-[#2754C5] text-sm underline mb-4 block" | ||||||
> | ||||||
Notion.so | ||||||
Click here to log in with this magic link | ||||||
</Link> | ||||||
, the all-in-one-workspace | ||||||
<br /> | ||||||
for your notes, tasks, wikis, and databases. | ||||||
</Text> | ||||||
</Container> | ||||||
</Body> | ||||||
<Text className="text-[#333] text-sm my-6 mb-3.5"> | ||||||
Or, copy and paste this temporary login code: | ||||||
</Text> | ||||||
<code className="inline-block py-4 px-[4.5%] w-9/10 bg-[#f4f4f4] rounded-md border border-solid border-[#eee] text-[#333]"> | ||||||
{loginCode} | ||||||
</code> | ||||||
<Text className="text-[#ababab] text-sm mt-3.5 mb-4"> | ||||||
If you didn't try to login, you can safely ignore this email. | ||||||
</Text> | ||||||
<Text className="text-[#ababab] text-sm mt-3.5 mb-9.5"> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Prompt for AI agents
Suggested change
|
||||||
Hint: You can set a permanent password in Settings & members → My | ||||||
account. | ||||||
</Text> | ||||||
<Img | ||||||
src={`${baseUrl}/static/notion-logo.png`} | ||||||
width="32" | ||||||
height="32" | ||||||
alt="Notion's Logo" | ||||||
/> | ||||||
<Text className="text-[#898989] text-xs mt-3 mb-6"> | ||||||
<Link | ||||||
href="https://notion.so" | ||||||
target="_blank" | ||||||
className="text-[#898989] text-sm underline" | ||||||
> | ||||||
Notion.so | ||||||
</Link> | ||||||
, the all-in-one-workspace | ||||||
<br /> | ||||||
for your notes, tasks, wikis, and databases. | ||||||
</Text> | ||||||
</Container> | ||||||
</Body> | ||||||
</Tailwind> | ||||||
</Html> | ||||||
); | ||||||
|
||||||
|
@@ -91,59 +81,3 @@ NotionMagicLinkEmail.PreviewProps = { | |||||
} as NotionMagicLinkEmailProps; | ||||||
|
||||||
export default NotionMagicLinkEmail; | ||||||
|
||||||
const main = { | ||||||
backgroundColor: '#ffffff', | ||||||
}; | ||||||
|
||||||
const container = { | ||||||
paddingLeft: '12px', | ||||||
paddingRight: '12px', | ||||||
margin: '0 auto', | ||||||
}; | ||||||
|
||||||
const h1 = { | ||||||
color: '#333', | ||||||
fontFamily: | ||||||
"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif", | ||||||
fontSize: '24px', | ||||||
fontWeight: 'bold', | ||||||
margin: '40px 0', | ||||||
padding: '0', | ||||||
}; | ||||||
|
||||||
const link = { | ||||||
color: '#2754C5', | ||||||
fontFamily: | ||||||
"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif", | ||||||
fontSize: '14px', | ||||||
textDecoration: 'underline', | ||||||
}; | ||||||
|
||||||
const text = { | ||||||
color: '#333', | ||||||
fontFamily: | ||||||
"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif", | ||||||
fontSize: '14px', | ||||||
margin: '24px 0', | ||||||
}; | ||||||
|
||||||
const footer = { | ||||||
color: '#898989', | ||||||
fontFamily: | ||||||
"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif", | ||||||
fontSize: '12px', | ||||||
lineHeight: '22px', | ||||||
marginTop: '12px', | ||||||
marginBottom: '24px', | ||||||
}; | ||||||
|
||||||
const code = { | ||||||
display: 'inline-block', | ||||||
padding: '16px 4.5%', | ||||||
width: '90.5%', | ||||||
backgroundColor: '#f4f4f4', | ||||||
borderRadius: '5px', | ||||||
border: '1px solid #eee', | ||||||
color: '#333', | ||||||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { pixelBasedPreset, type TailwindConfig } from '@react-email/components'; | ||
|
||
export default { | ||
presets: [pixelBasedPreset], | ||
theme: { | ||
fontFamily: { | ||
notion: | ||
"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif", | ||
}, | ||
}, | ||
} satisfies TailwindConfig; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,15 +9,15 @@ | |
"export": "email-dev export" | ||
}, | ||
"dependencies": { | ||
"@react-email/components": "workspace:*", | ||
"@react-email/components": "npm:@react-email/[email protected]", | ||
"email-dev": "workspace:*", | ||
"react": "^19", | ||
"react-dom": "^19", | ||
"email-dev": "workspace:*" | ||
"react-dom": "^19" | ||
}, | ||
"devDependencies": { | ||
"@react-email/preview-server": "workspace:*", | ||
"next": "^15.3.2", | ||
"@types/react": "^19", | ||
"@types/react-dom": "^19" | ||
"@types/react-dom": "^19", | ||
"next": "^15.3.2" | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
w-9/10
isn’t generated by the email Tailwind config, so the login code block loses its intended 90% width. Please switch to an arbitrary value utility.Prompt for AI agents