Skip to content

Commit

Permalink
✨ Layout jsx 컴포넌트 생성 (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
yyeonzu authored and hyerindev committed Feb 1, 2025
1 parent 593b160 commit b3f3a72
Showing 1 changed file with 31 additions and 20 deletions.
51 changes: 31 additions & 20 deletions src/styles/layout.ts → src/styles/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,40 @@
import { css } from 'styled-components';
import { NoSelect } from '@src/styles/mixins';
import { Outlet } from 'react-router-dom';
import styled from 'styled-components';

/**
* @example
* <NoDataTextLayout>
* <main>
* {data.length > 0 ? (
* {data.length > 0 ? (
* // 데이터 표시
* ) : (
* <strong>데이터가 없어요.</strong>
* )}
* </main>
* </NoDataTextLayout>
* )}
*/
export const NoDataTextLayout = css`
export const NoDataTextLayout = () => (
<NoDataTextLayoutStyle>
<main>
<Outlet />
</main>
</NoDataTextLayoutStyle>
);

/**
* @example
* <태그 className='scroll-area'>
* // 스크롤 영역
* </태그>
* <Button>메인 버튼</Button>
*/
export const BottomButtonLayout = () => (
<BottomButtonLayoutStyle>
<main>
<Outlet />
</main>
</BottomButtonLayoutStyle>
);

// Styled components
const NoDataTextLayoutStyle = styled.div`
main:has(strong) {
display: flex;
Expand All @@ -28,18 +49,8 @@ export const NoDataTextLayout = css`
${NoSelect}
}
`;
/**
* @example
* <BottomButtonLayout>
* <main>
* <태그 className='scroll-area'>
* // 스크롤 영역
* </태그>
* <Button>메인 버튼</Button>
* </main>
* </BottomButtonLayout>
*/
export const BottomButtonLayout = css`

const BottomButtonLayoutStyle = styled.div`
main {
display: flex;
flex-flow: column nowrap;
Expand Down

0 comments on commit b3f3a72

Please sign in to comment.