File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ const Overview = () => {
158
158
</ div >
159
159
) }
160
160
</ div >
161
- { /* <div
161
+ < div
162
162
className = { clsx ( "grid grid-cols-1 mx-auto gap-4" , {
163
163
"md:grid-cols-2" : stakingPools . length >= 2 ,
164
164
"lg:grid-cols-3" : stakingPools . length >= 3 ,
@@ -173,7 +173,7 @@ const Overview = () => {
173
173
{ stakingPools . some ( ( each ) => each . type === "nft" ) && (
174
174
< NFTCard hidden = { isLoggedIn && ! showInfo } />
175
175
) }
176
- </div> */ }
176
+ </ div >
177
177
</ div >
178
178
< Footer />
179
179
</ div >
Original file line number Diff line number Diff line change 1
1
import useSWR from "swr" ;
2
+ import wretch from "wretch" ;
2
3
import Image from "next/image" ;
3
4
4
5
interface Props {
@@ -10,7 +11,10 @@ export const TokenImage = (props: Props) => {
10
11
const { symbol = "" , size = 20 } = props ;
11
12
const { data } = useSWR (
12
13
`https://api-preview.mochi.console.so/api/v1/product-metadata/emoji?codes=${ symbol } ` ,
13
- ( url ) => fetch ( url ) . then ( ( res ) => res . json ( ) ) ,
14
+ ( url ) =>
15
+ wretch ( url )
16
+ . get ( )
17
+ . json ( ( res ) => res . data ) ,
14
18
{
15
19
revalidateIfStale : false ,
16
20
revalidateOnFocus : false ,
@@ -21,7 +25,7 @@ export const TokenImage = (props: Props) => {
21
25
return (
22
26
< Image
23
27
src = {
24
- data ?. data [ 0 ] ?. emoji_url ||
28
+ data ?. [ 0 ] ?. emoji_url ||
25
29
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk8AEAAFIATgDK/mEAAAAASUVORK5CYII="
26
30
}
27
31
alt = { symbol }
Original file line number Diff line number Diff line change 1
1
import { create } from "zustand" ;
2
+ import wretch from "wretch" ;
2
3
3
4
export interface Chain {
4
5
id ?: number ;
@@ -52,10 +53,11 @@ const initialState: State = {
52
53
export const useTokenStaking = create < State & Action > ( ( set , get ) => ( {
53
54
...initialState ,
54
55
fetchStakingPools : async ( ) => {
55
- const response = await fetch (
56
+ const res = await wretch (
56
57
"https://api-preview.tono.console.so/api/v1/guilds/462663954813157376/community/token/staking"
57
- ) ;
58
- const json = await response . json ( ) ;
59
- set ( { stakingPools : json ?. data ?. data || [ ] } ) ;
58
+ )
59
+ . get ( )
60
+ . json ( ( res ) => res ?. data ?. data ) ;
61
+ set ( { stakingPools : res || [ ] } ) ;
60
62
} ,
61
63
} ) ) ;
You can’t perform that action at this time.
0 commit comments