mirror of
https://github.com/vercel/commerce.git
synced 2025-07-24 10:41:23 +00:00
🔧 config: src folders structure
:%s
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
/* style demo here */
|
||||
|
||||
.buttonCommon {
|
||||
color: red;
|
||||
}
|
15
src/components/common/ButtonCommon/ButtonCommon.tsx
Normal file
15
src/components/common/ButtonCommon/ButtonCommon.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import { FC, useRef, useEffect } from 'react'
|
||||
import s from './ButtonCommon.module.css'
|
||||
|
||||
interface Props {
|
||||
className?: string
|
||||
children?: any
|
||||
}
|
||||
|
||||
const ButtonCommon: FC<Props> = ({ }) => {
|
||||
return (
|
||||
<div className={s.buttonCommon}>This is button common</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default ButtonCommon
|
5
src/components/common/Header/Header.module.css
Normal file
5
src/components/common/Header/Header.module.css
Normal file
@@ -0,0 +1,5 @@
|
||||
/* style demo here */
|
||||
|
||||
.header {
|
||||
color: green;
|
||||
}
|
15
src/components/common/Header/Header.tsx
Normal file
15
src/components/common/Header/Header.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import { FC, useRef, useEffect } from 'react'
|
||||
import s from './Header.module.css'
|
||||
|
||||
interface Props {
|
||||
className?: string
|
||||
children?: any
|
||||
}
|
||||
|
||||
const Header: FC<Props> = ({ }) => {
|
||||
return (
|
||||
<div className={s.header}>This is Header</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Header
|
24
src/components/common/Layout/Layout.tsx
Normal file
24
src/components/common/Layout/Layout.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import { FC, useRef, useEffect } from 'react'
|
||||
import Header from '../Header/Header'
|
||||
import { CommerceProvider } from '@framework'
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
interface Props {
|
||||
className?: string
|
||||
children?: any
|
||||
}
|
||||
|
||||
// note: demo code
|
||||
const Layout: FC<Props> = ({ children }) => {
|
||||
const { locale = 'en-US' } = useRouter()
|
||||
|
||||
return (
|
||||
<CommerceProvider locale={locale}>
|
||||
<Header />
|
||||
<main>{children}</main>
|
||||
</CommerceProvider>
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
export default Layout
|
3
src/components/common/index.ts
Normal file
3
src/components/common/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export { default as ButtonCommon } from './ButtonCommon/ButtonCommon'
|
||||
export { default as Layout } from './Layout/Layout'
|
||||
|
1
src/components/icons/index.ts
Normal file
1
src/components/icons/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
// index here
|
1
src/components/modules/cart/index.ts
Normal file
1
src/components/modules/cart/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
// index here
|
@@ -0,0 +1,5 @@
|
||||
/* style demo here */
|
||||
|
||||
.homeBanner {
|
||||
color: green;
|
||||
}
|
15
src/components/modules/home/HomeBanner/HomeBanner.tsx
Normal file
15
src/components/modules/home/HomeBanner/HomeBanner.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import { FC } from 'react'
|
||||
import s from './HomeBanner.module.css'
|
||||
|
||||
interface Props {
|
||||
className?: string
|
||||
children?: any
|
||||
}
|
||||
|
||||
const HomeBanner: FC<Props> = ({ }) => {
|
||||
return (
|
||||
<div className={s.homeBanner}>This is HomeBanner</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default HomeBanner
|
1
src/components/modules/home/index.ts
Normal file
1
src/components/modules/home/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { default as HomeBanner } from './HomeBanner/HomeBanner'
|
Reference in New Issue
Block a user