2022-12-15 20:23:11 +00:00
|
|
|
import styled from 'styled-components';
|
|
|
|
|
|
|
|
interface DisplayPropType {
|
2022-12-17 20:35:40 +00:00
|
|
|
show?: number;
|
2022-12-15 20:23:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
interface ActivePropType {
|
2022-12-17 20:35:40 +00:00
|
|
|
active?: number;
|
2022-12-15 20:23:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const ThemeDropDown = styled.div`
|
2022-12-15 20:36:15 +00:00
|
|
|
margin-left: 1%;
|
2022-12-15 20:23:11 +00:00
|
|
|
min-width: 180px;
|
|
|
|
color: ${({ theme }) => theme.colors.primary}
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
`
|
|
|
|
|
2022-12-17 00:56:41 +00:00
|
|
|
export const ThemeDropDownButton = styled.button<DisplayPropType>`
|
|
|
|
width: 160px;
|
2022-12-15 20:23:11 +00:00
|
|
|
border: 1px solid;
|
2022-12-17 00:56:41 +00:00
|
|
|
border-radius: 5px;
|
2022-12-15 20:23:11 +00:00
|
|
|
background-color: ${({ theme }) => theme.colors.background};
|
|
|
|
padding: 0.2rem 0.5rem;
|
|
|
|
cursor: pointer;
|
|
|
|
color: ${({ theme }) => theme.colors.primary};
|
2022-12-17 00:56:41 +00:00
|
|
|
|
|
|
|
transition-property: color, border-bottom-left-radius, border-bottom-right-radius;
|
|
|
|
transition-timing-function: ease;
|
|
|
|
transition-duration: 0.15s;
|
2022-12-17 23:25:43 +00:00
|
|
|
transition-delay: 0s, ${ props => props.show ? "0s, 0s" : "0.6s, 0.6s" };
|
2022-12-15 20:23:11 +00:00
|
|
|
|
2022-12-15 21:33:40 +00:00
|
|
|
&:focus,:hover {
|
2022-12-15 20:23:11 +00:00
|
|
|
color: ${({ theme }) => theme.colors.secondary};
|
|
|
|
}
|
2022-12-17 00:56:41 +00:00
|
|
|
|
|
|
|
border-bottom-left-radius: ${ props => props.show ? "0" : "" };
|
|
|
|
border-bottom-right-radius: ${ props => props.show ? "0" : "" };
|
2022-12-15 20:23:11 +00:00
|
|
|
`
|
|
|
|
|
|
|
|
export const ThemeDropDownOptions = styled.div<DisplayPropType>`
|
2022-12-15 20:36:15 +00:00
|
|
|
position: absolute;
|
2022-12-15 20:23:11 +00:00
|
|
|
color: ${({ theme }) => theme.colors.primary};
|
|
|
|
background-color: ${({ theme }) => theme.colors.background};
|
2022-12-17 00:56:41 +00:00
|
|
|
display: flex;
|
2022-12-15 20:23:11 +00:00
|
|
|
flex-direction: column;
|
|
|
|
min-width: 160px;
|
2022-12-17 00:56:41 +00:00
|
|
|
border: 1px solid;
|
|
|
|
border-top: 0;
|
|
|
|
border-radius: 5px;
|
|
|
|
border-top-left-radius: 0px; border-top-right-radius: 0px;
|
2022-12-15 20:23:11 +00:00
|
|
|
z-index: 1;
|
2022-12-17 00:56:41 +00:00
|
|
|
overflow: hidden;
|
|
|
|
max-height: ${ props => props.show ? "20%" : "0%" };
|
|
|
|
visibility: ${ props => props.show ? "visible" : "hidden" };
|
|
|
|
|
|
|
|
transition-property: max-height, visibility;
|
|
|
|
transition-timing-function: ease-in-out;
|
|
|
|
transition-duration: 0.6s, 0s;
|
|
|
|
transition-delay: 0s, ${ props => props.show ? "0s" : "0.5s" };
|
2022-12-15 20:23:11 +00:00
|
|
|
`
|
|
|
|
|
|
|
|
export const ThemeDropDownOption = styled.button<ActivePropType>`
|
|
|
|
color: ${ props => props.active ? ({ theme }) => theme.colors.secondary : ({ theme }) => theme.colors.primary };
|
|
|
|
background-color: ${({ theme }) => theme.colors.background};
|
2022-12-17 20:35:40 +00:00
|
|
|
cursor: pointer;
|
2022-12-17 00:56:41 +00:00
|
|
|
align-self: center;
|
|
|
|
border: 0px solid;
|
2022-12-15 20:23:11 +00:00
|
|
|
padding: 0.2rem 0.5rem;
|
|
|
|
text-decoration: none;
|
2022-12-17 00:56:41 +00:00
|
|
|
width: 90%;
|
2022-12-15 20:23:11 +00:00
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: ${({ theme }) => theme.colors.secondary};
|
|
|
|
}
|
|
|
|
`
|