Skip to content

Commit d481b3f

Browse files
Linda Penglpatmo
Linda Peng
authored andcommitted
Pull out sidebar and main sections
1 parent 6bb81d6 commit d481b3f

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

src/pages/Profile/index.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import Grid from '@material-ui/core/Grid';
33
import { useAuth } from '../../components/Auth/AuthContext';
4-
import PersonalMenu from '../pageSections/Sidebar/PersonalMenu';
4+
import { Sidebar, Main } from '../pageSections';
55

66
function Profile() {
77
const { authTokens } = useAuth();
@@ -10,13 +10,11 @@ function Profile() {
1010

1111
return (
1212
<Grid container spacing={1}>
13-
<Grid item lg={3}>
14-
<PersonalMenu />
15-
</Grid>
16-
<Grid item lg={9}>
13+
<Sidebar />
14+
<Main>
1715
<h2>Profile</h2>
1816
<p>Welcome {authTokens.username}!</p>
19-
</Grid>
17+
</Main>
2018
</Grid>
2119
);
2220
}

src/pages/Resources/Resources.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
22
import PropTypes from 'prop-types';
33
import { useQuery } from 'react-query';
44
import Search from '../../components/Search';
5-
import PersonalMenu from '../pageSections/Sidebar/PersonalMenu';
5+
import { Sidebar, Main } from '../pageSections';
66
import { Grid, Typography } from '@material-ui/core';
77
import { ResourceCard } from './ResourceCard';
88
import { getResources } from '../../utils/queries';
@@ -47,10 +47,8 @@ function Resources() {
4747

4848
return (
4949
<Grid container spacing={1}>
50-
<Grid item lg={3}>
51-
<PersonalMenu />
52-
</Grid>
53-
<Grid item lg={9}>
50+
<Sidebar />
51+
<Main>
5452
<h2>Resources</h2>
5553
<Search label="Search resources" search={search} />
5654
{searchValue && (
@@ -62,7 +60,7 @@ function Resources() {
6260
<br />
6361
{error && <div className="errorMessage">{error}</div>}
6462
{results && renderResults()}
65-
</Grid>
63+
</Main>
6664
</Grid>
6765
);
6866
}

src/pages/pageSections/Footer/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22

3-
export default function Footer() {
3+
function Footer() {
44
return (
55
<footer>
66
<hr />
@@ -10,3 +10,5 @@ export default function Footer() {
1010
</footer>
1111
);
1212
}
13+
14+
export default Footer;

0 commit comments

Comments
 (0)