Skip to content

Commit

Permalink
refactor: remove unused code and extract function
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Jan 9, 2024
1 parent 2f607f5 commit 2549e5a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 25 deletions.
20 changes: 11 additions & 9 deletions src/components/creators/CreatorDashboardSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,19 @@ function SpacePageSidebar({ space }: Extract<CreatorDashboardSidebarType, { name
return null
}

const renderTopCard = () => {
if (!isCreatorSpace) {
if (!totalStake?.hasStaked) return <SupportCreatorsCard />
return null
}

if (stakeData?.hasStaked) return <MyStakeCard space={space} />
else return <StakeSubCard space={space} />
}

return (
<>
{(() => {
if (!isCreatorSpace) {
if (!totalStake?.hasStaked) return <SupportCreatorsCard />
return null
}

if (stakeData?.hasStaked) return <MyStakeCard space={space} />
else return <StakeSubCard space={space} />
})()}
{renderTopCard()}
{!loadingTotalStake && totalStake?.hasStaked && <StakerRewardInfoCard />}
</>
)
Expand Down
16 changes: 0 additions & 16 deletions src/components/main/PageWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ export const PageContent: FC<Props> = ({
return (
<>
<HeadMeta {...meta} />
<AppLaunchedEventSender />

{isMobile ? (
<section className={className}>
Expand Down Expand Up @@ -182,18 +181,3 @@ export const PageContent: FC<Props> = ({
</>
)
}

function AppLaunchedEventSender() {
// const sendEvent = useSendEvent()
// const hasSentEvent = useRef(false)

// const myAddress = useMyAddress() ?? ''
// const { data, loading: loadingTotalStake } = useFetchTotalStake()

// useEffect(() => {
// if (hasSentEvent.current) return

// }, [sendEvent])

return null
}

0 comments on commit 2549e5a

Please sign in to comment.