From c1c7ca70783cbb38cf35fe0c9fb05dd626f46c08 Mon Sep 17 00:00:00 2001 From: Nikhil M Warrier Date: Tue, 3 Mar 2026 09:00:53 +0530 Subject: Rename Author to Member, add Codeberg icons --- src/components/AuthorCard.astro | 62 ------------------------------------ src/components/MemberCard.astro | 63 +++++++++++++++++++++++++++++++++++++ src/components/PostNavigation.astro | 6 ++-- 3 files changed, 67 insertions(+), 64 deletions(-) delete mode 100644 src/components/AuthorCard.astro create mode 100644 src/components/MemberCard.astro (limited to 'src/components') diff --git a/src/components/AuthorCard.astro b/src/components/AuthorCard.astro deleted file mode 100644 index 9f178fa..0000000 --- a/src/components/AuthorCard.astro +++ /dev/null @@ -1,62 +0,0 @@ ---- -import Link from '@/components/Link.astro' -import AvatarComponent from '@/components/ui/avatar' -import { cn } from '@/lib/utils' -import type { SocialLink } from '@/types' -import type { CollectionEntry } from 'astro:content' -import SocialIcons from './SocialIcons.astro' - -interface Props { - author: CollectionEntry<'authors'> -} - -const { author } = Astro.props -const { name, avatar, bio, pronouns } = author.data -const currentPath = Astro.url.pathname -const isAuthorPage = currentPath === `/authors/${author.id}` - -const socialLinks: SocialLink[] = [ - author.data.website && { href: author.data.website, label: 'Website' }, - author.data.github && { href: author.data.github, label: 'GitHub' }, - author.data.twitter && { href: author.data.twitter, label: 'Twitter' }, - author.data.linkedin && { href: author.data.linkedin, label: 'LinkedIn' }, - author.data.mail && { href: `mailto:${author.data.mail}`, label: 'Email' }, -].filter(Boolean) as SocialLink[] ---- - -
-
- - [data-slot="avatar-fallback"]]:rounded-md', - !isAuthorPage && - 'hover:ring-primary transition-shadow duration-300 hover:cursor-pointer hover:ring-2', - )} - /> - -
-
-
-

{name}

- { - pronouns && ( - ({pronouns}) - ) - } -
-

{bio}

-
- -
-
-
diff --git a/src/components/MemberCard.astro b/src/components/MemberCard.astro new file mode 100644 index 0000000..b98e3ee --- /dev/null +++ b/src/components/MemberCard.astro @@ -0,0 +1,63 @@ +--- +import Link from '@/components/Link.astro' +import AvatarComponent from '@/components/ui/avatar' +import { cn } from '@/lib/utils' +import type { SocialLink } from '@/types' +import type { CollectionEntry } from 'astro:content' +import SocialIcons from './SocialIcons.astro' + +interface Props { + member: CollectionEntry<'members'> +} + +const { member } = Astro.props +const { name, avatar, bio, pronouns } = member.data +const currentPath = Astro.url.pathname +const isAuthorPage = currentPath === `/members/${member.id}` + +const socialLinks: SocialLink[] = [ + member.data.website && { href: member.data.website, label: 'Website' }, + member.data.github && { href: member.data.github, label: 'GitHub' }, + member.data.codeberg && { href: member.data.codeberg, label: 'Codeberg' }, + member.data.twitter && { href: member.data.twitter, label: 'Twitter' }, + member.data.linkedin && { href: member.data.linkedin, label: 'LinkedIn' }, + member.data.mail && { href: `mailto:${member.data.mail}`, label: 'Email' }, +].filter(Boolean) as SocialLink[] +--- + +
+
+ + + +
+
+
+

{name}

+ { + pronouns && ( + ({pronouns}) + ) + } +
+

{bio}

+
+ +
+
+
diff --git a/src/components/PostNavigation.astro b/src/components/PostNavigation.astro index bca228a..2e8b93e 100644 --- a/src/components/PostNavigation.astro +++ b/src/components/PostNavigation.astro @@ -19,7 +19,8 @@ const isSubpost = !!parentPost class={cn( buttonVariants({ variant: 'outline' }), 'rounded-lg group flex items-center justify-start size-full', - !olderPost && 'pointer-events-none opacity-0 cursor-not-allowed', + !olderPost && + 'pointer-events-none opacity-0 invisible cursor-not-allowed', )} aria-disabled={!olderPost} > @@ -71,7 +72,8 @@ const isSubpost = !!parentPost class={cn( buttonVariants({ variant: 'outline' }), 'rounded-lg group flex items-center justify-end size-full', - !newerPost && 'pointer-events-none opacity-0 cursor-not-allowed', + !newerPost && + 'pointer-events-none opacity-0 invisible cursor-not-allowed', )} aria-disabled={!newerPost} > -- cgit v1.2.3