Skip to content

Commit

Permalink
Merge pull request #15 from Duri-Salon/feat/mobile-layout(DURI-313)
Browse files Browse the repository at this point in the history
[feat] 모바일 레이아웃 구현
  • Loading branch information
leejin-rho authored Nov 27, 2024
2 parents 097c94e + 780e08e commit 0fd9620
Show file tree
Hide file tree
Showing 9 changed files with 286 additions and 192 deletions.
419 changes: 229 additions & 190 deletions .pnp.cjs

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion apps/salon/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ function App() {
<BrowserRouter>
<Global styles={globalStyle} />
<Home />
<div>하이</div>
</BrowserRouter>
);
}
Expand Down
13 changes: 12 additions & 1 deletion apps/salon/src/pages/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import { MobileLayout, NavBar } from "@duri-fe/ui";

const Home = () => {
return <div>안녕하세요!</div>;
return (
<>
<MobileLayout>
<h1>Home</h1>
<h1>Home</h1>
<h1>Home</h1>
</MobileLayout>
<NavBar />
</>
)
};

export default Home;
14 changes: 14 additions & 0 deletions packages/ui/src/components/FakeNavBar/NavBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { theme } from "@duri-fe/ui";
import styled from "@emotion/styled";

export const NavBar = styled.div`
width: 100%;
max-width: 480px;
height: 50px;
background-color: ${theme.palette.Gray700};
position: fixed;
bottom: 0;
left: 50%;
transform: translateX(-50%);
`
1 change: 1 addition & 0 deletions packages/ui/src/components/FakeNavBar/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { NavBar } from './NavBar';
24 changes: 24 additions & 0 deletions packages/ui/src/components/MobileLayout/MobileLayout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from "react";

import { Flex, theme } from "@duri-fe/ui";
import styled from "@emotion/styled";

const Container = styled(Flex)`
max-width: 480px;
min-height: 100vh;
box-sizing: border-box;
`

export const MobileLayout = ({ children }: { children: React.ReactNode }) => {
return (
<Container
direction="column"
margin="0 auto"
justify="flex-start"
align="flex-start"
backgroundColor={theme.palette.White}
>
{children}
</Container>
)
}
1 change: 1 addition & 0 deletions packages/ui/src/components/MobileLayout/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { MobileLayout } from './MobileLayout';
2 changes: 2 additions & 0 deletions packages/ui/src/components/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ export * from './FlexBox';
export * from './Button';
export * from './Typo';
export * from './TextField';
export * from './MobileLayout';
export * from './FakeNavBar';
3 changes: 3 additions & 0 deletions packages/ui/src/styles/GlobalStyles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { css } from '@emotion/react';
import emotionReset from 'emotion-reset';

import { theme } from './theme';

export const globalStyle = css`
${emotionReset}
body {
Expand All @@ -10,6 +12,7 @@ export const globalStyle = css`
scroll: smooth;
}
font-family: 'Pretendard';
background-color: ${theme.palette.Normal50};
}
button {
background: inherit;
Expand Down

0 comments on commit 0fd9620

Please sign in to comment.