Skip to content

Commit a9aeee4

Browse files
author
=
committed
fix spacing for mobile
1 parent 6c5ea06 commit a9aeee4

File tree

7 files changed

+51
-49
lines changed

7 files changed

+51
-49
lines changed

examples/district/app/[locale]/[district]/[department]/[scheme]/components/Explorer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const Explorer = React.forwardRef(
6161
return (
6262
<div
6363
className={cn(
64-
'md:grid grid-cols-[242px_1fr] gap-4 rounded-05 bg-surfaceDefault shadow-elementCard p-6'
64+
'md:grid grid-cols-[242px_1fr] gap-4 rounded-05 md:bg-surfaceDefault md:shadow-elementCard md:p-6'
6565
)}
6666
>
6767
<div className="hidden md:block">

examples/district/app/[locale]/[district]/[department]/[scheme]/components/scheme-layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export const Content = ({ data }: { data: IProps }) => {
120120

121121
<div className="mt-4 px-2 md:container py-1 lg:py-2">
122122
<div className="flex gap-4 flex-wrap justify-start md:flex-nowrap">
123-
<div className="flex">
123+
<div className="hidden md:flex">
124124
<Image
125125
src={schemes[data.scheme].logo}
126126
alt=""
@@ -228,7 +228,7 @@ const TabLayout = ({
228228
</Tab>
229229
))}
230230
</TabList>
231-
<div className="mt-6 px-3 py-4 bg-surfaceDefault">
231+
<div className="mt-6 md:px-3 md:py-4 md:bg-surfaceDefault">
232232
{tabValue === 'overview' && (
233233
<div className="mb-3 flex items-center justify-end gap-4 flex-wrap">
234234
<Button

examples/district/components/mobile-nav.tsx

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as Collapsible from '@radix-ui/react-collapsible';
66
import { cn } from '@/lib/utils';
77
import Link from 'next/link';
88
import { mainConfig } from '@/config/site';
9-
import { useParams, usePathname } from 'next/navigation';
9+
import { usePathname } from 'next/navigation';
1010

1111
const districts = [
1212
{
@@ -37,43 +37,45 @@ export const MobileNav = () => {
3737
}, [open]);
3838

3939
return (
40-
<header>
41-
<div className="px-5 py-3 bg-backgroundSolidDark text-textOnBGDefault flex items-center justify-between">
42-
<Link href="/" className="flex items-center gap-2">
43-
<svg
44-
xmlns="http://www.w3.org/2000/svg"
45-
width="24"
46-
height="24"
47-
fill="none"
48-
>
49-
<g
50-
stroke="#fff"
51-
strokeLinecap="round"
52-
strokeLinejoin="round"
53-
strokeWidth="1.5"
54-
clipPath="url(#a)"
40+
<>
41+
<header>
42+
<div className="px-5 py-3 bg-backgroundSolidDark text-textOnBGDefault flex items-center justify-between">
43+
<Link href="/" className="flex items-center gap-2">
44+
<svg
45+
xmlns="http://www.w3.org/2000/svg"
46+
width="24"
47+
height="24"
48+
fill="none"
5549
>
56-
<path d="M8 4 4 6v5l4 2 4-2V6L8 4ZM12 11l4 2 4-2V6l-4-2-4 2M8 13v5l4 2 4-2v-5" />
57-
</g>
58-
<defs>
59-
<clipPath id="a">
60-
<path fill="#fff" d="M0 0h24v24H0z" />
61-
</clipPath>
62-
</defs>
63-
</svg>
64-
<Text variant="headingSmSpaced" color="inherit">
65-
D4D ASSAM
66-
</Text>
67-
</Link>
50+
<g
51+
stroke="#fff"
52+
strokeLinecap="round"
53+
strokeLinejoin="round"
54+
strokeWidth="1.5"
55+
clipPath="url(#a)"
56+
>
57+
<path d="M8 4 4 6v5l4 2 4-2V6L8 4ZM12 11l4 2 4-2V6l-4-2-4 2M8 13v5l4 2 4-2v-5" />
58+
</g>
59+
<defs>
60+
<clipPath id="a">
61+
<path fill="#fff" d="M0 0h24v24H0z" />
62+
</clipPath>
63+
</defs>
64+
</svg>
65+
<Text variant="headingSmSpaced" color="inherit">
66+
D4D ASSAM
67+
</Text>
68+
</Link>
6869

69-
<IconButton
70-
icon={open ? Icons.cross : Icons.menu}
71-
onClick={() => setOpen((e) => !e)}
72-
className="text-textOnBGDefault"
73-
>
74-
Menu
75-
</IconButton>
76-
</div>
70+
<IconButton
71+
icon={open ? Icons.cross : Icons.menu}
72+
onClick={() => setOpen((e) => !e)}
73+
color="onBgDefault"
74+
>
75+
Menu
76+
</IconButton>
77+
</div>
78+
</header>
7779
{open && (
7880
<div className="h-screen overflow-y-auto bg-backgroundSolidDark text-textOnBGDefault border-t-1 border-solid border-baseGraySlateSolid11">
7981
<Link
@@ -108,7 +110,7 @@ export const MobileNav = () => {
108110
))}
109111
</div>
110112
)}
111-
</header>
113+
</>
112114
);
113115
};
114116

examples/district/styles/globals.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@
1818
--card-border-rgb: 131, 134, 135;
1919
}
2020

21-
html {
21+
/* html {
2222
overflow-y: scroll;
23-
}
23+
} */
2424

2525
body {
2626
background-color: var(--background-solid-subdued);
2727
}
2828

29-
html,
29+
/* html,
3030
body,
3131
body > .opub-Tooltip {
3232
height: 100%;
33-
}
33+
} */
3434

3535
a {
3636
color: inherit;

packages/opub-ui/assets/base.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ body {
33
line-height: 150%;
44
box-sizing: border-box;
55
font-family: var(--primary-font);
6-
--outline: 2px solid var(--focused);
6+
--outline: 2px solid var(--text-interactive);
77
--outline-offset: 2px;
88
}
99

packages/opub-ui/src/components/IconButton/IconButton.module.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
}
1818

1919
&:hover {
20-
background: var(--surface-selected);
20+
// background: var(--surface-selected);
2121
outline: var(--border-width-1) solid transparent;
2222
}
2323

@@ -29,7 +29,7 @@
2929
}
3030

3131
&:active {
32-
background: var(--surface-selected);
32+
// background: var(--surface-selected);
3333
box-shadow: var(--shadow-button-default);
3434

3535
&::after {
@@ -39,7 +39,7 @@
3939
}
4040

4141
&.pressed {
42-
background: var(--surface-selected);
42+
// background: var(--surface-selected);
4343
box-shadow: var(--shadow-button-pressed);
4444

4545
@include recolor-icon(currentColor);

packages/opub-viz/styles/base.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ body {
8282
line-height: 150%;
8383
box-sizing: border-box;
8484
font-family: var(--primary-font);
85-
--outline: 2px solid var(--focused);
85+
--outline: 2px solid var(--text-interactive);
8686
--outline-offset: 2px;
8787
}
8888

0 commit comments

Comments
 (0)