refactor: edit classname and export icon

This commit is contained in:
unknown 2021-08-25 18:30:33 +07:00
parent a18eb2b320
commit 7d55bbf46e
8 changed files with 37 additions and 14 deletions

1
.gitignore vendored
View File

@ -4,6 +4,7 @@
node_modules node_modules
/.pnp /.pnp
.pnp.js .pnp.js
package-lock.json
# testing # testing
/coverage /coverage

View File

@ -1,7 +1,27 @@
import { ButtonCommon, Layout, ViewAllItem, ItemWishList, Logo } from 'src/components/common' import { ButtonCommon, Layout, ViewAllItem, ItemWishList, Logo, SelectCommon } from 'src/components/common'
import { IconBuy } from 'src/components/icons' import { IconBuy } from 'src/components/icons'
import { ButonType, ButtonSize } from 'src/utils/constanst.utils' import { ButonType, ButtonSize, } from 'src/utils/constanst.utils'
const OPTION_SORT = [
{
name: 'By Name',
},
{
name: 'Price (Hight to Low)',
},
{
name: 'On Sale',
}
]
const OPTION_STATES = [
{
name: 'Việt Nam'
},
{
name: 'US'
},
]
export default function Home() { export default function Home() {
return ( return (
<> <>
@ -14,11 +34,10 @@ export default function Home() {
<ButtonCommon icon={<IconBuy/>} disabled isIconSuffix={true}>Button with icon disabled</ButtonCommon> <ButtonCommon icon={<IconBuy/>} disabled isIconSuffix={true}>Button with icon disabled</ButtonCommon>
<ButtonCommon icon={<IconBuy/>} type={ButonType.light}>Button with icon</ButtonCommon> <ButtonCommon icon={<IconBuy/>} type={ButonType.light}>Button with icon</ButtonCommon>
<ViewAllItem link="/all"/> <ViewAllItem link="/all"/>
<ItemWishList isActive={true} /> <ItemWishList />
<Logo /> <Logo />
<p>Go to <code>pages/index.tsx</code> to get your hand dirty!</p> <SelectCommon option={OPTION_SORT} placeHolder={"Sort By"}/>
<p>Go to <code>src/components</code> to make your awesome component!</p> <SelectCommon option={OPTION_STATES} placeHolder={"States"} type="custom" size="large"/>
<p>Go to <code>src/styles</code> to find global styles!</p>
</> </>
) )
} }

View File

@ -3,7 +3,6 @@
cursor: pointer; cursor: pointer;
width: 2.4rem; width: 2.4rem;
height: 2.4rem; height: 2.4rem;
} }
.isToggleOn{ .isToggleOn{
svg path{ svg path{

View File

@ -10,7 +10,8 @@
margin-right: 1.2rem; margin-right: 1.2rem;
} }
.conTent{ .conTent{
@apply font-logo sub-headline; @apply font-logo;
font-size: var(--font-size); line-height: 3.2rem;
letter-spacing: -0.02rem;
} }
} }

View File

@ -3,11 +3,11 @@
.viewAll{ .viewAll{
display: flex; display: flex;
color: theme("colors.primary"); color: theme("colors.primary");
.conTent{ .content{
margin: 0.8rem 0.8rem 0.8rem 1.6rem; margin: 0.8rem 0.8rem 0.8rem 1.6rem;
font-weight: bold; font-weight: bold;
} }
.vecTor{ .vector{
margin: 0.8rem 0rem 0.8rem 0rem; margin: 0.8rem 0rem 0.8rem 0rem;
svg path{ svg path{
fill: theme("colors.primary"); fill: theme("colors.primary");

View File

@ -10,11 +10,11 @@ const ViewAllItem = ({ link }: Props) => {
return( return(
<div className={s.viewAll}> <div className={s.viewAll}>
<Link href={link}> <Link href={link}>
<a className={s.conTent}> <a className={s.content}>
View All View All
</a> </a>
</Link> </Link>
<div className={s.vecTor}> <div className={s.vector}>
<IconVector /> <IconVector />
</div> </div>
</div> </div>

View File

@ -4,3 +4,4 @@ export { default as Head } from './Head/Head'
export { default as ViewAllItem} from './ViewAllItem/ViewAllItem' 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 SelectCommon} from './SelectCommon/SelectCommon'

View File

@ -1 +1,3 @@
export { default as IconBuy } from './IconBuy' export { default as IconBuy } from './IconBuy'
export { default as IconHeart } from './IconHeart'
export { default as IconVector } from './IconVector'