From b64efe8a6c6ae79222bfb5698d2688b7fc1f735d Mon Sep 17 00:00:00 2001 From: JSR Date: Wed, 18 Mar 2026 21:20:41 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=96=E5=B1=8F=E6=94=B9=E4=B8=BA=E7=BA=B5?= =?UTF-8?q?=E5=90=91=E7=B4=A7=E5=87=91=E5=88=97=E8=A1=A8=E5=B9=B6=E6=B6=88?= =?UTF-8?q?=E9=99=A4=E6=A8=AA=E5=90=91=E6=BB=9A=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ContentArea.tsx | 9 ++++-- src/components/Home.tsx | 58 ++++++++++++++++++++++++++-------- 2 files changed, 51 insertions(+), 16 deletions(-) diff --git a/src/components/ContentArea.tsx b/src/components/ContentArea.tsx index cf97adc..bf390c5 100644 --- a/src/components/ContentArea.tsx +++ b/src/components/ContentArea.tsx @@ -155,7 +155,7 @@ export function ContentArea({ /> - + } + element={ + + } /> } /> = { z: "9", } -export const Home: React.FC<{ canEdit: boolean }> = ({ canEdit }) => { +interface HomeProps { + canEdit: boolean + isPortraitMode?: boolean +} + +export const Home: React.FC = ({ canEdit, isPortraitMode = false }) => { const { t } = useTranslation() const [students, setStudents] = useState([]) const [reasons, setReasons] = useState([]) @@ -535,7 +540,7 @@ export const Home: React.FC<{ canEdit: boolean }> = ({ canEdit }) => { overflow: "visible", boxShadow: isQuickActionMode ? "0 8px 18px rgba(22, 119, 255, 0.18)" : undefined, }} - styles={{ body: { padding: "12px" } }} + styles={{ body: { padding: isPortraitMode ? "10px 12px" : "12px" } }} > {rankBadge && (
= ({ canEdit }) => { {rankBadge}
)} -
+
{student.avatarUrl ? ( {student.name} = ({ canEdit }) => { ) : (
= ({ canEdit }) => { justifyContent: "center", color: "white", fontWeight: "bold", - fontSize: avatarText.length > 1 ? "14px" : "18px", + fontSize: isPortraitMode + ? avatarText.length > 1 + ? "13px" + : "16px" + : avatarText.length > 1 + ? "14px" + : "18px", flexShrink: 0, boxShadow: `0 4px 10px ${avatarColor}40`, }} @@ -586,7 +597,14 @@ export const Home: React.FC<{ canEdit: boolean }> = ({ canEdit }) => { {avatarText}
)} -
+
= ({ canEdit }) => { return groupedStudents.map((group) => (
{ groupRefs.current[group.key] = el }} @@ -706,9 +724,10 @@ export const Home: React.FC<{ canEdit: boolean }> = ({ canEdit }) => { )}
{group.students.map((student, idx) => renderStudentCard(student, idx))} @@ -902,6 +921,7 @@ export const Home: React.FC<{ canEdit: boolean }> = ({ canEdit }) => { const renderQuickNav = () => { if ( + isPortraitMode || groupedStudents.length <= 1 || sortType === "score" || (sortType === "alphabet" && searchKeyword) @@ -1023,7 +1043,17 @@ export const Home: React.FC<{ canEdit: boolean }> = ({ canEdit }) => { } return ( -
+
{contextHolder}