mirror of
https://github.com/vercel/commerce.git
synced 2025-07-29 05:01:22 +00:00
🔀 merge: common to m1-datnguyen
:%s
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
/* style demo here */
|
||||
|
||||
.buttonCommon {
|
||||
color: red;
|
||||
}
|
77
src/components/common/ButtonCommon/ButtonCommon.module.scss
Normal file
77
src/components/common/ButtonCommon/ButtonCommon.module.scss
Normal file
@@ -0,0 +1,77 @@
|
||||
@import "../../../styles/utilities";
|
||||
|
||||
.buttonCommon {
|
||||
@apply custom-border-radius bg-primary transition-all duration-200 text-white font-bold;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 1.6rem 3.2rem;
|
||||
&:disabled {
|
||||
filter: brightness(0.9);
|
||||
cursor: not-allowed;
|
||||
color: var(--disabled);
|
||||
}
|
||||
&.loading {
|
||||
&::before {
|
||||
content: "";
|
||||
border-radius: 50%;
|
||||
width: 1.6rem;
|
||||
height: 1.6rem;
|
||||
border: 3px solid rgba(170, 170, 170, 0.5);
|
||||
border-top: 3px solid var(--white);
|
||||
-webkit-animation: spin 2s linear infinite;
|
||||
animation: spin 2s linear infinite;
|
||||
margin-right: 0.8rem;
|
||||
}
|
||||
}
|
||||
&:hover {
|
||||
@apply shadow-md;
|
||||
&:not(:disabled) {
|
||||
filter: brightness(1.05);
|
||||
}
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
filter: brightness(1.05);
|
||||
}
|
||||
&:focus-visible {
|
||||
outline: 2px solid var(--text-active);
|
||||
}
|
||||
|
||||
&.light {
|
||||
@apply text-base bg-white;
|
||||
border: 1px solid var(--text-active);
|
||||
&.loading {
|
||||
&::before {
|
||||
border-top-color: var(--primary);
|
||||
}
|
||||
}
|
||||
}
|
||||
&.large {
|
||||
padding: 3.2rem 4.8rem;
|
||||
&.loading {
|
||||
&::before {
|
||||
width: 2.4rem;
|
||||
height: 2.4rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
margin-right: 0.8rem;
|
||||
svg path {
|
||||
fill: currentColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
@@ -1,14 +1,35 @@
|
||||
import { FC, useRef, useEffect } from 'react'
|
||||
import s from './ButtonCommon.module.css'
|
||||
import classNames from 'classnames'
|
||||
import React from 'react'
|
||||
import { ButonType, ButtonSize } from 'src/utils/constanst.utils'
|
||||
import s from './ButtonCommon.module.scss'
|
||||
|
||||
interface Props {
|
||||
className?: string
|
||||
children?: any
|
||||
children?: any,
|
||||
type?: ButonType,
|
||||
size?: ButtonSize,
|
||||
icon?: any,
|
||||
loading?: boolean,
|
||||
disabled?: boolean,
|
||||
onClick?: () => void,
|
||||
}
|
||||
|
||||
const ButtonCommon: FC<Props> = ({ }) => {
|
||||
const ButtonCommon = ({ type = ButonType.primary, size = ButtonSize.default,
|
||||
icon, loading, disabled, children, onClick }: Props) => {
|
||||
return (
|
||||
<div className={s.buttonCommon}>This is button common</div>
|
||||
<button className={classNames({
|
||||
[s.buttonCommon]: true,
|
||||
[s[type]]: !!type,
|
||||
[s[size]]: !!size,
|
||||
[s.loading]: loading,
|
||||
})}
|
||||
disabled={disabled}
|
||||
onClick={onClick}
|
||||
>
|
||||
{
|
||||
icon && <span className={s.icon}>{icon}</span>
|
||||
}
|
||||
<span className={s.label}>{children}</span>
|
||||
</button>
|
||||
)
|
||||
}
|
||||
|
||||
|
@@ -1,21 +1,22 @@
|
||||
@import '../../../styles/utilities';
|
||||
@import "../../../styles/utilities";
|
||||
|
||||
.header {
|
||||
.btn {
|
||||
@apply font-bold py-2 px-4 rounded;
|
||||
// @apply font-bold py-2 px-4 rounded;
|
||||
}
|
||||
.btnBlue {
|
||||
@apply bg-primary hover:bg-warning text-label font-bold py-2 px-4 custom-border-radius;
|
||||
|
||||
}
|
||||
.link {
|
||||
color: theme("colors.warning");
|
||||
}
|
||||
.heading {
|
||||
@apply text-base;
|
||||
@apply text-base font-heading;
|
||||
}
|
||||
|
||||
.paragraph {
|
||||
@apply topline;
|
||||
}
|
||||
.logo {
|
||||
@apply font-logo;
|
||||
}
|
||||
}
|
||||
|
@@ -9,28 +9,9 @@ interface Props {
|
||||
const Header: FC<Props> = ({ }: Props) => {
|
||||
return (
|
||||
<div className={s.header}>
|
||||
{/* This is Header
|
||||
<button className={s.btnBlue}>
|
||||
Button
|
||||
</button>
|
||||
<button className={s.btn}>
|
||||
Button
|
||||
</button>
|
||||
<div className={s.link}>
|
||||
Test link style
|
||||
</div>
|
||||
<h1 className="heading-1">
|
||||
HEADING 1
|
||||
</h1>
|
||||
<p className="spacing-horizontal">
|
||||
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Sunt delectus, atque aliquid repudiandae debitis dolor facere impedit alias nemo dolores voluptatum? Commodi, delectus. Dignissimos aspernatur nobis, distinctio delectus eligendi nisi illo tempore non nostrum, molestias excepturi dolor culpa fugiat rem perspiciatis. Repellendus numquam quisquam possimus natus vero recusandae, ipsam earum ratione quos ex consectetur cum nostrum modi amet odit fugiat fugit. Facere cum enim dignissimos molestias facilis error dicta exercitationem, delectus voluptates fuga laboriosam esse sunt odio, impedit modi veritatis, nisi nam? Voluptatum voluptas similique aspernatur. Soluta, accusamus! Mollitia praesentium adipisci perspiciatis iusto dolorum sint sit placeat, nesciunt id repellendus.
|
||||
</p>
|
||||
<p className="spacing-horizontal-left">
|
||||
Lorem ipsum dolor sit amet consectetur adipisicing elit. Itaque doloremque quos excepturi laborum maiores laudantium hic iusto natus? Ipsa deleniti quas odit! Labore esse enim ipsam tempora tenetur beatae maxime officiis est, a illo! Soluta suscipit maxime odit eveniet laudantium, iure atque doloribus quaerat. Obcaecati tempore molestiae aliquid amet maiores suscipit, beatae repellat illum ipsam tenetur. Porro officiis omnis quam, iure quia necessitatibus consectetur culpa itaque, in tempora rem ex ad et iusto, hic commodi fuga quibusdam. Dolores exercitationem natus dolor pariatur voluptates non corporis, minus repellat! Quis distinctio esse, animi suscipit ducimus sequi obcaecati facere, perferendis ea omnis soluta.
|
||||
</p>
|
||||
<p className={s.paragraph}>
|
||||
Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempore, natus?
|
||||
</p> */}
|
||||
This is Header
|
||||
<h1 className={s.heading}>This is heading</h1>
|
||||
<div className={s.logo}>This is logo text</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
10
src/components/common/ItemWishList/ItemWishList.module.scss
Normal file
10
src/components/common/ItemWishList/ItemWishList.module.scss
Normal file
@@ -0,0 +1,10 @@
|
||||
@import '../../../styles/utilities';
|
||||
|
||||
.heartToggle{
|
||||
cursor: pointer;
|
||||
width: 4.8rem;
|
||||
height: 4.8rem;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
19
src/components/common/ItemWishList/ItemWishList.tsx
Normal file
19
src/components/common/ItemWishList/ItemWishList.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Heart } from '@components/icons'
|
||||
import React, { useState } from 'react'
|
||||
import s from './ItemWishList.module.scss'
|
||||
|
||||
interface Props {
|
||||
className?: string
|
||||
children?: any
|
||||
}
|
||||
|
||||
const ItemWishList = ({}:Props) => {
|
||||
const [isClick,setClick] = useState(false)
|
||||
return(
|
||||
<div className={s.heartToggle} onClick={() => setClick(!isClick)}>
|
||||
<Heart color={isClick ? "#D1644D" : "#5B9A74"}/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default ItemWishList
|
20
src/components/common/Logo/Logo.module.scss
Normal file
20
src/components/common/Logo/Logo.module.scss
Normal file
@@ -0,0 +1,20 @@
|
||||
@import '../../../styles/utilities';
|
||||
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@700&display=swap');
|
||||
|
||||
|
||||
.logo{
|
||||
display: flex;
|
||||
.eclipse{
|
||||
width: 3.2rem;
|
||||
height: 3.2rem;
|
||||
background-color: theme("colors.primary");
|
||||
border-radius: 50%;
|
||||
margin-right: 1.2rem;
|
||||
}
|
||||
.conTent{
|
||||
font-family: 'Poppins', sans-serif;
|
||||
text-transform: uppercase;
|
||||
line-height: 3.2rem;
|
||||
letter-spacing: -0.02rem;
|
||||
}
|
||||
}
|
21
src/components/common/Logo/Logo.tsx
Normal file
21
src/components/common/Logo/Logo.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import s from './Logo.module.scss'
|
||||
|
||||
interface Props {
|
||||
className?: string
|
||||
children?: any
|
||||
}
|
||||
|
||||
const Logo = ({}: Props) => {
|
||||
return(
|
||||
<div className={s.logo}>
|
||||
<div className={s.eclipse}>
|
||||
|
||||
</div>
|
||||
<div className={s.conTent}>
|
||||
ONLINE GROCERY
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Logo
|
17
src/components/common/ViewAllItem/ViewAllItem.module.scss
Normal file
17
src/components/common/ViewAllItem/ViewAllItem.module.scss
Normal file
@@ -0,0 +1,17 @@
|
||||
@import '../../../styles/utilities';
|
||||
@import url('https://fonts.googleapis.com/css2?family=Nunito&display=swap');
|
||||
|
||||
.viewAll{
|
||||
display: flex;
|
||||
color: theme("colors.primary");
|
||||
.conTent{
|
||||
margin: 0.8rem 0.8rem 0.8rem 1.6rem;
|
||||
font-family: 'Nunito', sans-serif;
|
||||
font-weight: bold;
|
||||
}
|
||||
.vecTor{
|
||||
margin: 0.8rem 0rem 0.8rem 0rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
26
src/components/common/ViewAllItem/ViewAllItem.tsx
Normal file
26
src/components/common/ViewAllItem/ViewAllItem.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import Vector from 'src/components/icons/Vector'
|
||||
import s from './ViewAllItem.module.scss'
|
||||
import Link from 'next/link'
|
||||
|
||||
interface Props {
|
||||
className?: string
|
||||
children?: any
|
||||
link?: string
|
||||
}
|
||||
|
||||
const ViewAllItem = ({ link }: Props) => {
|
||||
return(
|
||||
<div className={s.viewAll}>
|
||||
<Link href={"/all"}>
|
||||
<a className={s.conTent}>
|
||||
View All
|
||||
</a>
|
||||
</Link>
|
||||
<div className={s.vecTor}>
|
||||
<Vector />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default ViewAllItem
|
@@ -4,4 +4,6 @@ export { default as CarouselCommon } from './CarouselCommon/CarouselCommon'
|
||||
export { default as QuanittyInput } from './QuanittyInput/QuanittyInput'
|
||||
export { default as LabelCommon } from './LabelCommon/LabelCommon'
|
||||
export { default as Head } from './Head/Head'
|
||||
|
||||
export { default as ViewAllItem} from './ViewAllItem/ViewAllItem'
|
||||
export { default as ItemWishList} from './ItemWishList/ItemWishList'
|
||||
export { default as Logo} from './Logo/Logo'
|
Reference in New Issue
Block a user