Skip to content
This repository was archived by the owner on Mar 7, 2024. It is now read-only.

Commit 55bebac

Browse files
Important Design optimazations for Mobile Viewers (#140)
* Design optimazations for Mobile Viewers * remove hScrolling on course page
1 parent 507b58e commit 55bebac

File tree

20 files changed

+119
-99
lines changed

20 files changed

+119
-99
lines changed

public/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<link
1414
href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,500&display=swap"
1515
rel="stylesheet">
16+
<link href="index.css" rel="stylesheet">
1617
<title>Code for Cause</title>
1718
<meta
1819
name="description"

src/components/Course/CourseCardTemplate1.js

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
import React from 'react';
1+
import { Box, Card, CardContent, Typography } from '@material-ui/core';
22
import { makeStyles } from '@material-ui/core/styles';
33
import ParallaxSlide from '@mui-treasury/components/slide/parallax';
4-
5-
import {
6-
Typography,
7-
Box,
8-
Card,
9-
CardContent,
10-
Container
11-
} from '@material-ui/core';
4+
import React from 'react';
125
import { Link } from 'react-router-dom';
136

147
const useStyles = makeStyles(theme => ({
@@ -41,7 +34,9 @@ const useStyles = makeStyles(theme => ({
4134
height: 'auto'
4235
// paddingTop: "56.25%", // 16:9
4336
},
44-
cardContent: {},
37+
cardContent: {
38+
padding: '16px 0px 16px 16px'
39+
},
4540
chipActions: {
4641
display: 'block'
4742
},
@@ -99,6 +94,14 @@ const useStyles = makeStyles(theme => ({
9994
width: '100%',
10095
// Promote the list into his own layer on Chrome. This cost memory but helps keeping high FPS.
10196
transform: 'translateZ(0)'
97+
},
98+
bottomCardContent: {
99+
margin: '0px 8px 18px 0px',
100+
padding: '4px 8px',
101+
border: '1px solid',
102+
borderColor: '#A6A6A6',
103+
borderRadius: '5px',
104+
width: 'min-content'
102105
}
103106
}));
104107

@@ -113,7 +116,7 @@ export default function CourseCard({ course }) {
113116
maxWidth: '320px'
114117
}}
115118
>
116-
<CardContent className={classes.cardContent}>
119+
<CardContent>
117120
<Box display="flex" flexDirection="column">
118121
<Typography
119122
align="left"
@@ -145,26 +148,24 @@ export default function CourseCard({ course }) {
145148
<ParallaxCarousel slides={course.slides} />
146149

147150
<CardContent className={classes.cardContent}>
148-
<Box mt={0} display="flex" flexDirection="row">
151+
<Box
152+
mt={0}
153+
mr={0}
154+
display="flex"
155+
flexDirection="row"
156+
flexWrap="wrap"
157+
style={{ width: '102%' }}
158+
>
149159
{course.tags.slice(0, 3).map((tag, index) => (
150-
<Container
151-
style={{
152-
margin: '0px 8px 18px 0px',
153-
padding: '4px 8px',
154-
border: '1px solid',
155-
borderColor: '#A6A6A6',
156-
borderRadius: '5px'
157-
}}
158-
variant="outlined"
159-
>
160+
<div className={classes.bottomCardContent} variant="outlined">
160161
<Typography
161162
style={{ color: '#a6a6a6', fontWeight: 500 }}
162163
variant="caption"
163164
noWrap={true}
164165
>
165166
{tag}
166167
</Typography>
167-
</Container>
168+
</div>
168169
))}
169170
</Box>
170171

src/components/Hero/HeroWithLogo.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,12 @@ function Hero({
7878
height="100%"
7979
className={clsx(classes.extraPadding)}
8080
>
81-
<Typography variant="h1" gutterBottom>
81+
<Typography
82+
align="left"
83+
variant="h1"
84+
gutterBottom
85+
style={{ width: '110%' }}
86+
>
8287
{title}
8388
</Typography>
8489
<Typography variant="h1"> {title2}</Typography>

src/components/Hero/HeroWithOneButton.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ function Hero({
5656
backgroundImage: `${backgroundImage}`,
5757
backgroundSize: 'cover',
5858
backgroundRepeat: 'no-repeat',
59-
backgroundPositionY: 'center'
59+
backgroundPositionY: 'center',
60+
backgroundPositionX: 'center'
6061
}}
6162
{...rest}
6263
>

src/layouts/MainLayout/TopBar/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ function TopBar({ className, onMobileNavOpen, ...rest }) {
109109
<div>
110110
<RouterLink
111111
to="/"
112+
onClick={toggleDrawer('right', false)}
112113
style={{ position: 'absolute', left: '20px', top: '3%' }}
113114
>
114115
<Logo className={classes.logo} />

src/views/pages/BlogsView/Blog/Blog.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ const useStyles = makeStyles(theme => ({
4545
},
4646
'& img': {
4747
width: '70%',
48-
margin: 'auto'
48+
margin: 'auto',
49+
[theme.breakpoints.down('sm')]: {
50+
width: '90%'
51+
}
4952
},
5053
'& ul,ol': {
5154
marginLeft: '50px',

src/views/pages/BlogsView/PublishBlog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const useStyles = makeStyles(theme => ({
1616
backgroundColor: '#fff',
1717
padding: theme.spacing(20, 10, 20),
1818
[theme.breakpoints.down('sm')]: {
19-
padding: theme.spacing(20, 5, 20)
19+
padding: theme.spacing(20, 3, 20)
2020
}
2121
},
2222
heading: {

src/views/pages/BlogsView/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import PublishBlog from './PublishBlog';
88

99
const useStyles = makeStyles(theme => ({
1010
root: {
11-
backgroundColor: '#f2f2f2'
11+
backgroundColor: '#f2f2f2',
12+
overflowX: 'hidden'
1213
},
1314
paddingTop: {
1415
padding: '50px auto 100px',

src/views/pages/CLView/Apply.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ function Apply({ className, ...rest }) {
5959
<div className={classes.main}>
6060
<Typography
6161
variant="h2"
62+
align="center"
6263
style={{
6364
marginBottom: '10px',
6465
fontWeight: 700

src/views/pages/CLView/Process.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React from 'react';
2-
import PropTypes from 'prop-types';
1+
import { Grid, makeStyles, Typography } from '@material-ui/core';
32
import clsx from 'clsx';
4-
import { Container, Grid, Typography, makeStyles } from '@material-ui/core';
3+
import PropTypes from 'prop-types';
4+
import React from 'react';
55
import ProcessSteppers from './ProcessSteppers';
66

77
const useStyles = makeStyles(theme => ({
@@ -23,12 +23,19 @@ const useStyles = makeStyles(theme => ({
2323
},
2424
stepper: {
2525
padding: '20px',
26-
[theme.breakpoints.down('md')]: {
27-
padding: 0,
26+
[theme.breakpoints.down('sm')]: {
27+
paddingLeft: 0,
28+
paddingRight: 0,
2829
'& .MuiStepper-root': {
29-
padding: '0px'
30+
padding: '20px 0px'
3031
}
3132
}
33+
},
34+
responsivePadding: {
35+
padding: '0px 16px',
36+
[theme.breakpoints.down('sm')]: {
37+
padding: 0
38+
}
3239
}
3340
}));
3441

@@ -37,7 +44,7 @@ function Process({ benefits, className, ...rest }) {
3744

3845
return (
3946
<div className={clsx(classes.root, className)} {...rest}>
40-
<Container maxWidth="lg">
47+
<div className={classes.responsivePadding}>
4148
<Typography
4249
style={{ marginTop: '10px' }}
4350
variant="h2"
@@ -49,7 +56,7 @@ function Process({ benefits, className, ...rest }) {
4956
<Grid container component="dl" className={classes.stepper}>
5057
<ProcessSteppers />
5158
</Grid>
52-
</Container>
59+
</div>
5360
</div>
5461
);
5562
}

0 commit comments

Comments
 (0)