From 19a1c407f2aa52347b642066228037264ae6c091 Mon Sep 17 00:00:00 2001 From: Dawn1Ocean <1785590531@qq.com> Date: Thu, 18 Apr 2024 16:20:01 +0800 Subject: [PATCH] feat: about page & component --- src/components/Brief/index.tsx | 30 ++++++++++++++++++++++++++ src/pages/About/index.tsx | 39 ++++++++++++++++++++++++++++------ src/pages/About/staff.ts | 27 +++++++++++++++++++++++ 3 files changed, 90 insertions(+), 6 deletions(-) create mode 100644 src/components/Brief/index.tsx create mode 100644 src/pages/About/staff.ts diff --git a/src/components/Brief/index.tsx b/src/components/Brief/index.tsx new file mode 100644 index 0000000..e36fcf9 --- /dev/null +++ b/src/components/Brief/index.tsx @@ -0,0 +1,30 @@ +import { Flex, Image, Typography } from 'antd'; + +const { Text, Link } = Typography; + +const Brief: React.FC<{ + avatar: string; + name: string; + nickname: string; + profile: string; + link?: string; + linktext?: string; +}> = ({ avatar, name, nickname, profile, link, linktext }) => { + return ( +
+ + + {name} + + {nickname} + + {linktext} + + + {profile} + +
+ ); +}; + +export default Brief; diff --git a/src/pages/About/index.tsx b/src/pages/About/index.tsx index d6a98d1..9bc3b64 100644 --- a/src/pages/About/index.tsx +++ b/src/pages/About/index.tsx @@ -1,14 +1,41 @@ -import { Todo } from '@/components'; -import { PageContainer } from '@ant-design/pro-components'; +import Brief from '@/components/Brief'; +import { PageContainer, ProCard } from '@ant-design/pro-components'; import { Card } from 'antd'; +import RcResizeObserver from 'rc-resize-observer'; +import { useState } from 'react'; +import staffList, { Staff } from './staff'; const Logs: React.FC = () => { + const [responsive, setResponsive] = useState(false); + const staffRenderer = ( +
+ { + setResponsive(offset.width < 596); + }} + > + + {staffList.map((staff: Staff, idx) => ( + + + + ))} + + +
+ ); return ( - - - + {staffRenderer} ); }; -export default Logs; \ No newline at end of file +export default Logs; diff --git a/src/pages/About/staff.ts b/src/pages/About/staff.ts new file mode 100644 index 0000000..ffce316 --- /dev/null +++ b/src/pages/About/staff.ts @@ -0,0 +1,27 @@ +export interface Staff { + avatar: string; + name: string; + nickname: string; + profile: string; + link?: string; + linktext?: string; +} + +const staffList: Staff[] = [ + { + avatar: 'https://blog.dawn-ocean.top/assets/img/avatar.jpg', + name: '马国洋', + nickname: 'Dawn_Ocean', + profile: 'Eta & Tea 总设计\n摸鱼与开发叠加态', + link: 'https://blog.dawn-ocean.top', + linktext: '我的博客', + }, + { + avatar: 'https://static.fracher21.top/head.jpg', + name: '杨鸿奕', + nickname: 'Fracher', + profile: 'Ate 总设计, 项目合作贡献者\nReact 真是太有意思了', + }, +]; + +export default staffList;