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

💄 update style and layout #118

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/app/[lang]/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Container from '@/components/Container';
import Link from '@/components/Link';

type FooterProps = {
copyright: string;
Expand All @@ -7,12 +8,12 @@ type FooterProps = {
function Footer({ copyright }: FooterProps) {
return (
<Container as="footer" className="flex justify-center gap-3 ">
<a
<Link
rel="license"
href="https://creativecommons.org/licenses/by-nc-sa/4.0/"
>
CC BY-NC-SA 4.0
</a>
</Link>
<span>{copyright}</span>
</Container>
);
Expand Down
4 changes: 2 additions & 2 deletions src/app/[lang]/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ function Menu({ menu }: MenuProps) {
href={href}
className={cn(
'block p-3 text-xl leading-none no-underline',
'text-zinc-700 dark:text-zinc-300',
'text-zinc-800 dark:text-zinc-200',
activeLinkIndex === index
? 'neon-text text-primary-600 dark:text-primary-400'
: 'hover:text-primary-700 dark:hover:text-primary-300'
: 'hover:text-primary-800 dark:hover:text-primary-200'
)}
>
{text}
Expand Down
2 changes: 1 addition & 1 deletion src/app/[lang]/posts/[postId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async function PostPage({ params: { postId } }: PostParams) {
</H1>
<time>{formattedDate}</time>
</Container>
<Container as="main" className="mx-2 block py-8 lg:flex lg:px-2">
<Container as="main" className="block py-8 lg:flex lg:px-2">
<aside className="hidden w-40 shrink-0 lg:block xl:w-60">
<nav className="sticky top-[var(--header-height)] px-4">
<h4 className="my-3 text-lg font-semibold text-gray-900 dark:text-gray-100">
Expand Down
24 changes: 8 additions & 16 deletions src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { MdOutlineWidgets } from 'react-icons/md';
import { AiOutlineTags } from 'react-icons/ai';

import { formatDate } from '@/utils/date';
import { H2 } from '../Heading';
import Link from '../Link';
import Image from '../Image';

Expand Down Expand Up @@ -31,16 +32,11 @@ function Card({
/>
)}
</div>
<div>
<h2 className="text-2xl font-bold dark:text-white/90">
<Link
className="hover:text-black/70 dark:hover:text-white/70"
href={`/posts/${id}`}
>
{title}
</Link>
</h2>
<p className="my-3 text-base">{description}</p>
<div className="prose prose-slate dark:prose-invert">
<H2>
<Link href={`/posts/${id}`}>{title}</Link>
</H2>
<p>{description}</p>
<div className="flex flex-wrap gap-x-4 gap-y-1 text-sm">
<div className="flex items-center gap-1">
<BsCalendar4Week />
Expand All @@ -52,7 +48,7 @@ function Card({
category.map((tag) => (
<Link
key={category + tag}
className="whitespace-nowrap hover:text-black/70 dark:hover:text-white/70"
className="whitespace-nowrap"
href="/"
>
{tag}
Expand All @@ -63,11 +59,7 @@ function Card({
<div className="flex flex-wrap items-center gap-1">
<AiOutlineTags />
{tags.map((tag) => (
<Link
key={tag}
className="whitespace-nowrap hover:text-black/70 dark:hover:text-white/70"
href="/"
>
<Link key={tag} className="whitespace-nowrap" href="/">
{tag}
</Link>
))}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Container/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function Container({ as = 'div', className, ...props }: ContainerProps) {
return (
<Component
className={cn(
'px-7 mx-2 md:mx-8 lg:mx-16 lg:px-14',
'px-7 mx-4 max-w-6xl lg:px-14 sm:mx-8 md:mx-12 lg:mx-14 xl:mx-auto',
className
)}
{...props}
Expand Down
10 changes: 8 additions & 2 deletions src/components/Link/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ function Link<T extends string = string>({
return (
<NextLink
href={adjustedHref as Route}
className={className}
className={cn(
'hover:text-primary-700 dark:hover:text-primary-300',
className
)}
{...otherProps}
>
{children}
Expand All @@ -58,7 +61,10 @@ function Link<T extends string = string>({
href={href}
target="_blank"
rel="noopener noreferrer"
className={cn('inline-flex', className)}
className={cn(
'inline-flex hover:text-primary-700 dark:hover:text-primary-300',
className
)}
{...otherProps}
>
{children}
Expand Down
Loading