Skip to content

Commit

Permalink
chore: remove screen width check
Browse files Browse the repository at this point in the history
  • Loading branch information
mnixry committed Sep 22, 2023
1 parent e2fe2f7 commit 9d6508b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/GZCTF/ClientApp/src/components/WithNavbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const WithNavBar: FC<WithNavBarProps> = ({
const { user } = useUser()

return (
<WithWiderScreen minWidth={minWidth}>
<WithWiderScreen minWidth={minWidth} override={true}>
<Watermark
text={user?.userId ?? ''}
textColor={theme.colorScheme === 'dark' ? theme.colors.gray[3] : theme.colors.gray[7]}
Expand Down
10 changes: 8 additions & 2 deletions src/GZCTF/ClientApp/src/components/WithWiderScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ import IconWiderScreenRequired from '@Components/icon/WiderScreenRequiredIcon'

interface WithWiderScreenProps extends React.PropsWithChildren {
minWidth?: number
override?: boolean
}

const WithWiderScreen: FC<WithWiderScreenProps> = ({ children, minWidth = 1080 }) => {
const WithWiderScreen: FC<WithWiderScreenProps> = ({
children,
minWidth = 1080,
override = false,
}) => {
const view = useViewportSize()

const tooSmall = minWidth > 0 && view.width > 0 && view.width < minWidth
let tooSmall = minWidth > 0 && view.width > 0 && view.width < minWidth
if (override) tooSmall = false

return tooSmall ? (
<Stack spacing={0} align="center" justify="center" h="calc(100vh - 32px)">
Expand Down

0 comments on commit 9d6508b

Please sign in to comment.