diff --git a/docs/member.md b/docs/member.md deleted file mode 100644 index 13100db..0000000 --- a/docs/member.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -sidebar_position: 3 ---- - -# 成员列表 \ No newline at end of file diff --git a/docs/member.mdx b/docs/member.mdx new file mode 100644 index 0000000..51bc703 --- /dev/null +++ b/docs/member.mdx @@ -0,0 +1,8 @@ +--- +sidebar_position: 3 +--- + +# 成员列表 +import Member from '@site/src/components/Member'; + + diff --git a/src/components/Member/index.tsx b/src/components/Member/index.tsx new file mode 100644 index 0000000..48efec8 --- /dev/null +++ b/src/components/Member/index.tsx @@ -0,0 +1,32 @@ +import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar" +import { memberData } from "@/components/Member/memberData"; + +export default function Component() { + const data = memberData + return ( +
+ {Object.keys(data).map((year) => ( +
+

{year}

+
+ {data[year].map((member, index) => ( +
+ + {member.name} + {member.name.split(" ").map((word) => word[0])} + +
+

{member.name}

+

{member.profession}

+
+
+ ))} +
+
+ ))} +
+ ) +} diff --git a/src/components/Member/memberData.ts b/src/components/Member/memberData.ts new file mode 100644 index 0000000..25cbf6a --- /dev/null +++ b/src/components/Member/memberData.ts @@ -0,0 +1,26 @@ +type MemberData = Record + +export const memberData: MemberData = { + "2023": [ + { avatar: "/placeholder-avatar.jpg", name: "John Doe", profession: "Software Engineer" }, + { avatar: "/placeholder-avatar.jpg", name: "Jane Smith", profession: "Product Manager" }, + { avatar: "/placeholder-avatar.jpg", name: "Michael Johnson", profession: "UI/UX Designer" }, + { avatar: "/placeholder-avatar.jpg", name: "Emily Davis", profession: "Data Analyst" }, + ], + "2022": [ + { avatar: "/placeholder-avatar.jpg", name: "David Lee", profession: "Backend Developer" }, + { avatar: "/placeholder-avatar.jpg", name: "Sarah Kim", profession: "Frontend Developer" }, + { avatar: "/placeholder-avatar.jpg", name: "Tom Wilson", profession: "Project Manager" }, + { avatar: "/placeholder-avatar.jpg", name: "Olivia Chen", profession: "QA Engineer" }, + ], + "2021": [ + { avatar: "/placeholder-avatar.jpg", name: "Alex Park", profession: "DevOps Engineer" }, + { avatar: "/placeholder-avatar.jpg", name: "Sophia Nguyen", profession: "Business Analyst" }, + { avatar: "/placeholder-avatar.jpg", name: "Ryan Gonzalez", profession: "Mobile Developer" }, + { avatar: "/placeholder-avatar.jpg", name: "Isabella Ramirez", profession: "Content Writer" }, + ], +} diff --git a/src/components/ui/avatar.tsx b/src/components/ui/avatar.tsx new file mode 100644 index 0000000..14bcc11 --- /dev/null +++ b/src/components/ui/avatar.tsx @@ -0,0 +1,48 @@ +import * as React from "react" +import * as AvatarPrimitive from "@radix-ui/react-avatar" + +import { cn } from "@/lib/utils" + +const Avatar = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +Avatar.displayName = AvatarPrimitive.Root.displayName + +const AvatarImage = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AvatarImage.displayName = AvatarPrimitive.Image.displayName + +const AvatarFallback = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName + +export { Avatar, AvatarImage, AvatarFallback }