Skip to content

Commit ca4c324

Browse files
committed
551: Fix Leaderboard Card Ordering On Mobile View
1 parent ef6b588 commit ca4c324

2 files changed

Lines changed: 28 additions & 10 deletions

File tree

js/src/app/dashboard/Dashboard.page.tsx

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,30 @@ export default function DashboardPage() {
6363
: <RefreshSubmissions schoolRegistered={schoolRegistered} />}
6464
</Center>
6565
<Flex direction={smallPhone ? "row" : "column"} gap={"md"}>
66-
<Flex direction={"column"} flex={1}>
67-
<ProblemOfTheDay />
68-
</Flex>
69-
<Flex direction={"column"} flex={1}>
70-
<DashboardLeaderboard
71-
userId={data.user.id}
72-
userTags={data.user.tags}
73-
/>
74-
</Flex>
66+
{smallPhone ?
67+
<>
68+
<Flex direction={"column"} flex={1}>
69+
<ProblemOfTheDay />
70+
</Flex>
71+
<Flex direction={"column"} flex={1}>
72+
<DashboardLeaderboard
73+
userId={data.user.id}
74+
userTags={data.user.tags}
75+
/>
76+
</Flex>
77+
</>
78+
: <>
79+
<Flex direction={"column"} flex={1}>
80+
<DashboardLeaderboard
81+
userId={data.user.id}
82+
userTags={data.user.tags}
83+
/>
84+
</Flex>
85+
<Flex direction={"column"} flex={1}>
86+
<ProblemOfTheDay />
87+
</Flex>
88+
</>
89+
}
7590
<Flex direction={"column"} flex={1}>
7691
<RecentSubmissions userId={data.user.id} />
7792
</Flex>

js/src/app/dashboard/_components/ProblemOfTheDay/ProblemOfTheDay.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ export default function ProblemOfTheDay() {
4040
const json = data.payload;
4141

4242
return (
43-
<CodebloomCard miw={"31vw"} mih={"63vh"}>
43+
<CodebloomCard
44+
miw={{ base: "31vw", md: "31vw" }}
45+
mih={{ base: "auto", md: "63vh" }}
46+
>
4447
<Center>
4548
<Title style={{ textAlign: "center" }} order={3}>
4649
Problem of the day

0 commit comments

Comments
 (0)