Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

9 available pools table #15

Merged
merged 71 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
465e394
add mock data #7
pixelPepe Oct 10, 2023
e88a906
add profit field profit #7
pixelPepe Oct 10, 2023
6fc59a8
forge install: safe-contracts
utgarda Oct 10, 2023
e6456a0
forge install: openzeppelin
utgarda Oct 10, 2023
7b044fc
Inherit oz vault erc-4626 #10
utgarda Oct 10, 2023
8cd1bfd
add default paths to configs #9
pixelPepe Oct 11, 2023
40950dd
add table component #9
pixelPepe Oct 11, 2023
01fa1df
add pools page #9
pixelPepe Oct 11, 2023
b85c6a7
add imports #9
pixelPepe Oct 11, 2023
33e965e
add react router #9
pixelPepe Oct 11, 2023
c01970b
add root page #9
pixelPepe Oct 11, 2023
1ed1bf1
remove App.css #9
pixelPepe Oct 11, 2023
1e5c3de
add imports
pixelPepe Oct 12, 2023
c8c6c9b
add dateCell
pixelPepe Oct 12, 2023
26d9f06
fix ts error
pixelPepe Oct 12, 2023
da40ff9
fix indent
pixelPepe Oct 12, 2023
23d3d1d
fix eslint errors
pixelPepe Oct 12, 2023
a64b466
add utils to path
pixelPepe Oct 12, 2023
832bd34
add utils
pixelPepe Oct 12, 2023
e6ee83a
add imports
pixelPepe Oct 12, 2023
0dd7088
add date to dateCell
pixelPepe Oct 12, 2023
e4722ba
add cellDate to table
pixelPepe Oct 12, 2023
137a1e4
change root page
pixelPepe Oct 12, 2023
261e8be
temp type fix
pixelPepe Oct 12, 2023
0f25aba
add safeguard test (doesn't work yet)
silvesterdrago Oct 12, 2023
3595ac5
add logo #9
pixelPepe Oct 13, 2023
05d02f1
add icons to path #9
pixelPepe Oct 13, 2023
6308110
add imports #9
pixelPepe Oct 13, 2023
e3cc74f
add pagination layout #9
pixelPepe Oct 13, 2023
381fa66
add header #9
pixelPepe Oct 13, 2023
ecc8313
icon styles #9
pixelPepe Oct 13, 2023
1f2c47d
improve table page styles and change mock data #9
pixelPepe Oct 13, 2023
252f2f9
default app styles #9
pixelPepe Oct 13, 2023
31a09af
fix imports #9
pixelPepe Oct 13, 2023
27d8a20
fix import #9
pixelPepe Oct 13, 2023
a4a7080
fix imports #9
pixelPepe Oct 13, 2023
e0bd53e
fix imports #9
pixelPepe Oct 13, 2023
e74d2bd
fix imports #9
pixelPepe Oct 13, 2023
eed9c1f
fix logo path
pixelPepe Oct 13, 2023
9d549a1
change logo path #9
pixelPepe Oct 14, 2023
fe77c8a
plantuml
silvesterdrago Oct 14, 2023
d1f9406
IProfitPalsVault.sol #1
utgarda Oct 14, 2023
f55844d
ProfitPalsVaultDeploy
silvesterdrago Oct 14, 2023
71940bd
ProfitPalsVaultFactory sketch #10
utgarda Oct 14, 2023
e637f0c
ProfitPalsVaultFactory sketch: fix ProfitPalsVaultDeploy.s.sol #10
utgarda Oct 14, 2023
aac44b8
Add CreateSa
silvesterdrago Oct 14, 2023
fe9e5d4
ProfitPalsVaultFactory sketch: TODO predict proxy address to set guar…
utgarda Oct 14, 2023
528d69a
Merge remote-tracking branch 'origin' into 9-available-pools-table
pixelPepe Oct 15, 2023
ba3ad74
add colors, remove pagination #9
pixelPepe Oct 15, 2023
43a2966
cleanup #9
pixelPepe Oct 15, 2023
37d172a
cleanup
pixelPepe Oct 15, 2023
79c02a0
Merge remote-tracking branch 'origin/10-erc4626' into 10-erc4626
silvesterdrago Oct 15, 2023
3e9dd94
add allowedTokensCount param
silvesterdrago Oct 15, 2023
1067eb8
change wagmi config
pixelPepe Oct 15, 2023
8662d5a
add read contract
pixelPepe Oct 15, 2023
c0638e8
Merge branch '10-erc4626' into 9-available-pools-table
pixelPepe Oct 15, 2023
81e2318
add publicClientViem #9
pixelPepe Oct 16, 2023
c6ce96a
remove base #9
pixelPepe Oct 16, 2023
365a0f8
remove favicon #9
pixelPepe Oct 16, 2023
d02e16c
remove unused route #9
pixelPepe Oct 16, 2023
d00c55a
get contract name #9
pixelPepe Oct 16, 2023
02a991c
get pool data
pixelPepe Oct 16, 2023
247d68f
show table data
pixelPepe Oct 16, 2023
392ada0
add abi
pixelPepe Oct 16, 2023
eb175d1
add axios
pixelPepe Oct 17, 2023
c24cb6c
new abi #9
pixelPepe Oct 17, 2023
2f79ae5
add contract address #9
pixelPepe Oct 17, 2023
9984dd7
hardcode cotract data #9
pixelPepe Oct 17, 2023
c8f3332
restore changes #9
pixelPepe Oct 17, 2023
3447e54
change hardcode data #9
pixelPepe Oct 17, 2023
7a3f70d
revert changes #9
pixelPepe Oct 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.env

# Logs
logs
*.log
Expand Down Expand Up @@ -35,6 +37,8 @@ out/
# Docs
docs/

broadcast/

# Dotenv file
.env

Expand Down
1 change: 0 additions & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
Expand Down
5 changes: 5 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@
"dependencies": {
"@rainbow-me/rainbowkit": "^1.1.1",
"@vitejs/plugin-react-refresh": "^1.3.6",
"axios": "^1.5.1",
"classnames": "^2.3.2",
"localforage": "^1.10.0",
"match-sorter": "^6.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.16.0",
"react-transition-group": "^4.4.5",
"sort-by": "^1.2.0",
"viem": "^1.15.4",
"wagmi": "^1.4.3"
},
Expand Down
Binary file added frontend/public/assets/Logo.avif
Binary file not shown.
1 change: 0 additions & 1 deletion frontend/public/vite.svg

This file was deleted.

27 changes: 11 additions & 16 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
import { PoolsPage } from 'Pages';
import './index.scss';
import '@rainbow-me/rainbowkit/styles.css';
import { ConnectButton } from '@rainbow-me/rainbowkit';
import VersionInfo from './components/versionInfo/VersionInfo';
import CreatePool from './components/createPool/CreatePool';

function App() {
const versionGitTag = import.meta.env.VITE_REACT_APP_GIT_TAG;
const gitDate = import.meta.env.VITE_REACT_APP_GIT_DATE;

console.log('VITE_REACT_APP_GIT_TAG - ', versionGitTag);
console.log('VITE_REACT_APP_GIT_DATE - ', gitDate);
const router = createBrowserRouter([
{
path: '/',
element: <PoolsPage poolsType={'All Pools'} />,
},
]);

return (
<div className='app'>
<ConnectButton />
<CreatePool />
{versionGitTag && gitDate && <VersionInfo version={versionGitTag} versionDate={gitDate} />}
</div>
);
function App() {
return <RouterProvider router={router} />;
}

export default App;
8 changes: 8 additions & 0 deletions frontend/src/components/dateCell/dateCell.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { FC } from 'react';
import { DateCellPropsI } from './dateCellProps';
import { dateFromTimestamp } from 'Utils/dateFromTimestamp';

export const DateCell: FC<DateCellPropsI> = ({ cellValue }) => {
const formattedDate = dateFromTimestamp(cellValue);
return <div>{formattedDate}</div>;
};
3 changes: 3 additions & 0 deletions frontend/src/components/dateCell/dateCellProps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface DateCellPropsI {
cellValue: number;
}
1 change: 1 addition & 0 deletions frontend/src/components/dateCell/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './dateCell';
29 changes: 29 additions & 0 deletions frontend/src/components/header/Header.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.header {
display: flex;
padding: 24px;
align-items: center;
align-self: stretch;
background: #1b1b1f;
box-shadow:
0px 1px 2px 0px rgba(0, 0, 0, 0.3),
0px 2px 6px 2px rgba(0, 0, 0, 0.15);
nav {
display: flex;
align-items: center;
gap: 10px;
margin-left: 96px;
margin-right: auto;
a {
padding: 8px;
border-radius: 4px;
background: var(--m-3-sys-dark-surface-container-high, #1b1b1f);
padding: 8px;
color: #c3c6cf;

&.active {
background-color: #292a2d;
color: #a3cddc;
}
}
}
}
23 changes: 23 additions & 0 deletions frontend/src/components/header/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { FC } from 'react';
import styles from './Header.module.scss';
import { Link, useLocation } from 'react-router-dom';
import { ConnectButton } from '@rainbow-me/rainbowkit';

export const Header: FC = () => {
const location = useLocation();
const currentPath = location.pathname;

return (
<header className={styles.header}>
<Link to={'/'}>
<img src='assets/Logo.avif' alt='' />
</Link>
<nav>
<Link className={currentPath === '/' ? styles.active : ''} to={'/'}>
Pools available
</Link>
</nav>
<ConnectButton />
</header>
);
};
1 change: 1 addition & 0 deletions frontend/src/components/header/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Header';
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.icon {
cursor: pointer;
&:hover {
path {
fill: #808080;
}
}
}
20 changes: 20 additions & 0 deletions frontend/src/components/icons/NavigateFirst/NavigateFirst.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { FC } from 'react';
import styles from './NavigateFirst.module.scss';

export const NavigateFirst: FC = () => {
return (
<svg
className={styles.icon}
xmlns='http://www.w3.org/2000/svg'
width='40'
height='40'
viewBox='0 0 40 40'
fill='none'
>
<path
d='M25.9998 15.4115L21.4098 20.0015L25.9998 24.5915L24.5898 26.0015L18.5898 20.0015L24.5898 14.0015L25.9998 15.4115ZM15.5898 14.0015H13.5898V26.0015H15.5898V14.0015Z'
fill='#43474E'
/>
</svg>
);
};
1 change: 1 addition & 0 deletions frontend/src/components/icons/NavigateFirst/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './NavigateFirst';
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.icon {
cursor: pointer;
&:hover {
path {
fill: #808080;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { FC } from 'react';
import styles from './NavigatePrevious.module.scss';

export const NavigatePrevious: FC = () => {
return (
<svg
className={styles.icon}
xmlns='http://www.w3.org/2000/svg'
width='40'
height='40'
viewBox='0 0 40 40'
fill='none'
>
<path
d='M22.5898 14.0015L23.9998 15.4115L19.4198 20.0015L23.9998 24.5915L22.5898 26.0015L16.5898 20.0015L22.5898 14.0015Z'
fill='#43474E'
/>
</svg>
);
};
1 change: 1 addition & 0 deletions frontend/src/components/icons/NavigatePrevious/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './NavigatePrevious';
2 changes: 2 additions & 0 deletions frontend/src/components/icons/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './NavigateFirst';
export * from './NavigatePrevious';
4 changes: 4 additions & 0 deletions frontend/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from 'Components/table';
export * from 'Components/pagination';
export * from 'Components/header';
export * from 'Components/dateCell';
29 changes: 29 additions & 0 deletions frontend/src/components/pagination/Pagination.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.pagination {
display: flex;
gap: 24px;
padding: 16px 20px;
justify-content: flex-end;
align-items: center;
.rowsCount {
display: flex;
gap: 8px;
align-items: center;
}
.pages {
display: flex;
gap: 4px;
align-items: center;
span {
font-size: 16px;
}
}
.icons {
display: flex;
gap: 24px;
align-items: center;

.rotateRight {
transform: rotate(180deg);
}
}
}
36 changes: 36 additions & 0 deletions frontend/src/components/pagination/Pagination.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { FC } from 'react';
import styles from './Pagination.module.scss';
import { PaginationPropsI } from './PaginationPropsI';
import { NavigateFirst, NavigatePrevious } from 'Components/icons';

export const Pagination: FC<PaginationPropsI> = () => {
return (
<div className={styles.pagination}>
<div className={styles.rowsCount}>
<span className={styles.dimmedText}>Rows per page:</span>
{/* todo: add drop down menu */}
<span
style={{ padding: '6px 30px 6px 12px ', backgroundColor: '#292a2d', borderRadius: '8px' }}
>
10
</span>
</div>
<div className={styles.pages}>
{/* todo: display current page and pages length */}
<span>1</span>
<span>of</span>
<span>1</span>
</div>
<div className={styles.icons}>
<NavigateFirst />
<NavigatePrevious />
<div className={styles.rotateRight}>
<NavigatePrevious />
</div>
<div className={styles.rotateRight}>
<NavigateFirst />
</div>
</div>
</div>
);
};
1 change: 1 addition & 0 deletions frontend/src/components/pagination/PaginationPropsI.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export interface PaginationPropsI {}
1 change: 1 addition & 0 deletions frontend/src/components/pagination/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Pagination';
80 changes: 80 additions & 0 deletions frontend/src/components/table/Table.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
@mixin dimmedText {
color: #c3c6cf;
font-family: Noto Sans;
font-size: 16px;
font-style: normal;
font-weight: 400;
line-height: 24px;
letter-spacing: 0.25px;
}

@mixin text {
color: #fff;
text-align: right;
font-family: Noto Sans;
font-size: 16px;
font-style: normal;
font-weight: 600;
line-height: 24px;
letter-spacing: 0.25px;
}

.tableContainer {
display: flex;
flex-direction: column;
padding: 0 24px;
width: 100%;
border-radius: 16px;
background: #1b1b1f;
box-shadow:
0px 1px 3px 0px rgba(0, 0, 0, 0.3),
0px 4px 8px 3px rgba(0, 0, 0, 0.15);
table {
width: 100%;
border-collapse: collapse;
border: none;

thead,
tbody {
padding: 24px;
}

thead {
tr {
border-bottom: 1px solid #a3cddc;
}
}
tbody {
tr:not(:last-child) {
border-bottom: 1px solid #43474e;
}
}

th {
border: none;
padding: 22px 8px 22px;
text-align: left;
@include dimmedText;
}
td {
border: none;
padding: 22px 8px;
@include dimmedText;
}

.center {
text-align: center;
}
.left {
text-align: left;
}
.right {
text-align: right;
}

.tableFooter {
display: flex;
width: 100%;
}
}
}
Loading