Skip to content
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

feature(website): add books page #583

Closed
wants to merge 6 commits into from
Closed

Conversation

mkue
Copy link
Contributor

@mkue mkue commented Oct 18, 2023

No description provided.

@vercel
Copy link

vercel bot commented Oct 18, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
public ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 20, 2023 3:54pm

@github-actions
Copy link

github-actions bot commented Oct 18, 2023

PR Preview Action v1.4.4
🚀 Deployed preview to https://socialincome-san.github.io/public/functions-playwright-report/pr-583/
on branch gh-pages at 2023-10-20 15:00 UTC

@github-actions
Copy link

github-actions bot commented Oct 18, 2023

Visit the preview URL for this PR (updated for commit ffff677):

https://si-admin-staging--pr583-pranav-migrate-books-kt3kl11t.web.app

(expires Fri, 27 Oct 2023 15:02:06 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: b7b0969384059dce6ea8fad1ee1d1737e54e6676

Copy link
Contributor Author

@mkue mkue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very, very nice work @DarkMenacer 👏🏼👏🏼😊 I like it a lot how you separated the page into separate components.

I made a few comments where you can clean up the code a bit. Please let me know if you have any questions. And ping me, as soon as I should have another look.

<Typography as="div" className="mt-6 text-blue-500 sm:mb-2">
{author}
</Typography>
{currentlyReading ? (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Instead of using ? here, you can do it with a && operator, which is a little cleaner:

{currentlyReading && (
	<Typography
		as="span"
	size="xs"
	weight="bold"
	className="my-1 rounded-md bg-blue-500 px-2 py-0.5 text-white sm:mx-1"
		>
		Currently reading
	</Typography>
)}


return (
<BaseContainer>
<div className={baseClass}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the classNames() function here, e.g.:

className={classNames('flex h-fit flex-col flex-nowrap pb-5 shadow-md sm:flex-row', {
	'my-40': currentlyReading,
		'my-8': !currentlyReading,
})}

{author}
</Typography>
{currentlyReading ? (
<Typography
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using the Typography component here, you could use the Badge component from the ui. See: https://ui.shadcn.com/docs/components/badge

{quote}
</Typography>
<Typography as="div" weight="bold">
<a href={publisherLink} className="hover:text-blue-800">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above: use the Link component and wrap the Typography inside the Link component.

</div>
<div className="mx-8 flex w-fit basis-5/12 flex-col">
<div className="flex flex-col items-baseline sm:flex-row">
<Typography as="div" className="mt-6 text-blue-500 sm:mb-2">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as="div" is not needed. You can generally remove the parameter where you use it in this file.

<div className="w-fit basis-1/3">
<Image src={cover} height={4000} alt="book cover" />
</div>
<div className="mx-8 flex w-fit basis-5/12 flex-col">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use basis-5/12 here and not basis-2/3 when you use basis-1/3 above?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I took that decision looking at how the previous website was made and basis-2/3 might have been a bit too wide.

return (
<BaseContainer className="mt-20 flex flex-col content-center justify-center text-center">
<Typography as="div" size="4xl" weight="bold" lineHeight="loose" className="m-3 w-auto pb-4">
Recommended Reading
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put these translations also into the website-books.json file and use the Translator as in section-2.tsx?

)}
</div>
<Typography as="div" weight="bold" size="xl" lineHeight="relaxed" className="mb-1">
<a href={authorLink}>{title}</a>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the Link component from Next here. Also, wrap the Typography inside the Link component.

@mkue mkue linked an issue Oct 20, 2023 that may be closed by this pull request
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Website Feature]: Migrate book page
3 participants