Skip to content

Commit 570b1d7

Browse files
authored
Merge pull request #1960 from streamr-dev/FRONT-1456-mobile-fixes
[FRONT-1456] Mobile UX fixes
2 parents 5f24c5b + 7ac6421 commit 570b1d7

File tree

4 files changed

+57
-7
lines changed

4 files changed

+57
-7
lines changed

src/modals/AccessPeriodModal.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ const PeriodContainer = styled.div`
3131
border-radius: 8px;
3232
gap: 16px;
3333
padding: 32px 24px;
34+
position: relative;
35+
36+
@media (max-width: 768px) {
37+
grid-template-columns: 1fr;
38+
}
3439
`
3540

3641
const DetailsContainer = styled.div`

src/modals/AccessingProjectModal.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ import { Footer } from './BaseModal'
88

99
const Content = styled.div`
1010
margin: 0 auto;
11-
padding: 48px 0 56px;
12-
width: 448px;
11+
padding: 48px 24px 56px;
12+
max-width: 448px;
13+
width: 100%;
1314
1415
p {
1516
margin: 0 0 16px;

src/modals/ProjectModal.tsx

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,39 @@ const Root = styled.div`
2727
top: 0;
2828
width: 100%;
2929
z-index: 1;
30+
display: flex;
31+
flex-direction: column;
32+
overflow: hidden;
3033
`
3134

3235
const Column = styled.div`
3336
margin: 0 auto;
34-
width: 528px;
37+
max-width: 528px;
38+
width: 100%;
39+
height: 100%;
40+
display: flex;
41+
flex-direction: column;
42+
overflow: hidden;
43+
`
44+
45+
const ScrollableContent = styled.div`
46+
flex: 1;
47+
overflow-y: auto;
48+
padding: 0 16px;
49+
50+
@media (min-width: 768px) {
51+
padding: 0;
52+
}
3553
`
3654

3755
const Nav = styled.div`
3856
box-sizing: content-box;
3957
height: 64px;
40-
padding: 48px 0;
58+
padding: 48px 16px;
59+
60+
@media (min-width: 768px) {
61+
padding: 48px 0;
62+
}
4163
4264
button {
4365
appearance: none;
@@ -61,6 +83,11 @@ const Nav = styled.div`
6183
font-weight: 400;
6284
line-height: normal;
6385
margin: 0 0 20px;
86+
padding: 0 16px;
87+
88+
@media (min-width: 768px) {
89+
padding: 0;
90+
}
6491
}
6592
`
6693

@@ -71,9 +98,24 @@ const BackButtonIcon = styled(SvgIcon)`
7198
export const Actions = styled.div`
7299
align-items: center;
73100
display: flex;
74-
height: 40px;
75101
justify-content: flex-end;
76102
margin-top: 32px;
103+
gap: 16px;
104+
padding: 0 16px 16px;
105+
background: #f5f5f5;
106+
107+
@media (min-width: 768px) {
108+
padding: 0 0 16px;
109+
}
110+
111+
@media (max-width: 767px) {
112+
flex-direction: column-reverse;
113+
align-items: stretch;
114+
115+
button {
116+
width: 100%;
117+
}
118+
}
77119
78120
button {
79121
min-width: 120px;
@@ -125,7 +167,8 @@ export default function ProjectModal({
125167
)}
126168
</Nav>
127169
{!!title && <h2>&zwnj;{title}</h2>}
128-
<div>{children}</div>
170+
<ScrollableContent>{children}</ScrollableContent>
171+
<Actions />
129172
</Column>
130173
</Root>
131174
)

src/modals/PurchaseCompleteModal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const Box = styled.div`
1010
border-radius: 8px;
1111
padding: 32px 24px;
1212
margin: 0 auto;
13-
width: 408px;
13+
width: 100%;
14+
max-width: 408px;
1415
1516
h2 {
1617
font-size: 24px;

0 commit comments

Comments
 (0)