Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
62 changes: 31 additions & 31 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,37 @@ import FAQPage from 'components/FAQPage';
const App = () => {
return (
<HashRouter>
<Switch>
<Route exact path="/">
<div className="landing-body-container">
<div className="app-shell">
<LandingPageHeader />
<LandingPage />
<LandingPageFooter />
</div>
</div>
</Route>
<Route exact path="/exchange">
<div className="exchange-body-container">
<div className="app-shell">
<Web3ReactManager>
<NavBarContainer />
<ExchangeContainer />
<FooterContainer />
</Web3ReactManager>
</div>
</div>
</Route>
<Route exact path="/faq">
<div className="landing-body-container">
<div className="app-shell">
<LandingPageHeader />
<FAQPage/>
<LandingPageFooter />
</div>
</div>
</Route>
</Switch>
<Switch>
<Route exact path="/">
<div className="landing-body-container">
<div className="app-shell">
<LandingPageHeader />
<LandingPage />
<LandingPageFooter />
</div>
</div>
</Route>
<Route exact path="/exchange">
<div className="exchange-body-container">
<div className="app-shell">
<Web3ReactManager>
<NavBarContainer />
<ExchangeContainer />
<FooterContainer />
</Web3ReactManager>
</div>
</div>
</Route>
<Route exact path="/faq">
<div className="landing-body-container">
<div className="app-shell">
<LandingPageHeader />
<FAQPage/>
<LandingPageFooter />
</div>
</div>
</Route>
</Switch>
</HashRouter>
);
};
Expand Down
3 changes: 3 additions & 0 deletions src/assets/images/bolt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 44 additions & 18 deletions src/components/BondingCurveChart/BondingCurveChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,23 @@ const ChartPanelWrapper = styled.div`
background-color: white;
border: 1px solid var(--medium-gray);
border-radius: 4px;
display: flex;
justify-content: center;
flex-direction: column;

.loader {
text-align: center;
font-family: Roboto;
font-style: normal;
font-weight: 500;
font-size: 15px;
line-height: 18px;
color: #BDBDBD;

img {
margin-bottom: 10px;
}
}
`;

const ChartHeaderWrapper = styled.div`
Expand Down Expand Up @@ -106,7 +123,6 @@ const BondingCurveChart = observer((totalSupplyWithoutPremint:BigNumber) => {
currentSellPrice: BigNumber,
kickstarterPrice: BigNumber;


const activeDATAddress = configStore.getDXDTokenAddress();
const staticParamsLoaded = datStore.areAllStaticParamsLoaded(
activeDATAddress
Expand Down Expand Up @@ -683,23 +699,33 @@ const BondingCurveChart = observer((totalSupplyWithoutPremint:BigNumber) => {
);
};

return (
<ChartPanelWrapper>
{renderChartHeader()}
<ChartWrapper>
{requiredDataLoaded ? (
<Line
data={data}
options={options}
// width={1000}
// height={250}
/>
) : (
<React.Fragment />
)}
</ChartWrapper>
</ChartPanelWrapper>
);
if (requiredDataLoaded)
return (
<ChartPanelWrapper>
{renderChartHeader()}
<ChartWrapper>
{requiredDataLoaded ? (
<Line
data={data}
options={options}
// width={1000}
// height={250}
/>
) : (
<React.Fragment />
)}
</ChartWrapper>
</ChartPanelWrapper>
);
else return(
<ChartPanelWrapper>
<div className="loader">
<img src={require("../../assets/images/bolt.svg")} />
<br/>
Connect to view Price Chart
</div>
</ChartPanelWrapper>
)
});

export default BondingCurveChart;
144 changes: 87 additions & 57 deletions src/components/TradeHistory.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,29 @@ import { formatBalance, formatNumberValue } from '../utils/token';
const TradingHistoryWrapper = styled.div`
width: 100%;
background: white;
padding-bottom: 24px;
padding: 20px 0px;
border: 1px solid var(--medium-gray);
margin-top: 24px;
font-weight: 400;
border-radius: 4px;
display: flex;
justify-content: center;
flex-direction: column;

.loader {
text-align: center;
font-family: Roboto;
font-style: normal;
font-weight: 500;
font-size: 15px;
line-height: 18px;
color: #BDBDBD;
padding: 44px 0px;

img {
margin-bottom: 10px;
}
}
`;

const TradeHistoryTitle = styled.div`
Expand Down Expand Up @@ -84,62 +102,74 @@ const TradingHistory = observer(() => {
recentTrades = tradingStore.recentTrades;
}

return (
<TradingHistoryWrapper>
<TradeHistoryTitle>Trade History</TradeHistoryTitle>
<TableHeadersWrapper>
<TableHeader width="15.5%" className="align-left">
Type
</TableHeader>
<TableHeader width="15.5%">
Price {configStore.getCollateralType()}
</TableHeader>
<TableHeader>Amount DXD</TableHeader>
<TableHeader>
Total {configStore.getCollateralType()}
</TableHeader>
<TableHeader className="align-right">Time</TableHeader>
</TableHeadersWrapper>
<TableRowsWrapper>
{recentTrades.map((trade, i) =>
(trade && trade.type) ? (
<TableRow key={"tradeRow"+i}>
<TableCell
width="15.5%"
color={
trade.type === EventType.Buy
? 'var(--blue-text)'
: 'var(--red-text)'
}
align="left"
weight='500'
>
{trade.type}
</TableCell>
<TableCell width="15.5%">
{formatNumberValue(trade.price)}
</TableCell>
<TableCell>{formatBalance(trade.amount)}</TableCell>
<TableCell>
{trade.totalPaid
? formatBalance(trade.totalPaid)
: formatBalance(trade.totalReceived)}
</TableCell>
<TableCell>
<a
href={trade.hash}
target="#"
className="turquois-text"
>
{trade.blockTime}
</a>
</TableCell>
</TableRow>)
: (<div/>)
)}
</TableRowsWrapper>
</TradingHistoryWrapper>
);
if (recentTrades.length == 0) {
return (
<TradingHistoryWrapper>
<div className="loader">
<img src={require("../assets/images/bolt.svg")} />
<br/>
Connect to view Trade History
</div>
</TradingHistoryWrapper>
)
} else {
return (
<TradingHistoryWrapper>
<TradeHistoryTitle>Trade History</TradeHistoryTitle>
<TableHeadersWrapper>
<TableHeader width="15.5%" className="align-left">
Type
</TableHeader>
<TableHeader width="15.5%">
Price {configStore.getCollateralType()}
</TableHeader>
<TableHeader>Amount DXD</TableHeader>
<TableHeader>
Total {configStore.getCollateralType()}
</TableHeader>
<TableHeader className="align-right">Time</TableHeader>
</TableHeadersWrapper>
<TableRowsWrapper>
{recentTrades.map((trade, i) =>
(trade && trade.type) ? (
<TableRow key={"tradeRow"+i}>
<TableCell
width="15.5%"
color={
trade.type === EventType.Buy
? 'var(--blue-text)'
: 'var(--red-text)'
}
align="left"
weight='500'
>
{trade.type}
</TableCell>
<TableCell width="15.5%">
{formatNumberValue(trade.price)}
</TableCell>
<TableCell>{formatBalance(trade.amount)}</TableCell>
<TableCell>
{trade.totalPaid
? formatBalance(trade.totalPaid)
: formatBalance(trade.totalReceived)}
</TableCell>
<TableCell>
<a
href={trade.hash}
target="#"
className="turquois-text"
>
{trade.blockTime}
</a>
</TableCell>
</TableRow>)
: (<div/>)
)}
</TableRowsWrapper>
</TradingHistoryWrapper>
);
}
});

export default TradingHistory;
2 changes: 1 addition & 1 deletion src/components/WalletModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ const WalletModal = observer(
</HeaderRow>
) : (
<HeaderRow>
<HoverText>Connect To A Wallet</HoverText>
<HoverText>Connect to a wallet</HoverText>
</HeaderRow>
)}
<ContentWrapper>
Expand Down
10 changes: 3 additions & 7 deletions src/components/Web3ConnectStatus/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,12 @@ const Web3ConnectStatus = observer((props) => {
connector,
error,
} = providerStore.getActiveWeb3React();

if (!chainId) {
throw new Error('No chain ID specified');
}


let pending = undefined;
let confirmed = undefined;
let hasPendingTransactions = false;

if (account && isChainIdSupported(chainId)) {
if (chainId && account && isChainIdSupported(chainId)) {
pending = transactionStore.getPendingTransactions(account);
confirmed = transactionStore.getConfirmedTransactions(account);
hasPendingTransactions = !!pending.length;
Expand All @@ -124,7 +120,7 @@ const Web3ConnectStatus = observer((props) => {
error,
});
// Wrong network
if (account && !isChainIdSupported(chainId)) {
if (account && chainId && !isChainIdSupported(chainId)) {
return (
<WrongNetworkButton onClick={toggleWalletModal}>
Wrong Network
Expand Down
Loading