Files
web2.0-frontend/src/components/DropDownBox.tsx
T
2022-07-25 00:07:27 +03:00

41 lines
805 B
TypeScript

import React from "react";
import styled from "styled-components";
import colors from "@theme/colors";
interface DropDownBoxProps {
onMouseEnter: () => void;
onMouseLeave: () => void;
visible: boolean;
children: React.ReactNode;
}
const Box = styled.div`
background-color: ${colors.white};
border: 1px solid ${colors.black};
margin-top: 0.8rem;
position: absolute;
left: 0;
top: 2.5rem;
z-index: 20;
a {
text-decoration: underline;
color: ${colors.darkBlue} !important;
text-transform: uppercase;
}
`;
const DropDownBox: React.FC<DropDownBoxProps> = ({
children, onMouseEnter, onMouseLeave, visible,
}) => (
<Box
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
hidden={!visible}
>
{children}
</Box>
);
export default DropDownBox;