Skip to content

Commit d4f01dd

Browse files
authored
Merge pull request #460 from rvsia/fixCssOnPhones
Fix styling issues on documentation
2 parents a3fba1d + 61c26c3 commit d4f01dd

File tree

3 files changed

+25
-26
lines changed

3 files changed

+25
-26
lines changed

packages/react-renderer-demo/src/app/src/components/common/connected-links.js

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,30 @@
11
import React, { useContext } from 'react';
2-
import clsx from 'clsx';
32
import Grid from '@material-ui/core/Grid';
43
import Button from '@material-ui/core/Button';
54
import makeStyles from '@material-ui/styles/makeStyles';
65
import ChevronRight from '@material-ui/icons/ChevronRight';
76
import ChevronLeft from '@material-ui/icons/ChevronLeft';
87
import Link from 'next/link';
9-
import { useRouter } from 'next/router';
108

119
import MenuContext from '../navigation/menu-context';
1210

1311
const useStyles = makeStyles(() => ({
1412
linksContainer: {
1513
paddingLeft: 32,
16-
paddingRight: 64,
17-
marginTop: 16,
14+
paddingRight: 32,
15+
marginTop: 64,
1816
marginBottom: 16
1917
},
20-
withSideNav: {
21-
width: 'calc(100% - 240px)'
22-
},
2318
link: {
2419
textDecoration: 'none'
2520
}
2621
}));
2722

2823
const ConnectedLinks = () => {
2924
const { prev, next } = useContext(MenuContext);
30-
const { pathname } = useRouter();
3125
const classNames = useStyles();
3226
return (
33-
<Grid
34-
container
35-
justify="space-between"
36-
className={clsx(classNames.linksContainer, {
37-
[classNames.withSideNav]: pathname.includes('/renderer/')
38-
})}
39-
>
27+
<Grid container justify="space-between" className={classNames.linksContainer}>
4028
<Grid item>
4129
{prev && prev.link && (
4230
<Link href={`/${prev.link}`}>

packages/react-renderer-demo/src/app/src/components/footer.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import Paper from '@material-ui/core/Paper';
1313
import SvgIcon from '@material-ui/core/SvgIcon';
1414
import Typography from '@material-ui/core/Typography';
1515

16+
import grey from '@material-ui/core/colors/grey';
17+
1618
import GhIcon from './common/gh-svg-icon';
1719
import NpmSvgIcon from './common/npm-svg-icon';
1820
import TwitterIcon from './common/twitter-svg-icon';
@@ -42,7 +44,8 @@ const drawerWidth = 240;
4244

4345
const useStyles = makeStyles((theme) => ({
4446
footer: {
45-
marginTop: 64,
47+
//marginTop: 64,
48+
backgroundColor: grey[200],
4649
display: 'flex',
4750
justifyContent: 'space-between',
4851
flexWrap: 'wrap',
@@ -66,6 +69,9 @@ const useStyles = makeStyles((theme) => ({
6669
borderRadius: 2,
6770
display: 'flex'
6871
},
72+
foooterRight: {
73+
float: 'right'
74+
},
6975
listHeader: {
7076
display: 'flex',
7177
alignItems: 'center',
@@ -94,8 +100,8 @@ const Footer = ({ open }) => {
94100
</div>
95101
</Paper>
96102
</Grid>
97-
<Grid xs={12} md={4} item>
98-
<Paper elevation={0} className={classes.foooterCard}>
103+
<Grid xs={12} md={8} item>
104+
<Paper elevation={0} className={clsx(classes.foooterCard, classes.foooterRight)}>
99105
<List
100106
subheader={
101107
<ListSubheader className={classes.listHeader}>

packages/react-renderer-demo/src/app/src/components/layout.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,22 @@ export const drawerWidth = 240;
3131
const useStyles = makeStyles((theme) => ({
3232
mainGradient: {
3333
backgroundImage: 'linear-gradient(135deg, #41108E 0%, rgba(165, 37, 193, 1) 44.76%, #FC9957 100%)',
34-
backgroundSize: '100vw 100vh',
34+
backgroundSize: '100% 100vh',
3535
backgroundRepeat: 'no-repeat',
3636
transition: theme.transitions.create(['margin', 'width'], {
3737
easing: theme.transitions.easing.easeOut,
3838
duration: theme.transitions.duration.enteringScreen
3939
})
4040
},
4141
mainGradientShift: {
42-
width: `calc(100vw - ${drawerWidth}px)`,
4342
transition: theme.transitions.create(['margin', 'width'], {
4443
easing: theme.transitions.easing.sharp,
4544
duration: theme.transitions.duration.leavingScreen
4645
})
4746
},
4847
root: {
49-
display: 'flex'
48+
display: 'flex',
49+
minHeight: 'calc(100vh - 16px)'
5050
},
5151
appBar: {
5252
position: 'fixed',
@@ -56,8 +56,11 @@ const useStyles = makeStyles((theme) => ({
5656
})
5757
},
5858
contentWrapper: {
59-
paddingTop: 86,
60-
paddingBottom: 32
59+
display: 'flex',
60+
flexDirection: 'column',
61+
justifyContent: 'space-between',
62+
minHeight: '100%',
63+
paddingTop: 86
6164
},
6265
menuButton: {
6366
marginRight: theme.spacing(2)
@@ -101,7 +104,7 @@ const useStyles = makeStyles((theme) => ({
101104
right: 0,
102105
width: '100%',
103106
backgroundImage: 'linear-gradient(135deg, #41108E 0%, rgba(165, 37, 193, 1) 44.76%, #FC9957 100%)',
104-
backgroundSize: '100vw 100vh',
107+
backgroundSize: '100% 100vh',
105108
backgroundRepeat: 'no-repeat',
106109
zIndex: 900
107110
},
@@ -219,8 +222,10 @@ const Layout = ({ children }) => {
219222
>
220223
{children}
221224
</div>
222-
<ConnectedLinks />
223-
<Footer />
225+
<div>
226+
<ConnectedLinks />
227+
<Footer />
228+
</div>
224229
</div>
225230
</main>
226231
</div>

0 commit comments

Comments
 (0)