Skip to content

Commit

Permalink
feat: create initial por page with mock function
Browse files Browse the repository at this point in the history
  • Loading branch information
rozanagy committed Mar 5, 2024
1 parent f002207 commit b81e8a8
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Route } from 'react-router-dom';

import { AppLayout } from '@components/app.layout';
import { ProofOfReserve } from '@components/proof-of-reserve/proof-of-reserve';
import { MyVaults } from '@pages/my-vaults/my-vaults';
import { BalanceContextProvider } from '@providers/balance-context-provider';

Expand All @@ -18,6 +19,7 @@ export function App(): React.JSX.Element {
<Route path="/" element={<Dashboard />} />
<Route path="/my-vaults" element={<MyVaults />} />
<Route path="/how-it-works" element={<About />} />
<Route path="/proof-of-reserve" element={<ProofOfReserve />} />
</AppLayout>
</BalanceContextProvider>
</VaultContextProvider>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { CustomCard } from '@components/how-it-works/components/custom-card';
import { HasChildren } from '@models/has-children';

export function ProofOfReserveLayout({ children }: HasChildren): React.JSX.Element {
return (
<CustomCard width={'800px'} height={'150px'} padding={'30px'}>
{children}
</CustomCard>
);
}
30 changes: 30 additions & 0 deletions src/app/components/proof-of-reserve/proof-of-reserve.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { useEffect, useState } from 'react';

import { Text, VStack } from '@chakra-ui/react';

import { ProofOfReserveLayout } from './components/proof-of-reserve-layout';

export function ProofOfReserve(): React.JSX.Element {
const [content, setContent] = useState('');

useEffect(() => {
fetch('http://localhost:8811/get-proof-of-reserve')
.then(response => response.json())
.then(data => {
setContent(data);
})
.catch(error => {
console.error('Error fetching data:', error);

Check warning on line 17 in src/app/components/proof-of-reserve/proof-of-reserve.tsx

View workflow job for this annotation

GitHub Actions / lint-eslint

Unexpected console statement
});
}, []);
return (
<ProofOfReserveLayout>
{
<VStack spacing={'10px'}>
<Text color={'white'}>BTC Reserve</Text>
<Text color={'white'}>{content}</Text>
</VStack>
}
</ProofOfReserveLayout>
);
}
10 changes: 10 additions & 0 deletions src/app/pages/proof-of-reserve/proof-of-reserve-page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { ProofOfReserve } from '@components/proof-of-reserve/proof-of-reserve';
import { PageLayout } from '@pages/components/page.layout';

export function About(): React.JSX.Element {
return (
<PageLayout>
<ProofOfReserve />
</PageLayout>
);
}

0 comments on commit b81e8a8

Please sign in to comment.