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}