Merge branch 'common' of https://github.com/KieIO/grocery-vercel-commerce into m6-quangnhan

This commit is contained in:
quangnhankie 2021-09-08 16:07:09 +07:00
commit b517ae69d6
12 changed files with 60 additions and 33 deletions

View File

@ -42,7 +42,7 @@
@apply hidden; @apply hidden;
@screen md { @screen md {
@apply flex items-center list-none; @apply flex items-center list-none;
li { > li {
@apply flex justify-center items-center w-full; @apply flex justify-center items-center w-full;
&:not(:last-child) { &:not(:last-child) {
margin-right: 4.8rem; margin-right: 4.8rem;
@ -53,7 +53,7 @@
a { a {
@appy no-underline; @appy no-underline;
&:hover { &:hover {
opacity: .8; opacity: 0.8;
} }
&.iconFavourite { &.iconFavourite {
svg path { svg path {
@ -61,7 +61,14 @@
} }
} }
} }
.btnCart {
&:hover {
svg path {
fill: var(--primary);
opacity: 0.8;
}
}
}
} }
} }
} }

View File

@ -68,7 +68,7 @@ const HeaderMenu = memo(({ isFull, openModalAuthen, openModalInfo }: Props) => {
<MenuDropdown options={optionMenu} isHasArrow={false}><IconUser /></MenuDropdown> <MenuDropdown options={optionMenu} isHasArrow={false}><IconUser /></MenuDropdown>
</li> </li>
<li> <li>
<button> <button className={s.btnCart}>
<IconBuy /> <IconBuy />
</button> </button>
</li> </li>

View File

@ -3,9 +3,6 @@
.menuDropdown { .menuDropdown {
@apply relative cursor-pointer; @apply relative cursor-pointer;
width: fit-content; width: fit-content;
.label {
all: unset;
}
&:hover { &:hover {
.label { .label {
color: var(--primary); color: var(--primary);
@ -20,10 +17,21 @@
} }
.label { .label {
all: unset;
@apply flex justify-end items-center transition-all duration-200; @apply flex justify-end items-center transition-all duration-200;
svg path { svg path {
width: fit-content; width: fit-content;
} }
&:focus,
&:active {
color: var(--primary);
svg path {
fill: currentColor;
}
}
&:focus-visible {
outline: 2px solid #000;
}
} }
&.arrow { &.arrow {
@ -66,18 +74,9 @@
@apply rounded list-none bg-white; @apply rounded list-none bg-white;
border: 1px solid var(--text-active); border: 1px solid var(--text-active);
margin-top: 0.4rem; margin-top: 0.4rem;
li { > li {
@apply block w-full transition-all duration-200 cursor-pointer text-active; @apply block w-full transition-all duration-200 cursor-pointer text-active;
word-wrap: break-word;
-webkit-hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
overflow-x: hidden;
position: relative;
max-width: 15rem;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis;
button { button {
all: unset; all: unset;
color: currentColor; color: currentColor;

View File

@ -1,7 +1,6 @@
import Link from 'next/link' import Link from 'next/link'
import React, { useEffect, useRef } from 'react' import React, { useEffect, useRef } from 'react'
import { ButtonCommon, Inputcommon } from 'src/components/common' import { ButtonCommon, Inputcommon, InputPassword } from 'src/components/common'
import InputPassword from 'src/components/common/InputPassword/InputPassword'
import { ROUTE } from 'src/utils/constanst.utils' import { ROUTE } from 'src/utils/constanst.utils'
import { CustomInputCommon } from 'src/utils/type.utils' import { CustomInputCommon } from 'src/utils/type.utils'
import s from '../FormAuthen.module.scss' import s from '../FormAuthen.module.scss'

View File

@ -1,5 +1,5 @@
import React, { useEffect, useRef } from 'react' import React, { useEffect, useRef } from 'react'
import { ButtonCommon, Inputcommon } from 'src/components/common' import { ButtonCommon, Inputcommon, InputPassword } from 'src/components/common'
import s from '../FormAuthen.module.scss' import s from '../FormAuthen.module.scss'
import styles from './FormRegister.module.scss' import styles from './FormRegister.module.scss'
import SocialAuthen from '../SocialAuthen/SocialAuthen' import SocialAuthen from '../SocialAuthen/SocialAuthen'

View File

@ -2,6 +2,11 @@
.select { .select {
background-color: var(--white); background-color: var(--white);
.selectTrigger {
svg {
@apply transition-all duration-200;
}
}
&.base { &.base {
width: 20.6rem; width: 20.6rem;
.selectTrigger { .selectTrigger {
@ -19,7 +24,7 @@
&.default { &.default {
.selectTrigger { .selectTrigger {
@apply border-solid border border-current; @apply border-solid border border-current;
} }
} }
&.custom { &.custom {
.selectTrigger { .selectTrigger {
@ -34,13 +39,17 @@
@apply block; @apply block;
animation: SelectAnimation 0.2s ease-out; animation: SelectAnimation 0.2s ease-out;
} }
.selectTrigger {
svg {
transform: rotate(180deg);
}
}
} }
} }
.selectTrigger { .selectTrigger {
@apply outline-none flex justify-between; @apply outline-none flex justify-between;
color: var(--text-active); color: var(--text-active);
border-radius: 0.8rem; border-radius: 0.8rem;
} }
.hoverWrapper { .hoverWrapper {
@apply hidden outline-none absolute z-10; @apply hidden outline-none absolute z-10;
@ -56,7 +65,7 @@
width: 34.25rem; width: 34.25rem;
} }
&.default { &.default {
@apply border-solid border border-current; @apply border-solid border border-current;
} }
&.custom { &.custom {
@apply border-2; @apply border-2;
@ -69,7 +78,6 @@
} }
} }
@keyframes SelectAnimation { @keyframes SelectAnimation {
0% { 0% {
opacity: 0; opacity: 0;

View File

@ -44,7 +44,7 @@ const SelectCommon = ({ type = 'default', size = 'base', option, placeholder, on
> >
{ {
option.map(item => option.map(item =>
<SelectOption itemName={item.name} value={item.value} onClick={changeSelectedName} size={size} selected={(selectedValue === item.value)} /> <SelectOption key={item.value} itemName={item.name} value={item.value} onClick={changeSelectedName} size={size} selected={(selectedValue === item.value)} />
) )
} }
</div> </div>

View File

@ -13,6 +13,7 @@
} }
&:hover{ &:hover{
background-color: var(--gray); background-color: var(--gray);
color: var(--primary);
} }
&.isChoose{ &.isChoose{
background-color: var(--gray); background-color: var(--gray);

View File

@ -11,11 +11,19 @@
@apply grid; @apply grid;
grid-template-columns: 1fr 1.8fr; grid-template-columns: 1fr 1.8fr;
.left { .left {
@apply flex items-end justify-center custom-border-radius-lg; @apply relative flex items-end justify-center custom-border-radius-lg;
margin-right: 1.6rem; margin-right: 1.6rem;
background-image: url('./assets/home_banner.png'); .imgWrap {
background-repeat: no-repeat; @apply absolute w-full h-full;
background-size: cover; top: 0;
left: 0;
> div {
@apply w-full h-full custom-border-radius-lg;
}
img {
object-fit: cover;
}
}
.text { .text {
@apply relative font-heading text-center; @apply relative font-heading text-center;

View File

@ -1,8 +1,9 @@
import React from 'react' import React from 'react'
import { Banner } from 'src/components/common' import { Banner } from 'src/components/common'
import s from './HomeBanner.module.scss'
import BannerImgRight from './assets/banner_full.png' import BannerImgRight from './assets/banner_full.png'
import BannerImgRight2 from './assets/banner_product.png' import HomeBannerImg from './assets/home_banner.png'
import s from './HomeBanner.module.scss'
import Image from 'next/image'
interface Props { interface Props {
className?: string className?: string
@ -13,6 +14,9 @@ const HomeBanner = ({ }: Props) => {
return ( return (
<div className={s.homeBanner}> <div className={s.homeBanner}>
<section className={s.left}> <section className={s.left}>
<div className={s.imgWrap}>
<Image src={HomeBannerImg} placeholder='blur' />
</div>
<div className={s.text}> <div className={s.text}>
Freshness<br />guaranteed Freshness<br />guaranteed
</div> </div>
@ -28,10 +32,10 @@ const HomeBanner = ({ }: Props) => {
{ {
title: "Save 15% on your first order 2", title: "Save 15% on your first order 2",
subtitle: "Last call! Shop deep deals on 100+ bulk picks while you can.", subtitle: "Last call! Shop deep deals on 100+ bulk picks while you can.",
imgLink: BannerImgRight2.src, imgLink: BannerImgRight.src,
size: "small", size: "small",
} }
] ]
} }
/> />
</div > </div >

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 KiB

View File

@ -149,6 +149,7 @@
.line { .line {
@apply flex justify-between items-center; @apply flex justify-between items-center;
> div { > div {
flex: 1;
&:not(:last-child) { &:not(:last-child) {
margin-right: 1.6rem; margin-right: 1.6rem;
} }