Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
03237255
Unverified
Commit
03237255
authored
Oct 20, 2022
by
vignesh mohankumar
Committed by
GitHub
Oct 20, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: add padding to LoadingRow (#4931)
* fix: add padding to LoadingRow * remove sortable on header
parent
f6a7c856
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
TokenRow.tsx
src/components/Tokens/TokenTable/TokenRow.tsx
+6
-7
TokenTable.tsx
src/components/Tokens/TokenTable/TokenTable.tsx
+3
-3
No files found.
src/components/Tokens/TokenTable/TokenRow.tsx
View file @
03237255
...
@@ -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}
/>
/>
)
)
}
}
...
...
src/components/Tokens/TokenTable/TokenTable.tsx
View file @
03237255
...
@@ -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
>
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment