forked from next-step/react-payments
-
Notifications
You must be signed in to change notification settings - Fork 0
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
6 changed files
with
73 additions
and
2 deletions.
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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
const App = () => <div>Hello, React Payments</div>; | ||
import { AppLayout } from 'src/components/AppLayout'; | ||
|
||
const App = () => ( | ||
<AppLayout> | ||
<div>Hello, React Payments</div> | ||
</AppLayout> | ||
); | ||
|
||
export default App; |
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,35 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { AppLayout } from '@/components/AppLayout/AppLayout.tsx'; | ||
import { HStack, VStack } from '@/shared/components'; | ||
import { styleToken } from '@/shared/styles'; | ||
|
||
const meta = { | ||
title: 'Components/AppLayout', | ||
component: AppLayout, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
tags: ['autodocs'], | ||
} satisfies Meta<typeof AppLayout>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Primary: Story = { | ||
args: { | ||
children: ( | ||
<VStack gap="20px" alignItems="center" justifyContent="center"> | ||
<HStack backgroundColor={styleToken.color.gray100} width="100%" justifyContent="space-between" padding="10px"> | ||
<div>Left</div> | ||
<div>Right</div> | ||
</HStack> | ||
<VStack backgroundColor={styleToken.color.gray200} width="100%" padding="10px"> | ||
<div>App Item 1</div> | ||
<div>App Item 2</div> | ||
<div>App Item 3</div> | ||
</VStack> | ||
</VStack> | ||
), | ||
}, | ||
}; |
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 @@ | ||
import { PropsWithChildren } from 'react'; | ||
import { Box, VStack } from '@/shared/components'; | ||
import { styleToken } from '@/shared/styles'; | ||
|
||
export const AppLayout = ({ children }: PropsWithChildren) => ( | ||
<Box | ||
as="section" | ||
backgroundColor={styleToken.color.white} | ||
width="375px" | ||
minWidth="375px" | ||
height="700px" | ||
position="relative" | ||
borderRadius="15px" | ||
border={`1px solid ${styleToken.color.body}`} | ||
> | ||
<AppLayoutDisplay>{children}</AppLayoutDisplay> | ||
</Box> | ||
); | ||
|
||
const AppLayoutDisplay = ({ children }: PropsWithChildren) => ( | ||
<VStack as="section" height="100%" padding="16px 24px"> | ||
{children} | ||
</VStack> | ||
); | ||
|
||
AppLayout.displayName = 'AppLayout'; |
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 @@ | ||
export * from './AppLayout.tsx'; |
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 @@ | ||
export * from './AppLayout'; |
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,9 +1,11 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom/client'; | ||
import App from './App'; | ||
import App from '@/App.tsx'; | ||
import { GlobalStyles } from '@/shared/styles'; | ||
|
||
ReactDOM.createRoot(document.getElementById('root')!).render( | ||
<React.StrictMode> | ||
<GlobalStyles /> | ||
<App /> | ||
</React.StrictMode>, | ||
); |