Added footer

This commit is contained in:
juan 2021-03-12 18:43:50 -05:00
parent 227937ab46
commit 76c1e0b63f
8 changed files with 152 additions and 94 deletions

View File

@ -0,0 +1,4 @@
.footer {
text-align: left;
margin: 20px 0 20px 0;
}

View File

@ -0,0 +1,25 @@
import React from 'react';
import { GithubOutlined, TwitterOutlined } from '@ant-design/icons';
import { Link } from 'react-router-dom';
import { SecurityAuditButton } from '../SecurityAuditButton';
import { Button } from 'antd';
import './index.less';
export const Footer = () => {
return (
<div className={'footer'}>
<SecurityAuditButton />
<Button
shape={'circle'}
icon={<GithubOutlined />}
style={{ marginRight: '20px' }}
>
<Link to={'https://github.com/solana-labs/oyster'}></Link>
</Button>
<Button shape={'circle'} icon={<TwitterOutlined />}>
<Link to={'https://twitter.com/solana'}></Link>
</Button>
</div>
);
};

View File

@ -10,6 +10,8 @@ import { contexts, AppBar, shortenAddress, useWallet } from '@oyster/common';
import Wormhole from '../Wormhole';
import { useEthereum } from '../../contexts';
import { useCorrectNetwork } from '../../hooks/useCorrectNetwork';
import { SecurityAuditButton } from '../SecurityAuditButton';
import { Footer } from '../Footer';
const { Header, Content } = Layout;
const { useConnectionConfig } = contexts.Connection;
@ -30,51 +32,55 @@ export const AppLayout = React.memo((props: any) => {
[...Object.keys(paths)].find(key => location.pathname.startsWith(key)) ||
'';
return (
<div className={`App`}>
<Wormhole
onCreated={() => setWormholeReady(true)}
show={true}
rotate={isRoot}
>
<Layout title={LABELS.APP_TITLE}>
{isRoot && (
<Header className="App-Bar">
<div className="app-title">
<Link to="/">
<h2>WORMHOLE</h2>
</Link>
</div>
<AppBar
useWalletBadge={true}
left={
<>
{accounts[0] && (
<div style={{ marginRight: 8 }}>
{hasCorrespondingNetworks ? (
<>
<img
alt={'metamask-icon'}
width={20}
height={20}
src={metamaskIcon}
/>
{shortenAddress(accounts[0], 4)}
</>
) : (
<Button danger type={'primary'}>
WRONG NETWORK
</Button>
)}
</div>
)}
</>
}
/>
</Header>
)}
<Content style={{ padding: '0 50px' }}>{props.children}</Content>
</Layout>
</Wormhole>
</div>
<>
<div className={`App`}>
<Wormhole
onCreated={() => setWormholeReady(true)}
show={true}
rotate={isRoot}
>
<Layout title={LABELS.APP_TITLE}>
{isRoot && (
<Header className="App-Bar">
<div className="app-title">
<Link to="/">
<h2>WORMHOLE</h2>
</Link>
</div>
<AppBar
useWalletBadge={true}
left={
<>
{accounts[0] && (
<div style={{ marginRight: 8 }}>
{hasCorrespondingNetworks ? (
<>
<img
alt={'metamask-icon'}
width={20}
height={20}
src={metamaskIcon}
/>
{shortenAddress(accounts[0], 4)}
</>
) : (
<Button danger type={'primary'}>
WRONG NETWORK
</Button>
)}
</div>
)}
</>
}
/>
</Header>
)}
<Content style={{ padding: '0 50px', flexDirection: 'column' }}>
{props.children}
</Content>
</Layout>
</Wormhole>
</div>
</>
);
});

View File

@ -0,0 +1,7 @@
.audit-button {
display: inline-block;
position: relative;
width: auto;
height: auto;
margin: 0 20px 0 20px;
}

View File

@ -0,0 +1,13 @@
import React from 'react';
import { Link } from 'react-router-dom';
import { Button } from 'antd';
import './index.less';
export const SecurityAuditButton = () => {
return (
<Button className={'audit-button'}>
<Link to={'https://github.com/certusone/wormhole'}>Security Audit</Link>
</Button>
);
};

View File

@ -1,19 +1,13 @@
import React, { useEffect, useState } from 'react';
import { notification, Spin, Button } from 'antd';
import {
contexts,
ConnectButton,
programIds,
formatAmount,
notify,
} from '@oyster/common';
import { Input } from './../Input';
import { contexts, ConnectButton, programIds, notify } from '@oyster/common';
import { Input } from '../Input';
import './style.less';
import { ASSET_CHAIN, chainToName } from '../../utils/assets';
import { ProgressUpdate, toSolana, TransferRequest } from '../../models/bridge';
import { useEthereum } from '../../contexts';
import { TokenDisplay } from './../TokenDisplay';
import { TokenDisplay } from '../TokenDisplay';
import { WrappedAssetFactory } from '../../contracts/WrappedAssetFactory';
import { WormholeFactory } from '../../contracts/WormholeFactory';
import BN from 'bn.js';

View File

@ -7,6 +7,7 @@ import { Link } from 'react-router-dom';
import { useWormholeAccounts } from '../../hooks/useWormholeAccounts';
import { TokenDisplay } from '../../components/TokenDisplay';
import { toChainSymbol } from '../../contexts/chainPair';
import { Footer } from '../../components/Footer';
export const HomeView = () => {
const {
@ -108,35 +109,38 @@ export const HomeView = () => {
];
return (
<div className="flexColumn">
<Row
gutter={GUTTER}
justify="center"
align="middle"
className="home-info-row"
>
<Col xs={24} xl={12} className="app-title">
<h1>Wormhole</h1>
<h2>
<span>Ethereum + Solana Bridge</span>
</h2>
<Link to="/move">
<Button className="app-action">Get Started</Button>
</Link>
</Col>
<Col xs={24} xl={12}>
<Statistic
className="home-statistic"
title={`$${formatNumber.format(totalInUSD)}`}
value="TOTAL VALUE LOCKED"
/>
</Col>
</Row>
<Table
dataSource={externalAssets.filter(a => a.name)}
columns={columns}
loading={loadingLockedAccounts}
/>
</div>
<>
<div className="flexColumn" style={{ minHeight: '93vh' }}>
<Row
gutter={GUTTER}
justify="center"
align="middle"
className="home-info-row"
>
<Col xs={24} xl={12} className="app-title">
<h1>Wormhole</h1>
<h2>
<span>Ethereum + Solana Bridge</span>
</h2>
<Link to="/move">
<Button className="app-action">Get Started</Button>
</Link>
</Col>
<Col xs={24} xl={12}>
<Statistic
className="home-statistic"
title={`$${formatNumber.format(totalInUSD)}`}
value="TOTAL VALUE LOCKED"
/>
</Col>
</Row>
<Table
dataSource={externalAssets.filter(a => a.name)}
columns={columns}
loading={loadingLockedAccounts}
/>
</div>
<Footer />
</>
);
};

View File

@ -1,17 +1,22 @@
import React from 'react';
import { Card } from 'antd';
import { Transfer } from '../../components/Transfer';
import { Footer } from '../../components/Footer';
export const TransferView = () => {
return (
<div className="flexColumn" style={{ flex: 1 }}>
<Card
className="bridge-card"
headStyle={{ padding: 0 }}
bodyStyle={{ position: 'relative' }}
>
<Transfer />
</Card>
</div>
<>
<div className="flexColumn" style={{ flex: 1, minHeight: '90vh' }}>
<Card
className="bridge-card"
headStyle={{ padding: 0 }}
bodyStyle={{ position: 'relative' }}
>
<Transfer />
</Card>
</div>
<Footer />
</>
);
};