11import React from "react" ;
22import styled , { css } from "styled-components" ;
33
4+ import { landscapeStyle } from "styles/landscapeStyle" ;
5+ import { responsiveSize } from "styles/responsiveSize" ;
6+
47import { formatUnits } from "viem" ;
58
9+ import PnkIcon from "svgs/icons/pnk.svg" ;
610import LockerIcon from "svgs/icons/locker.svg" ;
711
812import { isUndefined } from "utils/index" ;
913
10- import { landscapeStyle } from "styles/landscapeStyle" ;
11- import { responsiveSize } from "styles/responsiveSize" ;
12-
1314import NumberDisplay from "components/NumberDisplay" ;
1415
1516const Container = styled . div `
@@ -28,48 +29,72 @@ const Container = styled.div`
2829 ) }
2930` ;
3031
31- const LockedPnk = styled . div `
32+ const StakedPnk = styled . div `
3233 display: flex;
33- flex-wrap: nowrap;
3434 gap: 8px;
35- justify-content: flex-start;
35+ align-items: center;
36+ ` ;
3637
37- ${ landscapeStyle (
38- ( ) => css `
39- align-self: center;
40- `
41- ) }
38+ const LockedPnk = styled . div `
39+ display: flex;
40+ gap: 8px;
41+ align-items: center;
4242` ;
4343
4444const StyledTitle = styled . h1 `
4545 margin-bottom: 0;
4646 font-size: ${ responsiveSize ( 20 , 24 ) } ;
4747` ;
4848
49+ const TotalStakeAndLockedPnk = styled . div `
50+ display: flex;
51+ flex-direction: row;
52+ gap: 12px 24px;
53+ flex-wrap: wrap;
54+ ` ;
55+
56+ const StyledPnkIcon = styled ( PnkIcon ) `
57+ fill: ${ ( { theme } ) => theme . secondaryPurple } ;
58+ width: 14px;
59+ ` ;
60+
4961const StyledLockerIcon = styled ( LockerIcon ) `
5062 fill: ${ ( { theme } ) => theme . secondaryPurple } ;
5163 width: 14px;
5264` ;
5365
5466interface IHeader {
55- lockedStake : bigint ;
67+ totalStake : string ;
68+ lockedStake : string ;
5669}
5770
58- const Header : React . FC < IHeader > = ( { lockedStake } ) => {
59- const formattedLockedStake = ! isUndefined ( lockedStake ) && formatUnits ( lockedStake , 18 ) ;
71+ const Header : React . FC < IHeader > = ( { totalStake, lockedStake } ) => {
72+ const formattedTotalStake = formatUnits ( BigInt ( totalStake ) , 18 ) ;
73+ const formattedLockedStake = formatUnits ( BigInt ( lockedStake ) , 18 ) ;
6074
6175 return (
6276 < Container >
6377 < StyledTitle > Stakes</ StyledTitle >
64- { ! isUndefined ( lockedStake ) ? (
65- < LockedPnk >
66- < StyledLockerIcon />
67- < label > Locked Stake: </ label >
68- < small >
69- < NumberDisplay value = { formattedLockedStake . toString ( ) } unit = "PNK" />
70- </ small >
71- </ LockedPnk >
72- ) : null }
78+ < TotalStakeAndLockedPnk >
79+ { ! isUndefined ( totalStake ) ? (
80+ < StakedPnk >
81+ < StyledPnkIcon />
82+ < label > Total Stake: </ label >
83+ < small >
84+ < NumberDisplay value = { formattedTotalStake } unit = "PNK" />
85+ </ small >
86+ </ StakedPnk >
87+ ) : null }
88+ { ! isUndefined ( lockedStake ) ? (
89+ < LockedPnk >
90+ < StyledLockerIcon />
91+ < label > Locked Stake: </ label >
92+ < small >
93+ < NumberDisplay value = { formattedLockedStake } unit = "PNK" />
94+ </ small >
95+ </ LockedPnk >
96+ ) : null }
97+ </ TotalStakeAndLockedPnk >
7398 </ Container >
7499 ) ;
75100} ;
0 commit comments