Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix top users card rendering weird skeleton because of hydration issue #238

Merged
merged 2 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions src/components/main/PageWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import CreatorDashboardSidebar, {
} from '../creators/CreatorDashboardSidebar'
import TopUsersCard from '../creators/TopUsersCard'
import ProgressModal from '../leaderboard/ProgressModal'
import { useIsMobileWidthOrDevice, useResponsiveSize } from '../responsive'
import { useIsMobileWidthOrDevice } from '../responsive'
import { fullUrl } from '../urls/helpers'
import Section from '../utils/Section'

Expand Down Expand Up @@ -125,7 +125,6 @@ export const PageContent: FC<Props> = ({
// const myAddress = useMyAddress()

const isMobile = useIsMobileWidthOrDevice()
const { isLargeDesktop } = useResponsiveSize()
// const isPanels = leftPanel || rightPanel

const sidebarStyles: ComponentProps<'div'> = {
Expand Down Expand Up @@ -155,8 +154,8 @@ export const PageContent: FC<Props> = ({
</section>
) : (
<div className={clsx('DfSectionOuterContainer')}>
{creatorDashboardSidebarType && isLargeDesktop && (
<div {...sidebarStyles}>
{creatorDashboardSidebarType && (
<div {...sidebarStyles} className='xl-only'>
<div>
<TopUsersCard />
</div>
Expand Down Expand Up @@ -202,11 +201,9 @@ export const PageContent: FC<Props> = ({
{rightPanel === undefined && creatorDashboardSidebarType && (
<div {...sidebarStyles}>
<CreatorDashboardSidebar dashboardType={creatorDashboardSidebarType} />
{!isLargeDesktop && (
<div className='mt-3 xl-hidden'>
<TopUsersCard />
</div>
)}
<div className='mt-3 xl-hidden'>
<TopUsersCard />
</div>
{/* <OnBoardingSidebar hideOnBoardingSidebar={() => setShowOnBoardingSidebar(false)} /> */}
</div>
)}
Expand Down
6 changes: 6 additions & 0 deletions src/styles/subsocial.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2264,10 +2264,16 @@ hr {
}
}

.xl-only {
display: none;
}
@media screen and (min-width: 1200px) {
.xl-hidden {
display: none !important;
}
.xl-only {
display: block;
}
}

.\!FontTiny {
Expand Down
Loading