Skip to content

Commit

Permalink
Merge pull request #147 from terraswap/revert-144-feat/classic-mainte…
Browse files Browse the repository at this point in the history
…nance

[classic] Revert "feat: dashboard maintenance"
  • Loading branch information
jbamlee authored Dec 8, 2022
2 parents 4e9ce02 + 444ade5 commit 584c259
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 100 deletions.
2 changes: 1 addition & 1 deletion src/layouts/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ const Sidebar = () => {
) : (
<div>
<NavLink
to="/dashboard"
to="/"
className={location.pathname?.includes("/pairs") ? "active" : ""}
onClick={() => close()}
>
Expand Down
107 changes: 9 additions & 98 deletions src/pages/Dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,56 +20,6 @@ import Summary from "./Summary"
import LatestBlock from "components/LatestBlock"
import Tooltip from "components/Tooltip"
import Loading from "components/Loading"
import Modal from "components/Modal"
import Button from "components/Button"

const ModalContent = styled.div`
width: 100%;
max-width: calc(100vw - 32px);
margin: 0 auto;
border-radius: 20px;
box-shadow: 0 0 40px 0 rgba(0, 0, 0, 0.35);
background-color: #fff;
padding: 30px 0px;
color: #5c5c5c;
& > div {
position: relative;
width: 100%;
height: auto;
max-height: 80vh;
overflow-y: auto;
padding: 0 30px;
font-size: 14px;
font-weight: normal;
font-stretch: normal;
font-style: normal;
line-height: 1.71;
letter-spacing: normal;
text-align: center;
color: #5c5c5c;
}
@media screen and (max-width: ${({ theme }) => theme.breakpoint}) {
padding: 30px 0px;
& > div {
padding: 0 16px;
}
}
`

const ModalTitle = styled.div`
display: block;
font-size: 20px;
font-weight: bold;
font-stretch: normal;
font-style: normal;
line-height: 1.35;
letter-spacing: normal;
text-align: center;
color: #0222ba;
margin-bottom: 30px;
`

const Wrapper = styled(container)`
width: 100%;
Expand Down Expand Up @@ -300,6 +250,7 @@ const Dashboard = () => {
</div>
</Row>
<div style={{ fontSize: 18, fontWeight: 700, marginBottom: 14 }}>
$
{formatMoney(
Number(
lookup(
Expand All @@ -310,7 +261,6 @@ const Dashboard = () => {
)
)
)}
&nbsp;UST
</div>
<Chart
type="line"
Expand Down Expand Up @@ -390,8 +340,8 @@ const Dashboard = () => {
/>
</div>
<div>
{token0Symbol}-{token1Symbol} /&nbsp;
{formatMoney(Number(lookup(volumeUst, UST)))} UST
{token0Symbol}-{token1Symbol} /&nbsp; $
{formatMoney(Number(lookup(volumeUst, UST)))}
</div>
</Link>
)
Expand Down Expand Up @@ -510,8 +460,8 @@ const Dashboard = () => {
/>
</div>
<div>
{token0Symbol}-{token1Symbol} /&nbsp;
{formatMoney(Number(lookup(liquidityUst, UST)))} UST
{token0Symbol}-{token1Symbol} /&nbsp; $
{formatMoney(Number(lookup(liquidityUst, UST)))}
</div>
</Link>
)
Expand Down Expand Up @@ -608,7 +558,7 @@ const Dashboard = () => {
width: 230,
Cell: ({ cell: { value } }: any) => (
<span>
{formatMoney(Number(lookup(`${value}`, UST)))} UST
${formatMoney(Number(lookup(`${value}`, UST)))}
</span>
),
},
Expand All @@ -624,7 +574,7 @@ const Dashboard = () => {
width: 230,
Cell: ({ cell: { value } }: any) => (
<span>
{formatMoney(Number(lookup(`${value}`, UST)))} UST
${formatMoney(Number(lookup(`${value}`, UST)))}
</span>
),
},
Expand All @@ -646,10 +596,10 @@ const Dashboard = () => {
const { volumeUst } = original
return (
<span>
$
{formatMoney(
Number(lookup(`${volumeUst * 0.003}`, UST))
)}{" "}
UST
)}
</span>
)
},
Expand Down Expand Up @@ -693,45 +643,6 @@ const Dashboard = () => {
/>
</LatestBlockWrapper>
</Container>
<Modal isOpen close={() => {}} open={() => {}}>
<ModalContent>
<div>
<ModalTitle>Under maintenance</ModalTitle>
<div style={{ marginBottom: 20 }}>
Terraswap classic dashboard is under maintenance due to the price
calculation update & historical data recollecting. Apologies for
any inconvenience.
<div
style={{
border: "1px solid #eeeeee",
borderRadius: 8,
padding: 10,
marginTop: 10,
fontWeight: 400,
textAlign: "left",
}}
>
<b>As-is:</b> Mixed (USTC-based & exchange_rate from Terra
Oracle)
<br />
<b>To-Be:</b> Unify to the Oracle base
</div>
</div>
<Button
size="lg"
onClick={() => window.location.replace("/")}
style={{
textTransform: "unset",
maxWidth: 235,
borderRadius: 10,
marginBottom: 4,
}}
>
Back
</Button>
</div>
</ModalContent>
</Modal>
</Wrapper>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Swap from "./pages/Swap"

export default () => (
<Routes>
<Route path="/dashboard" element={<Dashboard />} />
<Route index element={<Dashboard />} />
<Route path="/swap" element={<Swap />} />
<Route path="/pairs/:address" element={<PairPage />} />
<Route element={<Navigate to="/" replace />} />
Expand Down

0 comments on commit 584c259

Please sign in to comment.