Skip to content

Commit 56dad07

Browse files
committed
responsiveness changes
1 parent 8a669b6 commit 56dad07

12 files changed

Lines changed: 45 additions & 24 deletions

File tree

client/components/Comment.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ const Comment = ({ comment }) => {
2727
>
2828
<Box
2929
display="flex"
30-
alignItems="center"
30+
flexDirection={['column', 'row']}
31+
alignItems={['flex-start', 'center']}
3132
justifyContent="space-between"
3233
mb={3}
3334
>
3435
{comment.user?.username ? (
35-
<Text color="grey" icon={CommentIcon}>
36+
<Text color="grey" icon={CommentIcon} mb={[2, 0]}>
3637
Comment by{' '}
3738
<Link href={`/user/${comment.user.username}`} passHref>
3839
<Text as="a">{comment.user.username}</Text>

client/components/Navigation.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ const Navigation = ({ isMobile, menuIsOpen, setMenuIsOpen }) => {
6161

6262
const theme = useContext(ThemeContext)
6363

64+
const { asPath } = useRouter()
65+
6466
const { username, token } = cookies
6567

6668
const {
@@ -86,6 +88,10 @@ const Navigation = ({ isMobile, menuIsOpen, setMenuIsOpen }) => {
8688
setIsServer(false)
8789
}, [token])
8890

91+
useEffect(() => {
92+
if (isMobile && menuIsOpen) setMenuIsOpen(false)
93+
}, [asPath])
94+
8995
if (isMobile && !menuIsOpen) return null
9096

9197
return (

client/components/TorrentList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const TorrentList = ({ torrents = [], categories, total }) => {
101101
cell: ({ value }) => (
102102
<Text>{moment(value).format('Do MMM YYYY')}</Text>
103103
),
104-
gridWidth: '1fr',
104+
gridWidth: '175px',
105105
rightAlign: true,
106106
},
107107
]}

client/pages/_app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const GlobalStyle = createGlobalStyle(
9999
#__next main {
100100
min-height: calc(100vh - 109px);
101101
max-width: ${sizes.body};
102-
padding: ${space[4]}px;
102+
padding: ${space[4]}px ${space[4]}px 60px;
103103
}
104104
@media screen and (min-width: ${breakpoints[0]}) {
105105
#__next main {

client/pages/account.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,20 @@ const BuyItem = ({ text, cost, wallet, handleBuy }) => {
2727
return (
2828
<Box
2929
display="flex"
30-
alignItems="center"
30+
flexDirection={['column', 'row']}
31+
alignItems={['flex-start', 'center']}
3132
justifyContent="space-between"
3233
border="1px solid"
3334
borderColor="border"
3435
borderRadius={1}
3536
p={3}
3637
pl={4}
3738
>
38-
<Text>{text}</Text>
39-
<form onSubmit={handleBuy}>
40-
<Box display="flex" alignItems="center">
39+
<Text mb={[3, 0]} _css={{ whiteSpace: 'nowrap' }}>
40+
{text}
41+
</Text>
42+
<Box as="form" onSubmit={handleBuy} width="100%">
43+
<Box display="flex" alignItems="center" justifyContent="flex-end">
4144
<Text color="grey" mr={4}>
4245
{unavailable
4346
? 'Not available to buy'
@@ -56,7 +59,7 @@ const BuyItem = ({ text, cost, wallet, handleBuy }) => {
5659
/>
5760
<Button disabled={unavailable || cannotAfford}>Buy</Button>
5861
</Box>
59-
</form>
62+
</Box>
6063
</Box>
6164
)
6265
}
@@ -296,15 +299,15 @@ const Account = ({ token, invites = [], user, userRole }) => {
296299
{moment(value).format('HH:mm Do MMM YYYY')}
297300
</Text>
298301
),
299-
gridWidth: '1.2fr',
302+
gridWidth: '175px',
300303
},
301304
{
302305
header: 'Created',
303306
accessor: 'created',
304307
cell: ({ value }) => (
305308
<Text>{moment(value).format('HH:mm Do MMM YYYY')}</Text>
306309
),
307-
gridWidth: '1.2fr',
310+
gridWidth: '175px',
308311
},
309312
...(userRole === 'admin'
310313
? [

client/pages/announcements/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const Announcements = ({ announcements, pinnedAnnouncements, userRole }) => {
6060
<Text>{moment(value).format('HH:mm Do MMM YYYY')}</Text>
6161
),
6262
rightAlign: true,
63-
gridWidth: '1fr',
63+
gridWidth: '175px',
6464
},
6565
]}
6666
/>
@@ -95,7 +95,7 @@ const Announcements = ({ announcements, pinnedAnnouncements, userRole }) => {
9595
<Text>{moment(value).format('HH:mm Do MMM YYYY')}</Text>
9696
),
9797
rightAlign: true,
98-
gridWidth: '1fr',
98+
gridWidth: '175px',
9999
},
100100
]}
101101
/>

client/pages/categories/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const Categories = () => {
3838
<Box
3939
as="ul"
4040
display="grid"
41-
gridTemplateColumns="repeat(4, 1fr)"
41+
gridTemplateColumns={['1fr', 'repeat(4, 1fr)']}
4242
gridGap={4}
4343
_css={{ pl: 0, listStyle: 'none' }}
4444
>

client/pages/reports/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const Reports = ({ reports, userRole }) => {
5151
<Text>{moment(value).format('HH:mm Do MMM YYYY')}</Text>
5252
),
5353
rightAlign: true,
54-
gridWidth: '1fr',
54+
gridWidth: '175px',
5555
},
5656
]}
5757
/>

client/pages/requests/[index].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ const Request = ({ request, token, user }) => {
301301
cell: ({ value }) => (
302302
<Text>{moment(value).format('Do MMM YYYY')}</Text>
303303
),
304-
gridWidth: '1fr',
304+
gridWidth: '175px',
305305
rightAlign: true,
306306
},
307307
...(user === request.createdBy._id

client/pages/requests/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const Requests = ({ requests }) => {
5555
{value ? <Check size={24} /> : <X size={24} />}{' '}
5656
</Box>
5757
),
58-
gridWidth: '0.5fr',
58+
gridWidth: '100px',
5959
},
6060
{
6161
header: 'Created',
@@ -64,7 +64,7 @@ const Requests = ({ requests }) => {
6464
<Text>{moment(value).format('HH:mm Do MMM YYYY')}</Text>
6565
),
6666
rightAlign: true,
67-
gridWidth: '0.5fr',
67+
gridWidth: '175px',
6868
},
6969
]}
7070
/>

0 commit comments

Comments
 (0)