Skip to content

Commit 76a306f

Browse files
committed
fix(pin) no pin on mobile
1 parent c5ac97f commit 76a306f

File tree

3 files changed

+42
-30
lines changed

3 files changed

+42
-30
lines changed

.storybook/stories/Compact/fixed-column.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,30 @@ const Component = () => {
1313

1414
const theme = useTheme({
1515
BaseCell: `
16-
&:nth-of-type(1) {
17-
left: 0px;
18-
19-
min-width: 250px;
20-
width: 250px;
21-
}
22-
23-
&:nth-of-type(2) {
24-
left: 250px;
25-
26-
min-width: 150px;
27-
width: 150px;
28-
}
29-
30-
&:nth-of-type(3) {
31-
min-width: 20%;
32-
width: 20%;
33-
}
34-
35-
&:nth-of-type(4), &:nth-of-type(5) {
36-
min-width: 700px;
37-
width: 700px;
38-
}
39-
`,
16+
&:nth-of-type(1) {
17+
left: 0px;
18+
19+
min-width: 250px;
20+
width: 250px;
21+
}
22+
23+
&:nth-of-type(2) {
24+
left: 250px;
25+
26+
min-width: 150px;
27+
width: 150px;
28+
}
29+
30+
&:nth-of-type(3) {
31+
min-width: 20%;
32+
width: 20%;
33+
}
34+
35+
&:nth-of-type(4), &:nth-of-type(5) {
36+
min-width: 700px;
37+
width: 700px;
38+
}
39+
`,
4040
});
4141

4242
const COLUMNS = [

.storybook/stories/Features/fixed-header.story.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ storiesOf('Features/Fixed Header', module)
8888

8989
return (
9090
// check .storybook/preview.js for body style
91-
<>
91+
<div style={{ height: '100vh' }}>
9292
<div
9393
style={{
9494
height: '40%',
@@ -150,7 +150,7 @@ storiesOf('Features/Fixed Header', module)
150150
>
151151
Some Footer
152152
</div>
153-
</>
153+
</div>
154154
);
155155
})
156156
.add('in flex container', () => {
@@ -164,10 +164,10 @@ storiesOf('Features/Fixed Header', module)
164164

165165
return (
166166
// check .storybook/preview.js for body style
167-
<>
167+
<div style={{ height: '100vh' }}>
168168
<div
169169
style={{
170-
height: '40%',
170+
height: '40vh',
171171
border: '1px solid black',
172172
display: 'flex',
173173
justifyContent: 'center',
@@ -178,6 +178,7 @@ storiesOf('Features/Fixed Header', module)
178178
</div>
179179
<div
180180
style={{
181+
height: '20vh',
181182
flex: '1',
182183
display: 'flex',
183184
flexDirection: 'column',
@@ -233,7 +234,7 @@ storiesOf('Features/Fixed Header', module)
233234
</div>
234235
<div
235236
style={{
236-
height: '40%',
237+
height: '40vh',
237238
border: '1px solid black',
238239
display: 'flex',
239240
justifyContent: 'center',
@@ -242,7 +243,7 @@ storiesOf('Features/Fixed Header', module)
242243
>
243244
Some Footer
244245
</div>
245-
</>
246+
</div>
246247
);
247248
})
248249
.add('documentation', () => (

.storybook/stories/Introduction/demo.story.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ const queryClient = new QueryClient();
4343

4444
const twoDecimals = (integer) => Number((Math.round(integer * 100) / 100).toFixed(2));
4545

46+
const disablePin = `
47+
@media screen and (max-width: 480px) {
48+
&.pin-left, &.pin-right {
49+
position: static;
50+
z-index: 1;
51+
}
52+
}
53+
`;
54+
4655
const CUSTOM_SHARED_THEME = {
4756
HeaderRow: `
4857
font-size: 12px;
@@ -59,6 +68,8 @@ const CUSTOM_SHARED_THEME = {
5968
padding-top: 14px;
6069
padding-bottom: 14px;
6170
71+
${disablePin}
72+
6273
min-width: 20%;
6374
width: 20%;
6475

0 commit comments

Comments
 (0)