Skip to content

Commit 07e6941

Browse files
committed
make it responsive
1 parent 17f3ff0 commit 07e6941

File tree

4 files changed

+79
-53
lines changed

4 files changed

+79
-53
lines changed

frontend/src/components/Button/Button.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import { cx } from 'emotion';
12
import React from 'react';
23
import style from './Button.module.css';
34

45
export const Button = (props) => {
5-
const { children, ...rest } = props;
6+
const { children, className, ...rest } = props;
67
return (
7-
<button className={style.button} {...rest}>
8+
<button className={cx(style.button, className)} {...rest}>
89
{children}
910
</button>
1011
);

frontend/src/features/header/Header.module.css

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 53 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,70 @@
1+
import { css } from 'emotion';
12
import React from 'react';
2-
import style from './Header.module.css';
33

44
export const Header = () => {
5+
const styles = {
6+
rootContainer: css`
7+
align-items: center;
8+
background: #333;
9+
color: white;
10+
display: flex;
11+
font-size: 1.5rem;
12+
height: 48px;
13+
padding-left: 1rem;
14+
`,
15+
icon: css`
16+
width: 32px;
17+
margin-right: 0.5rem;
18+
`,
19+
title: css`
20+
flex: 1;
21+
font-size: 1.5rem;
22+
`,
23+
coffeeImgContainer: css`
24+
border-radius: 5px;
25+
display: inline-flex;
26+
margin-right: 1rem;
27+
overflow: hidden;
28+
@media (max-width: 700px) {
29+
display: none;
30+
}
31+
`,
32+
coffeeImg: css`
33+
width: 130px;
34+
`,
35+
githubContainer: css`
36+
@media (max-width: 700px) {
37+
display: none;
38+
}
39+
`,
40+
};
41+
542
return (
6-
<div className={style.rootContainer}>
7-
<img src="/icon.png" className={style.icon} alt="document" />
8-
<h1 className={style.title}>Pairwise Pict Online</h1>
43+
<div className={styles.rootContainer}>
44+
<img src="/icon.png" className={styles.icon} alt="document" />
45+
<h1 className={styles.title}>Pairwise Pict Online</h1>
946
<a
10-
className={style.coffeeImgContainer}
47+
className={styles.coffeeImgContainer}
1148
href="https://www.buymeacoffee.com/FVSUK5u"
1249
rel="noopener noreferrer"
1350
target="_blank"
1451
>
1552
<img
1653
alt="Buy Me A Coffee"
17-
className={style.coffeeImg}
54+
className={styles.coffeeImg}
1855
src="https://cdn.buymeacoffee.com/buttons/lato-white.png"
1956
/>
2057
</a>
21-
<iframe
22-
src="https://ghbtns.com/github-btn.html?user=junkboy0315&repo=pairwise-pict-online&type=star&count=true&size=large"
23-
frameBorder="0"
24-
scrolling="0"
25-
title="github star icon"
26-
width="160px"
27-
height="30px"
28-
></iframe>
58+
<div className={styles.githubContainer}>
59+
<iframe
60+
src="https://ghbtns.com/github-btn.html?user=junkboy0315&repo=pairwise-pict-online&type=star&count=true&size=large"
61+
frameBorder="0"
62+
scrolling="0"
63+
title="github star icon"
64+
width="160px"
65+
height="30px"
66+
></iframe>
67+
</div>
2968
</div>
3069
);
3170
};

frontend/src/features/top/Top.tsx

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ export const Top = () => {
4545
flex: 1 0; /* expand */
4646
justify-content: space-between;
4747
padding: 1rem;
48+
@media (max-width: 700px) {
49+
flex-direction: column;
50+
}
4851
`,
4952
adsRow: css`
5053
flex: 0 0 90px;
@@ -62,10 +65,26 @@ export const Top = () => {
6265
flex-direction: column;
6366
flex: 1;
6467
`,
68+
generateButton: css`
69+
align-self: center;
70+
width: 8rem;
71+
margin: 1rem;
72+
::after {
73+
content: ' =>';
74+
}
75+
@media (max-width: 700px) {
76+
::after {
77+
content: none;
78+
}
79+
}
80+
`,
6581
download: css`
6682
display: block;
6783
margin: 0.5rem 0 1rem;
6884
text-align: center;
85+
@media (max-width: 700px) {
86+
display: none;
87+
}
6988
`,
7089
};
7190

@@ -102,15 +121,12 @@ export const Top = () => {
102121
className={style.download}
103122
tabIndex={-1}
104123
>
105-
Download
124+
Download Test Factors as .txt
106125
</a>
107126
</div>
108127

109-
<Button
110-
onClick={onGenerate}
111-
style={{ alignSelf: 'center', width: '8rem', margin: '0 1rem' }}
112-
>
113-
{isFetching ? 'loading...' : 'Generate=>'}
128+
<Button onClick={onGenerate} className={style.generateButton}>
129+
{isFetching ? 'loading...' : 'Generate'}
114130
</Button>
115131

116132
<div className={style.results}>
@@ -125,7 +141,7 @@ export const Top = () => {
125141
className={style.download}
126142
tabIndex={-1}
127143
>
128-
Download
144+
Download Results as .txt
129145
</a>
130146
</div>
131147
</div>

0 commit comments

Comments
 (0)