-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
3 changed files
with
42 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use client'; | ||
|
||
import WidthProvider from '@/app/_components/WidthProvider'; | ||
|
||
const Caption = () => { | ||
return <WidthProvider>TEST</WidthProvider>; | ||
}; | ||
|
||
export default Caption; |
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,26 @@ | ||
'use client'; | ||
|
||
import { ReactNode } from 'react'; | ||
import styled from '@mui/material/styles/styled'; | ||
|
||
/** | ||
* 横幅を制限する | ||
* @constructor | ||
*/ | ||
const WidthProvider = ({ children }: { children: ReactNode }) => { | ||
return <StyledDiv>{children}</StyledDiv>; | ||
}; | ||
|
||
const paddingSide = '20px'; | ||
|
||
const StyledDiv = styled('div')` | ||
max-width: 100%; | ||
margin-left: auto; | ||
margin-right: auto; | ||
width: ${({ theme }) => | ||
`calc(${theme.breakpoints.values.desktop}px + calc(2 * ${paddingSide}))`}; | ||
padding-left: ${paddingSide}; | ||
padding-right: ${paddingSide}; | ||
`; | ||
|
||
export default WidthProvider; |
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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
import Caption from '@/app/_components/Caption'; | ||
|
||
export default function Home() { | ||
return <main>Home</main>; | ||
return ( | ||
<main> | ||
<Caption /> | ||
</main> | ||
); | ||
} |