🎨 styles: animation icon select common

:%s
This commit is contained in:
lytrankieio123 2021-09-08 15:32:07 +07:00
parent 670343c06c
commit b4edbf8c8a
4 changed files with 15 additions and 5 deletions

View File

@ -23,6 +23,7 @@ export default function Home() {
return ( return (
<> <>
<SelectCommon option={OPTION_TEST} placeholder="Sort By" onChange={handleChange} /> <SelectCommon option={OPTION_TEST} placeholder="Sort By" onChange={handleChange} />
<SelectCommon option={OPTION_TEST} placeholder="Sort By" onChange={handleChange} type='custom'/>
</> </>
) )
} }

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 {
@ -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;
@ -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);