Skip to content

Commit

Permalink
✨ Update header and writings style (#1600)
Browse files Browse the repository at this point in the history
* ✨ Update Biography
* 🏷️ Update next types
* πŸ’„ Adjust Writings `Post` font-size
  • Loading branch information
carloscuesta authored Jan 15, 2025
1 parent 276b8c7 commit 30130f6
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 26 deletions.
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,17 @@ exports[`Biography should match Biography component 1`] = `
>
write
</a>
and build stuff on internet.
and run
<a
class="underline-offset-2 underline"
href="https://bueno.studio"
rel="noopener noreferrer"
target="_blank"
>
bueno.studio
</a>
.
</p>
<p
class="sm:max-w-md"
Expand Down
3 changes: 2 additions & 1 deletion src/app/home/components/Biography/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ const Biography = () => (
<p className="sm:max-w-md">
I'm a Front End Engineer based in Barcelona. I{' '}
<Link href="https://github.com/carloscuesta" label="code" />,{' '}
<Link href="/blog" label="write" /> and build stuff on internet.
<Link href="/blog" label="write" /> and run{' '}
<Link href="https://bueno.studio" label="bueno.studio" />.
</p>

<p className="sm:max-w-md">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`BlogPost should match BlogPost component 1`] = `
class="-mx-1.5"
>
<a
class="block p-1.5 h-full w-full rounded-md transition-all focus-within:bg-neutral-100 hover:bg-neutral-100 dark:focus-within:bg-neutral-900 dark:hover:bg-neutral-900 outline-none focus:ring-1 focus:ring-neutral-300 dark:focus:ring-neutral-500 text-sm"
class="block p-1.5 h-full w-full rounded-md transition-all focus-within:bg-neutral-100 hover:bg-neutral-100 dark:focus-within:bg-neutral-900 dark:hover:bg-neutral-900 outline-none focus:ring-1 focus:ring-neutral-300 dark:focus:ring-neutral-500 text-[15px]"
href="/blog/post-slug"
tabindex="0"
title="Post Title"
Expand All @@ -16,7 +16,7 @@ exports[`BlogPost should match BlogPost component 1`] = `
>
<time
aria-label="Written 15/12/2019 10:00"
class="opacity-60 sm:w-24"
class="opacity-60 sm:w-[6.25rem]"
datetime="2019-12-15 10:00"
>
15 Dec, 2019
Expand All @@ -25,12 +25,12 @@ exports[`BlogPost should match BlogPost component 1`] = `
class="grid flex-1 grid-flow-col items-baseline justify-between gap-10 md:items-center"
>
<header
class="font-medium text-sm"
class="font-medium"
>
Post Title
</header>
<p
class="font-mono opacity-60"
class="font-mono opacity-60 text-sm"
>
1,000 views
</p>
Expand Down
9 changes: 4 additions & 5 deletions src/app/home/components/Writings/BlogPost/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,28 @@ import { type PostPreview } from 'src/utils/api/blog/mutators'

type Props = {
post: PostPreview
isImageLoadedWithPriority: boolean
}

const BlogPost = (props: Props) => (
<li className="-mx-1.5">
<Link
href={`/blog/${props.post.slug}`}
title={props.post.title}
className="block p-1.5 h-full w-full rounded-md transition-all focus-within:bg-neutral-100 hover:bg-neutral-100 dark:focus-within:bg-neutral-900 dark:hover:bg-neutral-900 outline-none focus:ring-1 focus:ring-neutral-300 dark:focus:ring-neutral-500 text-sm"
className="block p-1.5 h-full w-full rounded-md transition-all focus-within:bg-neutral-100 hover:bg-neutral-100 dark:focus-within:bg-neutral-900 dark:hover:bg-neutral-900 outline-none focus:ring-1 focus:ring-neutral-300 dark:focus:ring-neutral-500 text-[15px]"
tabIndex={0}
>
<article className="flex flex-col-reverse sm:flex-row sm:items-baseline sm:gap-3">
<time
className="opacity-60 sm:w-24"
className="opacity-60 sm:w-[6.25rem]"
dateTime={props.post.datePublished.value}
aria-label={`Written ${props.post.datePublished.formatDate}`}
>
{`${props.post.datePublished.formatMonthDay}, ${new Date(props.post.datePublished.value).getFullYear()}`}
</time>

<div className="grid flex-1 grid-flow-col items-baseline justify-between gap-10 md:items-center">
<header className="font-medium text-sm">{props.post.title}</header>
<p className="font-mono opacity-60">
<header className="font-medium">{props.post.title}</header>
<p className="font-mono opacity-60 text-sm">
<Suspense>
<ViewsCount slug={props.post.slug} views={props.post.views} />
</Suspense>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exports[`Writings should match Writings component 1`] = `
class="-mx-1.5"
>
<a
class="block p-1.5 h-full w-full rounded-md transition-all focus-within:bg-neutral-100 hover:bg-neutral-100 dark:focus-within:bg-neutral-900 dark:hover:bg-neutral-900 outline-none focus:ring-1 focus:ring-neutral-300 dark:focus:ring-neutral-500 text-sm"
class="block p-1.5 h-full w-full rounded-md transition-all focus-within:bg-neutral-100 hover:bg-neutral-100 dark:focus-within:bg-neutral-900 dark:hover:bg-neutral-900 outline-none focus:ring-1 focus:ring-neutral-300 dark:focus:ring-neutral-500 text-[15px]"
href="/blog/post-slug"
tabindex="0"
title="Post Title"
Expand All @@ -38,7 +38,7 @@ exports[`Writings should match Writings component 1`] = `
>
<time
aria-label="Written 15/12/2019 10:00"
class="opacity-60 sm:w-24"
class="opacity-60 sm:w-[6.25rem]"
datetime="2019-12-15 10:00"
>
15 Dec, 2019
Expand All @@ -47,12 +47,12 @@ exports[`Writings should match Writings component 1`] = `
class="grid flex-1 grid-flow-col items-baseline justify-between gap-10 md:items-center"
>
<header
class="font-medium text-sm"
class="font-medium"
>
Post Title
</header>
<p
class="font-mono opacity-60"
class="font-mono opacity-60 text-sm"
>
1,000 views
</p>
Expand All @@ -64,7 +64,7 @@ exports[`Writings should match Writings component 1`] = `
class="-mx-1.5"
>
<a
class="block p-1.5 h-full w-full rounded-md transition-all focus-within:bg-neutral-100 hover:bg-neutral-100 dark:focus-within:bg-neutral-900 dark:hover:bg-neutral-900 outline-none focus:ring-1 focus:ring-neutral-300 dark:focus:ring-neutral-500 text-sm"
class="block p-1.5 h-full w-full rounded-md transition-all focus-within:bg-neutral-100 hover:bg-neutral-100 dark:focus-within:bg-neutral-900 dark:hover:bg-neutral-900 outline-none focus:ring-1 focus:ring-neutral-300 dark:focus:ring-neutral-500 text-[15px]"
href="/blog/post-blog-slug"
tabindex="0"
title="A post"
Expand All @@ -74,7 +74,7 @@ exports[`Writings should match Writings component 1`] = `
>
<time
aria-label="Written 17/12/2019 10:00"
class="opacity-60 sm:w-24"
class="opacity-60 sm:w-[6.25rem]"
datetime="2019-12-17 10:00"
>
17 Dec, 2019
Expand All @@ -83,12 +83,12 @@ exports[`Writings should match Writings component 1`] = `
class="grid flex-1 grid-flow-col items-baseline justify-between gap-10 md:items-center"
>
<header
class="font-medium text-sm"
class="font-medium"
>
A post
</header>
<p
class="font-mono opacity-60"
class="font-mono opacity-60 text-sm"
>
1,000 views
</p>
Expand Down
8 changes: 2 additions & 6 deletions src/app/home/components/Writings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ const Writings = (props: Props) => {
<SectionTitle title="Writings" href="/blog" viewAll />

<ul className="grid gap-3 sm:gap-1">
{props.posts.map((post, index) => (
<BlogPost
isImageLoadedWithPriority={[0, 1, 2].includes(index)}
key={post.slug}
post={post}
/>
{props.posts.map((post) => (
<BlogPost key={post.slug} post={post} />
))}
</ul>
</Wrapper>
Expand Down

0 comments on commit 30130f6

Please sign in to comment.