Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CryptoMetrics_L02_GRP15
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
L02_GRP15
CryptoMetrics_L02_GRP15
Commits
d094ec5a
Commit
d094ec5a
authored
3 years ago
by
Aggarwal Himanshu
Browse files
Options
Downloads
Patches
Plain Diff
Update index page to use Tabs
parent
0ae275b2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cryptometrics/pages/index.js
+24
-5
24 additions, 5 deletions
src/cryptometrics/pages/index.js
with
24 additions
and
5 deletions
src/cryptometrics/pages/index.js
+
24
−
5
View file @
d094ec5a
...
...
@@ -9,9 +9,11 @@ import { useCryptoList } from "../queries";
import
numeral
from
"
numeral
"
;
import
Wrapper
from
"
../components/content/Wrapper
"
;
import
Sidebar
from
"
../components/sidebar/Sidebar
"
;
import
{
Tabs
,
Tab
}
from
"
../components/tabs/Tab
"
;
import
{
CollectionIcon
,
TableIcon
}
from
"
@heroicons/react/outline
"
;
export
default
function
Home
()
{
const
listOfCoins
=
useCryptoList
(
"
usd
"
,
5
,
false
);
const
listOfCoins
=
useCryptoList
(
"
usd
"
,
21
,
false
);
const
filteredCoins
=
listOfCoins
.
data
?.
map
((
coin
)
=>
{
return
(
<
CryptoChartCard
...
...
@@ -20,7 +22,7 @@ export default function Home() {
currencyName
=
{
coin
.
name
}
symbol
=
{
coin
.
symbol
.
toUpperCase
()}
icon
=
{
coin
.
image
}
info
=
{
"
$
"
+
numeral
(
coin
.
current_price
).
format
(
"
0,0.[00]
"
)}
info
=
{
"
$
"
+
numeral
(
coin
.
current_price
).
format
(
"
0,0.[00
00000
]
"
)}
detail
=
{
numeral
(
coin
.
price_change_percentage_24h
).
format
(
"
+0.0[00]
"
)
+
"
%
"
}
...
...
@@ -56,9 +58,26 @@ export default function Home() {
<
SearchInput
/>
<
/div
>
<
div
className
=
"
flex flex-wrap gap-x-10 gap-y-10 mt-10
"
>
{
!
listOfCoins
.
isLoading
&&
filteredCoins
}
<
/div
>
{
/* Main Content */
}
<
Tabs
>
<
Tab
id
=
"
card-view
"
content
=
{
<
CollectionIcon
className
=
"
w-6 h-6 dark:text-white
"
/>
}
>
<
div
className
=
"
flex flex-wrap gap-x-10 gap-y-10 mt-3
"
>
{
!
listOfCoins
.
isLoading
&&
filteredCoins
}
<
/div
>
<
/Tab
>
<
Tab
id
=
"
list-view
"
content
=
{
<
TableIcon
className
=
"
w-6 h-6 dark:text-white
"
/>
}
>
{
/* TODO: Add Table Component Here */
}
<
div
className
=
"
flex flex-wrap gap-x-10 gap-y-10 mt-3
"
>
<
h1
className
=
"
dark:text-white
"
>
TABLE
<
/h1
>
<
/div
>
<
/Tab
>
<
/Tabs
>
<
/Container
>
<
/Main
>
<
/Wrapper
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment