Skip to content

Commit 0ddd577

Browse files
committed
fix: mobile layout
1 parent 1b84d53 commit 0ddd577

File tree

13 files changed

+68
-20
lines changed

13 files changed

+68
-20
lines changed

app/[lang]/(common)/Header/index.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,19 @@ export default function Header(props: Props): ReactElement {
251251
const {t, lang} = props;
252252
const supabase = useMemo(() => getSupabaseBrowserClient(), []);
253253

254-
const [isDark, setIsDark] = useState(() => isDarkMode());
254+
const [isDark, setIsDark] = useState(true);
255255
const {login, changeLogin} = useAuthContext();
256256

257+
useEffect(() => {
258+
const frame = requestAnimationFrame(() => {
259+
const dark = isDarkMode();
260+
if (!dark) {
261+
setIsDark(false);
262+
}
263+
});
264+
return () => cancelAnimationFrame(frame);
265+
}, []);
266+
257267
const navLinks: NavLink[] = !!login
258268
? [
259269
{

app/[lang]/(home)/Hero/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function Hero({t, statsInfo}: Props): ReactElement {
124124
return (
125125
<div
126126
className={clsx(
127-
'self-stretch bg-paper relative',
127+
'self-stretch bg-paper-light dark:bg-paper-dark relative',
128128
'flex flex-col justify-center items-center',
129129
'max-[425px]:p-0',
130130
)}
@@ -133,11 +133,11 @@ function Hero({t, statsInfo}: Props): ReactElement {
133133
className={clsx(
134134
'self-stretch px-14',
135135
'flex flex-col align-start justify-start',
136-
'max-[425px]:px-8',
136+
'max-[768px]:px-6 max-[480px]:px-4',
137137
'min-[1200px]:self-center min-[1200px]:w-[1200px]',
138138
)}
139139
>
140-
<p className="h1 text-[44px] text-left font-bold mt-[80px] mb-8 text-contrast-light dark:text-contrast-dark">
140+
<p className="h1 text-[44px] text-left font-bold mt-[80px] mb-8 max-[480px]:mt-8 max-[480px]:text-[32px] text-contrast-light dark:text-contrast-dark">
141141
{t.developerPowerMeter}
142142
</p>
143143
<p className="body1 text-[20px] text-left mb-[36px] text-gray5 dark:text-gray3">

app/[lang]/(home)/Home.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function Home({t, statsInfo}: Props): ReactElement {
2525
initAmplitude();
2626

2727
return (
28-
<div className={clsx('flex-1 w-screen', 'flex flex-col')}>
28+
<div className={clsx('flex-1 w-full', 'flex flex-col')}>
2929
<Hero t={t} statsInfo={statsInfo} />
3030
<SectionHowItWorks t={t} />
3131
<SectionFooter t={t} />

app/[lang]/(home)/SectionFooter.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default function SectionFooter({t}: Props): ReactElement {
2222
return (
2323
<div
2424
className={clsx(
25-
'self-stretch bg-paper bg-cover',
25+
'self-stretch bg-paper-light dark:bg-paper-dark bg-cover',
2626
'flex flex-col justify-center items-center',
2727
'md:p-0',
2828
)}
@@ -40,7 +40,8 @@ export default function SectionFooter({t}: Props): ReactElement {
4040
>
4141
<p
4242
className={clsx(
43-
'text-white leading-8 text-[24px] text-center mt-12 mb-20',
43+
'text-white leading-8 text-[24px] text-center mt-12 mb-20 px-6',
44+
'max-[480px]:text-[18px] max-[480px]:leading-7 max-[480px]:px-8',
4445
inter.className,
4546
)}
4647
>

app/[lang]/(home)/SectionHowItWorks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default function SectionHowItWorks({t}: Props): ReactElement {
4444
return (
4545
<div
4646
className={clsx(
47-
'self-stretch bg-paper bg-cover',
47+
'self-stretch bg-paper-light dark:bg-paper-dark bg-cover',
4848
'flex flex-col justify-center items-center',
4949
'py-20 px-6',
5050
)}

app/[lang]/layout.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,13 @@ export default async function LangLayout(props: Props): Promise<ReactElement> {
3333
'min-w-0 overflow-x-hidden',
3434
)}
3535
>
36-
<div className={clsx('h-[calc(100vh-56px)]', 'flex w-full min-w-0')}>
36+
<div
37+
className={clsx(
38+
'h-[calc(100vh-56px)]',
39+
'flex w-full min-w-0',
40+
'overflow-y-auto',
41+
)}
42+
>
3743
{children}
3844
</div>
3945
<Header

app/[lang]/leaderboards/GithubUserList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ export default function GithubUserList({t, initialData}: Props): ReactElement {
251251
className="p-6 max-[480px]:p-4"
252252
classNames={{
253253
tHead:
254-
'bg-paper backdrop-blur-xl border-b border-black/10 dark:border-white/10 px-2 pb-2 -mx-6 -mt-6 px-6 pt-6 rounded-t-[20px] max-[480px]:-mx-4 max-[480px]:-mt-4 max-[480px]:px-4 max-[480px]:pt-4 max-[480px]:rounded-t-[16px]',
254+
'bg-paper-light dark:bg-paper-dark backdrop-blur-xl border-b border-black/10 dark:border-white/10 px-2 pb-2 -mx-6 -mt-6 px-6 pt-6 rounded-t-[20px] max-[480px]:-mx-4 max-[480px]:-mt-4 max-[480px]:px-4 max-[480px]:pt-4 max-[480px]:rounded-t-[16px]',
255255
tBodyRow:
256256
'hover:bg-black/10 dark:hover:bg-white/5 transition-all duration-200 rounded-[8px] my-1',
257257
}}

app/[lang]/leaderboards/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ export default async function Page(props: Props): Promise<ReactElement> {
3636
const userPlugins = plugin ? await getUserPlugins({plugin}) : [];
3737

3838
return (
39-
<div className={clsx('flex-1 bg-paper overflow-hidden', 'flex flex-col')}>
39+
<div className={clsx('flex-1 bg-paper-light dark:bg-paper-dark overflow-hidden', 'flex flex-col')}>
4040
<div
4141
className={clsx(
4242
'mt-4 mb-[32px] px-6 w-full',
4343
'flex flex-row items-center gap-4',
44-
'max-[768px]:flex-col max-[480px]:mb-6 max-[480px]:mt-2',
44+
'max-[768px]:flex-col max-[480px]:mb-6 max-[480px]:mt-8 max-[480px]:px-4',
4545
)}
4646
>
4747
<H1

app/[lang]/loading.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function Loading(): ReactElement {
1010
return (
1111
<div
1212
className={clsx(
13-
'flex-1 self-stretch p-4 bg-paper',
13+
'flex-1 self-stretch p-4 bg-paper-light dark:bg-paper-dark',
1414
'flex flex-row justify-center items-center',
1515
)}
1616
>

app/[lang]/sign-in/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default async function Page(props: Props): Promise<ReactElement> {
4848
<div
4949
className={clsx(
5050
'bg-modal-background pb-20',
51-
'flex-1 bg-paper overflow-hidden',
51+
'flex-1 bg-paper-light dark:bg-paper-dark overflow-hidden',
5252
'max-md:px-4',
5353
'flex flex-col justify-center items-center',
5454
)}

0 commit comments

Comments
 (0)