Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

ResponsiveLayoutをCSS Modulesに置換え #305

Merged
merged 1 commit into from May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/layouts/ResponsiveLayout/ResponsiveLayout.module.css
@@ -0,0 +1,14 @@
.wrapper {
display: grid;
grid-template-rows: auto 1fr auto;
grid-template-columns: 100%;
gap: 64px;
min-height: 100vh;
}

.contents-wrapper {
display: inline-block;
margin: 0 auto;
text-align: center;
vertical-align: middle;
}
5 changes: 5 additions & 0 deletions src/layouts/ResponsiveLayout/ResponsiveLayout.module.css.d.ts
@@ -0,0 +1,5 @@
declare const styles: {
readonly wrapper: string;
readonly 'contents-wrapper': string;
};
export = styles;
24 changes: 4 additions & 20 deletions src/layouts/ResponsiveLayout/ResponsiveLayout.tsx
@@ -1,23 +1,7 @@
import type { FC, ReactNode } from 'react';
import styled from 'styled-components';

import { Footer, type Props as FooterProps } from '../../components/Footer';
import { Header, type Props as HeaderProps } from '../../components/Header';

const _Wrapper = styled.div`
display: grid;
grid-template-rows: auto 1fr auto;
grid-template-columns: 100%;
gap: 64px;
min-height: 100vh;
`;

const _ContentsWrapper = styled.div`
display: inline-block;
margin: 0 auto;
text-align: center;
vertical-align: middle;
`;
import styles from './ResponsiveLayout.module.css';

export type Props = FooterProps & HeaderProps & { children: ReactNode };

Expand All @@ -28,14 +12,14 @@ export const ResponsiveLayout: FC<Props> = ({
currentUrlPath,
children,
}) => (
<_Wrapper>
<div className={styles.wrapper}>
<Header
language={language}
isLanguageMenuDisplayed={isLanguageMenuDisplayed}
onClickLanguageButton={onClickLanguageButton}
currentUrlPath={currentUrlPath}
/>
<_ContentsWrapper>{children}</_ContentsWrapper>
<div className={styles['contents-wrapper']}>{children}</div>
<Footer language={language} />
</_Wrapper>
</div>
);