From 88b8d95ffdddb10c8234854cc6e1d8b8e1e076ca Mon Sep 17 00:00:00 2001 From: Sean Date: Thu, 9 May 2024 20:57:56 -0700 Subject: [PATCH] better mobile support don't remove features from mobile, even if it breaks the site --- .../ClientApp/src/components/AppHeader.tsx | 30 ++++++++++--- .../ClientApp/src/components/IconTabs.tsx | 2 +- .../ClientApp/src/components/TeamCard.tsx | 2 +- .../ClientApp/src/components/TeamRank.tsx | 44 +++++++++---------- .../ClientApp/src/components/WithNavbar.tsx | 2 +- src/GZCTF/ClientApp/src/pages/Index.tsx | 36 +++++++-------- .../ClientApp/src/pages/games/[id]/Index.tsx | 13 +++--- .../src/pages/posts/[postId]/edit.tsx | 17 +++---- 8 files changed, 76 insertions(+), 70 deletions(-) diff --git a/src/GZCTF/ClientApp/src/components/AppHeader.tsx b/src/GZCTF/ClientApp/src/components/AppHeader.tsx index cc67d484..110546eb 100644 --- a/src/GZCTF/ClientApp/src/components/AppHeader.tsx +++ b/src/GZCTF/ClientApp/src/components/AppHeader.tsx @@ -3,7 +3,10 @@ import { createStyles } from '@mantine/emotion' import { mdiAccountCircleOutline, mdiAccountGroupOutline, + mdiBullhornOutline, mdiCached, + mdiFlagOutline, + mdiHomeVariantOutline, mdiLogout, mdiTranslate, mdiWeatherNight, @@ -94,6 +97,27 @@ const AppHeader: FC = () => { {user && !error ? ( <> + } + > + {t('common.tab.home')} + + } + > + {t('common.tab.post')} + + } + > + {t('common.tab.game')} + { > {t('common.tab.account.profile')} - } - > - {t('common.tab.account.clean_cache')} - = (props) => { )) return ( - + {aside} {withIcon && ( = (props) => { - + {team.name?.slice(0, 1) ?? 'T'} diff --git a/src/GZCTF/ClientApp/src/components/TeamRank.tsx b/src/GZCTF/ClientApp/src/components/TeamRank.tsx index 71229c98..98673d4d 100644 --- a/src/GZCTF/ClientApp/src/components/TeamRank.tsx +++ b/src/GZCTF/ClientApp/src/components/TeamRank.tsx @@ -60,7 +60,7 @@ const TeamRank: FC = (props) => { - + {teamInfo?.rank?.name?.slice(0, 1) ?? 'T'} @@ -105,28 +105,26 @@ const TeamRank: FC = (props) => { - {!isMobile && ( - } - variant="unstyled" - onClick={() => { - clipboard.copy(teamInfo?.teamToken) - showNotification({ - color: 'teal', - message: t('team.notification.token.copied'), - icon: , - }) - }} - styles={{ - innerInput: { - cursor: 'copy', - fontFamily: theme.fontFamilyMonospace, - }, - }} - /> - )} + } + variant="unstyled" + onClick={() => { + clipboard.copy(teamInfo?.teamToken) + showNotification({ + color: 'teal', + message: t('team.notification.token.copied'), + icon: , + }) + }} + styles={{ + innerInput: { + cursor: 'copy', + fontFamily: theme.fontFamilyMonospace, + }, + }} + /> ) diff --git a/src/GZCTF/ClientApp/src/components/WithNavbar.tsx b/src/GZCTF/ClientApp/src/components/WithNavbar.tsx index 419aa518..cd5854e9 100644 --- a/src/GZCTF/ClientApp/src/components/WithNavbar.tsx +++ b/src/GZCTF/ClientApp/src/components/WithNavbar.tsx @@ -40,7 +40,7 @@ const WithNavBar: FC = ({ const isMobile = useIsMobile() return ( - + { ))} - {!isMobile && ( - - )} + diff --git a/src/GZCTF/ClientApp/src/pages/games/[id]/Index.tsx b/src/GZCTF/ClientApp/src/pages/games/[id]/Index.tsx index 673a89ff..369219e9 100644 --- a/src/GZCTF/ClientApp/src/pages/games/[id]/Index.tsx +++ b/src/GZCTF/ClientApp/src/pages/games/[id]/Index.tsx @@ -213,14 +213,11 @@ const GameDetail: FC = () => { {t('game.button.leave')} )} - {status === ParticipationStatus.Accepted && - started && - !isMobile && - (!finished || game?.practiceMode) && ( - - )} + {status === ParticipationStatus.Accepted && started && (!finished || game?.practiceMode) && ( + + )} ) diff --git a/src/GZCTF/ClientApp/src/pages/posts/[postId]/edit.tsx b/src/GZCTF/ClientApp/src/pages/posts/[postId]/edit.tsx index 59b1ea5d..7892a3cc 100644 --- a/src/GZCTF/ClientApp/src/pages/posts/[postId]/edit.tsx +++ b/src/GZCTF/ClientApp/src/pages/posts/[postId]/edit.tsx @@ -160,17 +160,12 @@ const PostEdit: FC = () => { - {!isMobile && ( - - {`> ${postId === 'new' ? t('post.button.new') : t('post.button.edit')}`} - - )} + + {`> ${postId === 'new' ? t('post.button.new') : t('post.button.edit')}`} + {postId?.length === 8 && ( <>