Skip to content

Commit 07e97a5

Browse files
committed
Merge branch 'develop' into preview
2 parents 37682fc + af450a4 commit 07e97a5

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

app/[server]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ const Overview = () => {
158158
</div>
159159
)}
160160
</div>
161-
{/* <div
161+
<div
162162
className={clsx("grid grid-cols-1 mx-auto gap-4", {
163163
"md:grid-cols-2": stakingPools.length >= 2,
164164
"lg:grid-cols-3": stakingPools.length >= 3,
@@ -173,7 +173,7 @@ const Overview = () => {
173173
{stakingPools.some((each) => each.type === "nft") && (
174174
<NFTCard hidden={isLoggedIn && !showInfo} />
175175
)}
176-
</div> */}
176+
</div>
177177
</div>
178178
<Footer />
179179
</div>

components/token-image.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import useSWR from "swr";
2+
import wretch from "wretch";
23
import Image from "next/image";
34

45
interface Props {
@@ -10,7 +11,10 @@ export const TokenImage = (props: Props) => {
1011
const { symbol = "", size = 20 } = props;
1112
const { data } = useSWR(
1213
`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),
1418
{
1519
revalidateIfStale: false,
1620
revalidateOnFocus: false,
@@ -21,7 +25,7 @@ export const TokenImage = (props: Props) => {
2125
return (
2226
<Image
2327
src={
24-
data?.data[0]?.emoji_url ||
28+
data?.[0]?.emoji_url ||
2529
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk8AEAAFIATgDK/mEAAAAASUVORK5CYII="
2630
}
2731
alt={symbol}

store/token-staking.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { create } from "zustand";
2+
import wretch from "wretch";
23

34
export interface Chain {
45
id?: number;
@@ -52,10 +53,11 @@ const initialState: State = {
5253
export const useTokenStaking = create<State & Action>((set, get) => ({
5354
...initialState,
5455
fetchStakingPools: async () => {
55-
const response = await fetch(
56+
const res = await wretch(
5657
"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 || [] });
6062
},
6163
}));

0 commit comments

Comments
 (0)