mirror of
https://github.com/vercel/commerce.git
synced 2025-07-05 12:41:21 +00:00
✨ feat: Heading Common
This commit is contained in:
parent
ce3efdce7d
commit
9ad9d33fb9
11905
package-lock.json
generated
11905
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -74,7 +74,6 @@
|
|||||||
"prettier": "^2.3.0",
|
"prettier": "^2.3.0",
|
||||||
"typescript": "4.3.4"
|
"typescript": "4.3.4"
|
||||||
},
|
},
|
||||||
|
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"**/*.{js,jsx,ts,tsx}": [
|
"**/*.{js,jsx,ts,tsx}": [
|
||||||
"prettier --write",
|
"prettier --write",
|
||||||
|
@ -1,33 +1,12 @@
|
|||||||
|
|
||||||
import { CarouselCommon, LabelCommon, Layout, QuanittyInput } from 'src/components/common'
|
import { HeadingCommon } from 'src/components/common'
|
||||||
|
|
||||||
const dataTest = [{
|
|
||||||
text: 1
|
|
||||||
}, {
|
|
||||||
text: 2
|
|
||||||
}, {
|
|
||||||
text: 3
|
|
||||||
}, {
|
|
||||||
text: 4
|
|
||||||
}, {
|
|
||||||
text: 5
|
|
||||||
}, {
|
|
||||||
text: 6
|
|
||||||
}]
|
|
||||||
const test = (props: { text: string }) => <div className="h-64 bg-yellow-300">{props.text}</div>
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<CarouselCommon data={dataTest} Component={test} itemKey="test" />
|
<HeadingCommon textAlign="center" />
|
||||||
<QuanittyInput size="default" min={5} max={10} initValue={3} />
|
|
||||||
<QuanittyInput size="small" min={3} step={10} />
|
|
||||||
<LabelCommon type="default" shape="half" >SEEFOOT</LabelCommon>
|
|
||||||
<LabelCommon type="discount" shape="round">-15%</LabelCommon>
|
|
||||||
<LabelCommon type="waiting">Waitting</LabelCommon>
|
|
||||||
<LabelCommon type="delivering" >Delivering</LabelCommon>
|
|
||||||
<LabelCommon type="delivered">Delivered</LabelCommon>
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
Home.Layout = Layout
|
// Home.Layout = Layout
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
@import '../../../styles/utilities';
|
||||||
|
|
||||||
|
.headingCommon {
|
||||||
|
@apply heading-1 font-heading uppercase text-left spacing-horizontal-left;
|
||||||
|
|
||||||
|
&.highlight {
|
||||||
|
color: var(--negative);
|
||||||
|
}
|
||||||
|
&.light {
|
||||||
|
color: var(--disabled);
|
||||||
|
}
|
||||||
|
&.center {
|
||||||
|
@apply text-center
|
||||||
|
}
|
||||||
|
|
||||||
|
@screen md {
|
||||||
|
@apply spacing-horizontal;
|
||||||
|
}
|
||||||
|
}
|
23
src/components/common/HeadingCommon/HeadingCommon.tsx
Normal file
23
src/components/common/HeadingCommon/HeadingCommon.tsx
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import classNames from 'classnames'
|
||||||
|
import s from './HeadingCommon.module.scss'
|
||||||
|
|
||||||
|
interface HeadingCommonProps {
|
||||||
|
headingType?: 'highlight' | 'light' | 'default';
|
||||||
|
textAlign?: 'center' | 'left';
|
||||||
|
headingText?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const HeadingCommon = ({ headingType='default', textAlign='left', headingText='categories' }: HeadingCommonProps) => {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={classNames(s.headingCommon, {
|
||||||
|
[s[`${headingType}`]]: headingType,
|
||||||
|
[s[`${textAlign}`]]: textAlign
|
||||||
|
})}
|
||||||
|
>{headingText}</div>
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HeadingCommon
|
@ -8,3 +8,4 @@ export { default as ViewAllItem} from './ViewAllItem/ViewAllItem'
|
|||||||
export { default as ItemWishList} from './ItemWishList/ItemWishList'
|
export { default as ItemWishList} from './ItemWishList/ItemWishList'
|
||||||
export { default as Logo} from './Logo/Logo'
|
export { default as Logo} from './Logo/Logo'
|
||||||
export { default as Inputcommon} from './InputCommon/InputCommon'
|
export { default as Inputcommon} from './InputCommon/InputCommon'
|
||||||
|
export { default as HeadingCommon } from './HeadingCommon/HeadingCommon'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user