generated from EasyWebApp/WebCell-scaffold
-
Notifications
You must be signed in to change notification settings - Fork 7
[optimize] Mobile responsive design for Dashboard routes #92
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
834672d
Initial plan
Copilot 6d918cb
Add mobile responsive layout to dashboard pages
Copilot f7b20f7
Complete mobile adaptation implementation
Copilot 85a6d26
Use MUI Material Icon from Google CDN and unified Drawer component
Copilot 4e92e7e
Refactor to use SymbolIcon and single unified ResponsiveDrawer
Copilot 61e7041
Refactor SessionBox: extract ResponsiveDrawer module, use PropsWithCh…
Copilot f4a94e4
Migrate all PR files to use Tailwind CSS instead of MUI sx prop
Copilot c63934c
Update pages/dashboard/index.tsx
TechQuery b3a51d5
Update components/User/SessionBox.tsx
TechQuery File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,38 @@ | ||
| import { Drawer, useMediaQuery, useTheme } from '@mui/material'; | ||
| import { FC, PropsWithChildren } from 'react'; | ||
|
|
||
| const DESKTOP_DRAWER_STYLES = { | ||
| position: 'sticky', | ||
| top: '5rem', | ||
| height: 'calc(100vh - 5rem)', | ||
| border: 'none', | ||
| boxShadow: 'none', | ||
| } as const; | ||
|
|
||
| export interface ResponsiveDrawerProps extends PropsWithChildren { | ||
| open: boolean; | ||
| onClose: () => void; | ||
| } | ||
|
|
||
| export const ResponsiveDrawer: FC<ResponsiveDrawerProps> = ({ open, onClose, children }) => { | ||
| const theme = useTheme(); | ||
| const isMobile = useMediaQuery(theme.breakpoints.down('md')); | ||
|
|
||
| return ( | ||
| <Drawer | ||
| anchor="left" | ||
| open={isMobile ? open : true} | ||
| variant={isMobile ? 'temporary' : 'permanent'} | ||
| onClose={onClose} | ||
| sx={{ | ||
| display: { xs: isMobile ? 'block' : 'none', md: isMobile ? 'none' : 'block' }, | ||
| '& .MuiDrawer-paper': { | ||
| width: 250, | ||
| ...(isMobile ? {} : DESKTOP_DRAWER_STYLES), | ||
| }, | ||
| }} | ||
| > | ||
| {children} | ||
| </Drawer> | ||
| ); | ||
| }; |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| /// <reference types="next" /> | ||
| /// <reference types="next/image-types/global" /> | ||
| import './.next/dev/types/routes.d.ts'; | ||
| import "./.next/dev/types/routes.d.ts"; | ||
|
|
||
| // NOTE: This file should not be edited | ||
| // see https://nextjs.org/docs/pages/api-reference/config/typescript for more information. |
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.