Commit 03237255 authored by vignesh mohankumar's avatar vignesh mohankumar Committed by GitHub

fix: add padding to LoadingRow (#4931)

* fix: add padding to LoadingRow

* remove sortable on header
parent f6a7c856
...@@ -314,10 +314,8 @@ export const HEADER_DESCRIPTIONS: Record<TokenSortMethod, ReactNode | undefined> ...@@ -314,10 +314,8 @@ export const HEADER_DESCRIPTIONS: Record<TokenSortMethod, ReactNode | undefined>
/* Get singular header cell for header row */ /* Get singular header cell for header row */
function HeaderCell({ function HeaderCell({
category, category,
sortable,
}: { }: {
category: TokenSortMethod // TODO: change this to make it work for trans category: TokenSortMethod // TODO: change this to make it work for trans
sortable: boolean
}) { }) {
const theme = useTheme() const theme = useTheme()
const sortAscending = useAtomValue(sortAscendingAtom) const sortAscending = useAtomValue(sortAscendingAtom)
...@@ -390,17 +388,17 @@ export function HeaderRow() { ...@@ -390,17 +388,17 @@ export function HeaderRow() {
header={true} header={true}
listNumber="#" listNumber="#"
tokenInfo={<Trans>Token name</Trans>} tokenInfo={<Trans>Token name</Trans>}
price={<HeaderCell category={TokenSortMethod.PRICE} sortable />} price={<HeaderCell category={TokenSortMethod.PRICE} />}
percentChange={<HeaderCell category={TokenSortMethod.PERCENT_CHANGE} sortable />} percentChange={<HeaderCell category={TokenSortMethod.PERCENT_CHANGE} />}
tvl={<HeaderCell category={TokenSortMethod.TOTAL_VALUE_LOCKED} sortable />} tvl={<HeaderCell category={TokenSortMethod.TOTAL_VALUE_LOCKED} />}
volume={<HeaderCell category={TokenSortMethod.VOLUME} sortable />} volume={<HeaderCell category={TokenSortMethod.VOLUME} />}
sparkLine={null} sparkLine={null}
/> />
) )
} }
/* Loading State: row component with loading bubbles */ /* Loading State: row component with loading bubbles */
export function LoadingRow() { export function LoadingRow(props: { first?: boolean; last?: boolean }) {
return ( return (
<TokenRow <TokenRow
header={false} header={false}
...@@ -417,6 +415,7 @@ export function LoadingRow() { ...@@ -417,6 +415,7 @@ export function LoadingRow() {
tvl={<LoadingBubble />} tvl={<LoadingBubble />}
volume={<LoadingBubble />} volume={<LoadingBubble />}
sparkLine={<SparkLineLoadingBubble />} sparkLine={<SparkLineLoadingBubble />}
{...props}
/> />
) )
} }
......
...@@ -58,12 +58,12 @@ const LoadingRowsWrapper = styled.div` ...@@ -58,12 +58,12 @@ const LoadingRowsWrapper = styled.div`
margin-top: 8px; margin-top: 8px;
` `
const LoadingRows = (rowCount?: number) => ( const LoadingRows = (rowCount: number = PAGE_SIZE) => (
<LoadingRowsWrapper> <LoadingRowsWrapper>
{Array(rowCount ?? PAGE_SIZE) {Array(rowCount)
.fill(null) .fill(null)
.map((_, index) => { .map((_, index) => {
return <LoadingRow key={index} /> return <LoadingRow key={index} first={index === 0} last={index === rowCount - 1} />
})} })}
</LoadingRowsWrapper> </LoadingRowsWrapper>
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment