Skip to content

Commit eb5ebb6

Browse files
authored
Merge pull request #8 from OnGridSystems/integrate-graphql
feat: add react router, create transactions page
2 parents 2533662 + d174fdd commit eb5ebb6

File tree

11 files changed

+325
-78
lines changed

11 files changed

+325
-78
lines changed

app/package-lock.json

Lines changed: 185 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6+
"@apollo/client": "^3.7.10",
67
"@emotion/react": "^11.10.6",
78
"@emotion/styled": "^11.10.6",
89
"@mui/icons-material": "^5.11.11",
@@ -11,6 +12,7 @@
1112
"@testing-library/jest-dom": "^5.16.5",
1213
"@testing-library/react": "^13.4.0",
1314
"@testing-library/user-event": "^13.5.0",
15+
"graphql": "^16.6.0",
1416
"ethers": "^5.7.2",
1517
"react": "^18.2.0",
1618
"react-dom": "^18.2.0",

app/src/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function App() {
3636
/>
3737
}
3838
/>
39-
<Route path='/transactions/:page' element={<Transactions />} />
39+
<Route path='/transactions' element={<Transactions />} />
4040
</Routes>
4141
</Container>
4242
<Footer />

app/src/components/Footer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const Footer = () => {
1010
maxWidth='100vw'
1111
height='80px'
1212
bgcolor='white'>
13-
<img src='img/Ongrid.svg' alt='ongrid'></img>
13+
<img src='/img/Ongrid.svg' alt='ongrid'></img>
1414
</Box>
1515
);
1616
};

app/src/components/LoadMore.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Box } from '@mui/material';
2+
import { MuiButton } from './Web3Status';
3+
4+
const LoadMore = ({ onLoadMore }) => {
5+
return (
6+
<Box mt={3} justifyContent='center' width='100%' display='flex'>
7+
<MuiButton onClick={onLoadMore} size='small' sx={{ height: '24px' }}>
8+
Load more
9+
</MuiButton>
10+
</Box>
11+
);
12+
};
13+
14+
export default LoadMore;

app/src/components/PagesLink.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import styled from '@emotion/styled';
22
import { Box } from '@mui/material';
3-
import { Link } from 'react-router-dom';
3+
import { Link, useLocation } from 'react-router-dom';
44

55
const PageLink = styled(Link)`
66
text-decoration: none;
@@ -13,15 +13,26 @@ const PageLink = styled(Link)`
1313
font-size: 16px;
1414
line-height: 19px;
1515
&:hover {
16-
border-bottom: 4px solid #68A8FF;
16+
border-bottom: 4px solid #68a8ff;
1717
}
1818
`;
1919

2020
const PagesLink = () => {
21+
const { pathname } = useLocation();
2122
return (
2223
<Box gap='40px' display='flex' height='100%' alignItems='center'>
23-
<PageLink to='/'>Marketplace</PageLink>
24-
<PageLink to='/transactions/1'>Transactions</PageLink>
24+
<PageLink
25+
to='/'
26+
style={{ borderBottom: pathname === '/' ? ' 4px solid #68a8ff' : '' }}>
27+
Marketplace
28+
</PageLink>
29+
<PageLink
30+
to='/transactions'
31+
style={{
32+
borderBottom: pathname === 'transactions' ? ' 4px solid #68a8ff' : '',
33+
}}>
34+
Transactions
35+
</PageLink>
2536
</Box>
2637
);
2738
};

app/src/components/Pagination.js

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)