Skip to content

Commit

Permalink
refactor: AppLayout.Root, CardProvider 컴포넌트 계층 재구성
Browse files Browse the repository at this point in the history
  • Loading branch information
bytrustu committed Mar 7, 2024
1 parent dfcd1cc commit 198c108
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
30 changes: 17 additions & 13 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import { Funnel } from '@/components';
import { CardListPage, CardAddPage, CardCompletePage } from '@/pages';
import { AppLayout, CardProvider, Funnel } from '@/components';
import { CardAddPage, CardCompletePage, CardListPage } from '@/pages';

const App = () => (
<Funnel.Root>
<Funnel.Step index={0}>
<CardListPage />
</Funnel.Step>
<Funnel.Step index={1}>
<CardAddPage />
</Funnel.Step>
<Funnel.Step index={2}>
<CardCompletePage />
</Funnel.Step>
</Funnel.Root>
<AppLayout.Root>
<CardProvider>
<Funnel.Root>
<Funnel.Step index={0}>
<CardListPage />
</Funnel.Step>
<Funnel.Step index={1}>
<CardAddPage />
</Funnel.Step>
<Funnel.Step index={2}>
<CardCompletePage />
</Funnel.Step>
</Funnel.Root>
</CardProvider>
</AppLayout.Root>
);
export default App;
5 changes: 1 addition & 4 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from '@/App';
import { CardProvider } from '@/components';
import { GlobalStyles } from '@/shared/styles';

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<GlobalStyles />
<CardProvider>
<App />
</CardProvider>
<App />
</React.StrictMode>,
);
4 changes: 2 additions & 2 deletions src/pages/CardCompletePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const CardCompletePage = () => {
};

return (
<AppLayout>
<>
<AppLayout.Header />
<AppLayout.Body>
<VStack gap="20px" marginTop="20px">
Expand Down Expand Up @@ -68,6 +68,6 @@ export const CardCompletePage = () => {
)}
</HStack>
</AppLayout.Footer>
</AppLayout>
</>
);
};
4 changes: 2 additions & 2 deletions src/pages/CardListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const CardListPage = () => {
};

return (
<AppLayout>
<>
<AppLayout.Header>
<Typography variant="headline">보유 카드</Typography>
</AppLayout.Header>
Expand All @@ -32,6 +32,6 @@ export const CardListPage = () => {
<CardDisplay.Add onClick={handleCardAddPageMove} />
</VStack>
</AppLayout.Footer>
</AppLayout>
</>
);
};

0 comments on commit 198c108

Please sign in to comment.