Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Fix merging errors
Browse files Browse the repository at this point in the history
  • Loading branch information
henrypalacios committed Nov 5, 2021
1 parent 37f8dea commit 2cda92f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
1 change: 0 additions & 1 deletion src/custom/hooks/useFetchProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export default function useFetchProfile(): FetchProfileState {
const [profile, setProfile] = useState<FetchProfileState>(emptyState)

useEffect(() => {
setProfile({ ...emptyState, isLoading: true })
async function fetchAndSetProfileData() {
try {
if (chainId && account) {
Expand Down
32 changes: 15 additions & 17 deletions src/custom/pages/Profile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,20 @@ export default function Profile() {
const { profileData, isLoading, error } = useFetchProfile()
const lastUpdated = useTimeAgo(profileData?.lastUpdated)

const renderNotificationMessages = () => {
return (
<>
{error && (
<StyledNotificationBanner isVisible level="error" canClose={false}>
There was an error loading your profile data. Please try again later.
</StyledNotificationBanner>
)}
{chainId && chainId !== ChainId.MAINNET && (
<StyledNotificationBanner isVisible level="info" canClose={false}>
Profile data is only available for mainnet. Please change the network to see it.
</StyledNotificationBanner>
)}
</>
)
}
const renderNotificationMessages = (
<>
{error && (
<StyledNotificationBanner isVisible level="error" canClose={false}>
There was an error loading your profile data. Please try again later.
</StyledNotificationBanner>
)}
{chainId && chainId !== ChainId.MAINNET && (
<StyledNotificationBanner isVisible level="info" canClose={false}>
Profile data is only available for mainnet. Please change the network to see it.
</StyledNotificationBanner>
)}
</>
)

return (
<Wrapper>
Expand Down Expand Up @@ -74,7 +72,7 @@ export default function Profile() {
</Loader>
)}
</CardHead>
{renderNotificationMessages()}
{renderNotificationMessages}
<ChildWrapper>
<Txt fs={16}>
<strong>Your referral url</strong>
Expand Down

0 comments on commit 2cda92f

Please sign in to comment.