Skip to content

Commit

Permalink
feat: start with the responsive banner
Browse files Browse the repository at this point in the history
  • Loading branch information
icfor committed Mar 22, 2024
1 parent 076d9b0 commit 640ea4e
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions src/features/staking/components/staking-overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,21 @@ import {
formatToSmallDisplay,
formatXionToUSD,
} from "../lib/formatters";
import { DivisorVertical } from "./divisor";
import { DivisorHorizontal, DivisorVertical } from "./divisor";

const divisorStyle = "absolute bottom-[24px] right-[-8px] top-[24px]";
const columnStyle = "relative flex h-full flex-col items-start gap-3 p-[24px]";
const columnStyle =
"relative flex w-full h-full flex-col items-start gap-3 p-[24px]";

const Divisor = () => (
<>
<div className="absolute bottom-[24px] right-[-8px] top-[24px] hidden md:block">
<DivisorVertical />
</div>
<div className="w-full translate-y-[24px] md:hidden">
<DivisorHorizontal />
</div>
</>
);

const StakingOverview = () => {
const { isConnected } = useAbstraxionAccount();
Expand Down Expand Up @@ -75,9 +86,10 @@ const StakingOverview = () => {

return (
<div
className="grid min-h-[144px] flex-col items-center justify-center gap-[8px] overflow-auto"
className="flex min-h-[144px] flex-col items-center justify-center gap-[8px] overflow-auto md:grid"
style={{
backgroundImage: `url(${basePath}/overview-bg.png)`,
backgroundSize: "cover",
borderRadius: 24,
gridTemplateColumns: "1fr 1fr 1fr 1fr",
}}
Expand Down Expand Up @@ -109,16 +121,12 @@ const StakingOverview = () => {
)}
</div>
<BodyMedium>{formatXionToUSD(totalRewards)}</BodyMedium>
<div className={divisorStyle}>
<DivisorVertical />
</div>
<Divisor />
</div>
<div className={columnStyle}>
<Heading8>APR</Heading8>
<Heading2>{formatAPR(apr)}</Heading2>
<div className={divisorStyle}>
<DivisorVertical />
</div>
<Divisor />
</div>
<div className={columnStyle}>
<Heading8>Delegated Amount (XION)</Heading8>
Expand All @@ -129,9 +137,7 @@ const StakingOverview = () => {
)}
</Heading2>
<BodyMedium>{formatXionToUSD(totalDelegation)}</BodyMedium>
<div className={divisorStyle}>
<DivisorVertical />
</div>
<Divisor />
</div>
<div className={columnStyle}>
<Heading8>Available For Delegation (XION)</Heading8>
Expand Down

0 comments on commit 640ea4e

Please sign in to comment.