Skip to content

Conversation

@asaadam
Copy link
Contributor

@asaadam asaadam commented Jun 28, 2022

Refactor token pages

  • now token pages will render data based params on the url
  • refactor using store ( with zustand ) , so it reduces props drilling

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jun 28, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: dcea078
Status: ✅  Deploy successful!
Preview URL: https://d483924f.frontend-3mt.pages.dev
Branch Preview URL: https://refactor-refactormarketsandt.frontend-3mt.pages.dev

View logs

@asaadam asaadam marked this pull request as ready for review July 3, 2022 06:59
@asaadam asaadam requested review from math-marcellino and pyk July 3, 2022 07:00
Copy link
Contributor

@pyk pyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error in build:



14:00:01.457 | https://nextjs.org/telemetry
-- | --
14:00:01.457 |  
14:00:01.588 | info  - Checking validity of types...
14:00:10.414 | Failed to compile.
14:00:10.414 |  
14:00:10.414 | ./pages/[chains]/markets/[token].tsx:13:32
14:00:10.414 | Type error: Cannot find module '../../../modules/tokenPage/tokenContainer' or its corresponding type declarations.
14:00:10.415 |  
14:00:10.415 | �[0m �[90m 11 \| �[39m�[36mimport�[39m { useRouter } from �[32m"next/router"�[39m�[33m;�[39m�[0m
14:00:10.415 | �[0m �[90m 12 \| �[39m�[36mimport�[39m �[33mReact�[39m�[33m,�[39m { useEffect�[33m,�[39m useMemo } from �[32m"react"�[39m�[33m;�[39m�[0m
14:00:10.415 | �[0m�[31m�[1m>�[22m�[39m�[90m 13 \| �[39m�[36mimport�[39m { �[33mTokenContainer�[39m } from �[32m"../../../modules/tokenPage/tokenContainer"�[39m�[33m;�[39m�[0m
14:00:10.415 | �[0m �[90m    \| �[39m                               �[31m�[1m^�[22m�[39m�[0m
14:00:10.415 | �[0m �[90m 14 \| �[39m�[36mimport�[39m �[33mNavigation�[39m from �[32m"../../../components/v1/Navigation"�[39m�[33m;�[39m�[0m
14:00:10.415 | �[0m �[90m 15 \| �[39m�[36mimport�[39m { useTokenStore } from �[32m"../../../modules/tokenPage/store/tokenStore"�[39m�[33m;�[39m�[0m
14:00:10.415 | �[0m �[90m 16 \| �[39m�[0m
14:00:10.449 | Failed: build command exited with code: 1
14:00:11.639 | Failed: an internal error occurred


export function useLeveragedTokenNAV(req: LeveragedTokenNAVRequest) {
const { data, error } = useSWR<ethers.BigNumber, Error>(
export function useLeveragedTokenNAV(req: LeveragedTokenNAVRequest, options?: SWRConfiguration) {
const { data, error, mutate } = useSWR<ethers.BigNumber, Error>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we need mutate ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because i want to re-fetch data when error appears

balanceResponse.mutate();
};

useEffect(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we have multiples useEffect() ?

Copy link
Contributor Author

@asaadam asaadam Jul 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because it's specific usage.
this side effect will only run when dependencies changes value
because i think if you combine them , it may create unexpected re-render and side effect

@asaadam asaadam force-pushed the refactor/refactorMarketsAndTokenPages branch from 46f81e7 to dcea078 Compare July 3, 2022 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants