From 56452da055527926d3d99140eef10ff2364ebf11 Mon Sep 17 00:00:00 2001
From: Dawn1Ocean <1785590531@qq.com>
Date: Tue, 7 May 2024 11:14:28 +0800
Subject: [PATCH] add sideStaff display in about page
---
src/components/Brief/index.tsx | 23 +++++++++--------
src/pages/About/index.tsx | 45 ++++++++++++++++++++++++++++++++--
src/pages/About/staff.ts | 19 +++++++++++++-
3 files changed, 74 insertions(+), 13 deletions(-)
diff --git a/src/components/Brief/index.tsx b/src/components/Brief/index.tsx
index e36fcf9..78bd0cf 100644
--- a/src/components/Brief/index.tsx
+++ b/src/components/Brief/index.tsx
@@ -9,19 +9,22 @@ const Brief: React.FC<{
profile: string;
link?: string;
linktext?: string;
-}> = ({ avatar, name, nickname, profile, link, linktext }) => {
+ isSideStaff?: boolean;
+}> = ({ avatar, name, nickname, profile, link, linktext, isSideStaff }) => {
return (
-
-
- {name}
-
- {nickname}
-
- {linktext}
-
+
+
+
+ {name}
+
+ {nickname}
+
+ {linktext}
+
+
+ {profile}
- {profile}
);
diff --git a/src/pages/About/index.tsx b/src/pages/About/index.tsx
index 9bc3b64..0f76085 100644
--- a/src/pages/About/index.tsx
+++ b/src/pages/About/index.tsx
@@ -3,10 +3,46 @@ 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';
+import staffs, { Staff } from './staff';
const Logs: React.FC = () => {
const [responsive, setResponsive] = useState(false);
+ const sideMembers = staffs.sideStaffList.length;
+
+ const pushSideStaff = (sideStaff: JSX.Element[][], tempMembers: Staff[]) => {
+ sideStaff.push(
+ tempMembers.map((staff: Staff, idx) => (
+
+
+
+ )),
+ );
+ };
+
+ let sideStaff: JSX.Element[][] = [],
+ tempMembers: Staff[] = [], i = 0, j;
+
+ /// 当个数模 3 余 1 时,先放置 2 行,每行 2 个;
+ /// 当个数模 3 余 2 时,先放置 1 行,每行 2 个;
+ /// 其余按每行 3 个放置
+ for (j = 0; j < Math.round(sideMembers / 3); j++) {
+ tempMembers.push(staffs.sideStaffList[i++]);
+ tempMembers.push(staffs.sideStaffList[i++]);
+ if (j >= (3 - sideMembers % 3) % 3) {
+ tempMembers.push(staffs.sideStaffList[i++]);
+ }
+ pushSideStaff(sideStaff, tempMembers);
+ tempMembers = [];
+ }
+
const staffRenderer = (
{
}}
>
- {staffList.map((staff: Staff, idx) => (
+ {staffs.staffList.map((staff: Staff, idx) => (
{
))}
+ {sideStaff.map((staffLine, idx) => (
+
+ {staffLine}
+
+ ))}
);
diff --git a/src/pages/About/staff.ts b/src/pages/About/staff.ts
index ffce316..d929f9c 100644
--- a/src/pages/About/staff.ts
+++ b/src/pages/About/staff.ts
@@ -24,4 +24,21 @@ const staffList: Staff[] = [
},
];
-export default staffList;
+const sideStaffList: Staff[] = [
+ {
+ avatar: 'https://wiki.zjueva.net/images/avatars/eva_wiki_27_l.png',
+ name: '亦可',
+ nickname: 'Echo',
+ profile: 'Eta 系统总运维',
+ link: 'https://wiki.zjueva.net/%E7%94%A8%E6%88%B7:%E4%BA%A6%E5%8F%AF',
+ linktext: '我的主页',
+ },
+ {
+ avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png',
+ name: '泰斯特',
+ nickname: 'Tester',
+ profile: 'Eta 系统总测试',
+ },
+]
+
+export default { staffList, sideStaffList };