-
-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f3781fd
commit 8261ea2
Showing
12 changed files
with
192 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { FC } from 'react' | ||
import { Stack, Title, Text } from '@mantine/core' | ||
import { useViewportSize } from '@mantine/hooks' | ||
import IconWiderScreenRequired from './icon/WiderScreenRequiredIcon' | ||
|
||
interface WithWiderScreenProps extends React.PropsWithChildren { | ||
minWidth?: number | ||
} | ||
|
||
const WithWiderScreen: FC<WithWiderScreenProps> = ({ children, minWidth = 1080 }) => { | ||
const view = useViewportSize() | ||
|
||
const tooSmall = minWidth > 0 && view.width < minWidth | ||
|
||
return tooSmall ? ( | ||
<Stack spacing={0} align="center" justify="center" style={{ height: 'calc(100vh - 32px)' }}> | ||
<IconWiderScreenRequired /> | ||
<Title order={1} color="#00bfa5" style={{ fontWeight: 'lighter' }}> | ||
页面宽度不足 | ||
</Title> | ||
<Text style={{ fontWeight: 'bold' }}>请使用更宽的设备浏览本页面</Text> | ||
</Stack> | ||
) : ( | ||
<>{children}</> | ||
) | ||
} | ||
|
||
export default WithWiderScreen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { FC } from 'react' | ||
import { createStyles } from "@mantine/core" | ||
|
||
const useStyles = createStyles((theme) => ({ | ||
triangle: { | ||
fill: theme.colorScheme === 'dark' ? theme.white : theme.colors.gray[6], | ||
}, | ||
})) | ||
|
||
const IconWarning: FC = () => { | ||
|
||
const { classes } = useStyles() | ||
|
||
return ( | ||
<svg | ||
id="Warning" | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="200" | ||
height="200" | ||
viewBox="0 0 4000 4000" | ||
> | ||
<path | ||
id="Rect" | ||
fill="#dd5e5e" | ||
d="M1600,2084V222h720V2084H1600Z" | ||
/> | ||
<path | ||
id="Triangle" | ||
className={classes.triangle} | ||
d="M2834.48,3844.61L345.28,2407.47V1592.53L2834.48,155.387l705.76,407.474V3437.14Zm0.89-2875.816L1049.27,2000l1786.1,1031.21V968.794Z" | ||
/> | ||
<path | ||
id="Parallelogram" | ||
fill="#dd5e5e" | ||
d="M1600,1999.85l720-415.7v782l-720,415.7v-782Z" | ||
/> | ||
<circle | ||
id="Circle" | ||
fill="#cd3535" | ||
cx="1960" | ||
cy="3337" | ||
r="391" | ||
/> | ||
</svg> | ||
) | ||
} | ||
|
||
export default IconWarning |
61 changes: 61 additions & 0 deletions
61
GZCTF/ClientApp/src/components/icon/WiderScreenRequiredIcon.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { FC } from 'react' | ||
import { createStyles } from "@mantine/core" | ||
|
||
const useStyles = createStyles((theme) => ({ | ||
triangle: { | ||
fill: theme.colorScheme === 'dark' ? theme.white : theme.colors.gray[6], | ||
}, | ||
})) | ||
|
||
const IconWiderScreenRequired: FC = () => { | ||
const { classes } = useStyles() | ||
|
||
return ( | ||
<svg | ||
id="IconWiderScreenRequired" | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="320" | ||
height="320" | ||
viewBox="0 0 6400 6400" | ||
> | ||
<path | ||
id="arrowRodL2" | ||
fill="#007f6e" | ||
fillRule="evenodd" | ||
d="M1920,2900v600H640V2900H1920Z" | ||
/> | ||
<path | ||
id="arrowRodL1" | ||
fill="#00bfa5" | ||
fillRule="evenodd" | ||
d="M3200,2900v600H1920V2900H3200Z" | ||
/> | ||
<path | ||
id="Triangle" | ||
className={classes.triangle} | ||
fillRule="evenodd" | ||
d="M3794.48,5044.61L1305.28,3607.47V2792.53l2489.2-1437.14,705.76,407.47V4637.14Zm0.89-2875.82L2009.27,3200l1786.1,1031.21V2168.79Z" | ||
/> | ||
<path | ||
id="arrowRodR" | ||
fill="#00bfa5" | ||
fillRule="evenodd" | ||
d="M3200,3500V2900H5760v600H3200Z" | ||
/> | ||
<path | ||
id="arrowR" | ||
fill="#1de9b6" | ||
fillRule="evenodd" | ||
d="M6400,3200L5268.63,4331.37l-424.27-424.26L5551.47,3200l-707.11-707.11,424.27-424.26,707.11,707.11h0Z" | ||
/> | ||
<path | ||
id="arrowL" | ||
fill="#00bfa5" | ||
fillRule="evenodd" | ||
d="M1555.63,3907.11l-424.26,424.26L0,3200l424.264-424.26h0l707.106-707.11,424.26,424.26L848.528,3200Z" | ||
/> | ||
</svg> | ||
) | ||
} | ||
|
||
export default IconWiderScreenRequired |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters