Skip to content

Commit

Permalink
feat(Layout): hide sidenav and navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Kechicode committed Jan 5, 2025
1 parent 3f200fd commit ba9458a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
26 changes: 13 additions & 13 deletions src/components/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { Head, Media, useRoute } from '~/components'
import AuthHeader from './AuthHeader'
import FixedMain from './FixedMain'
import Header from './Header'
import NavBar from './NavBar'
// import NavBar from './NavBar'
import Notice from './Notice'
// import SideFooter from './SideFooter'
import SideNav from './SideNav'
// import SideNav from './SideNav'
import Spacing from './Spacing'
import styles from './styles.module.css'
import { TopNavBar } from './TopNavBar'
Expand All @@ -21,34 +21,34 @@ export const Layout: React.FC<{ children?: React.ReactNode }> & {
AuthHeader: typeof AuthHeader
Notice: typeof Notice
} = ({ children }) => {
const { isInPath } = useRoute()
const isInDraftDetail = isInPath('ME_DRAFT_DETAIL')
const isInArticleDetail = isInPath('ARTICLE_DETAIL')
const isInArticleDetailHistory = isInPath('ARTICLE_DETAIL_HISTORY')
const isInMomentDetail = isInPath('MOMENT_DETAIL')
const isInMomentDetailEdit = isInPath('MOMENT_DETAIL_EDIT')
// const { isInPath } = useRoute()
// const isInDraftDetail = isInPath('ME_DRAFT_DETAIL')
// const isInArticleDetail = isInPath('ARTICLE_DETAIL')
// const isInArticleDetailHistory = isInPath('ARTICLE_DETAIL_HISTORY')
// const isInMomentDetail = isInPath('MOMENT_DETAIL')
// const isInMomentDetailEdit = isInPath('MOMENT_DETAIL_EDIT')

return (
<>
<Head />
<TopNavBar />
<div className={styles.container}>
<main className={styles.main}>
{!isInArticleDetailHistory && (
{/* {!isInArticleDetailHistory && (
<nav role="navigation" className={styles.sidenav}>
<section className={styles.sideNavContent}>
<Media greaterThan="sm">
<Media greaterThan="md">
<SideNav />
</Media>
</section>
</nav>
)}
)} */}

{children}
</main>
</div>

{!isInDraftDetail &&
{/* {!isInDraftDetail &&
!isInArticleDetail &&
!isInArticleDetailHistory &&
!isInMomentDetail &&
Expand All @@ -58,7 +58,7 @@ export const Layout: React.FC<{ children?: React.ReactNode }> & {
<NavBar />
</footer>
</Media>
)}
)} */}
</>
)
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/Layout/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

@media (--sm-up) {
display: grid;
grid-template-areas: 'left content';
grid-template-columns: 3rem minmax(0, 100%);
grid-template-areas: 'content';
grid-template-columns: minmax(0, 100%);
grid-column-gap: 1.25rem;
}

Expand All @@ -41,7 +41,7 @@
}

.sidenav {
@media (--sm-up) {
@media (--md-up) {
grid-column: left;
}

Expand Down

0 comments on commit ba9458a

Please sign in to comment.