generated from semicolondsm/Semicolon_Repository_Generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
186bb0d
commit aec82d1
Showing
2 changed files
with
60 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import styled from "@emotion/styled"; | ||
import React, { FC, useState } from "react"; | ||
import Image from "next/image"; | ||
import Plus from "../../../assets/plus.svg"; | ||
import Plus_White from "../../../assets/plus_white.svg"; | ||
|
||
interface Props { | ||
width: number; | ||
height: number; | ||
} | ||
|
||
const CreateBox: FC<Props> = props => { | ||
const [isHover, setIsHover] = useState<boolean>(false); | ||
|
||
return ( | ||
<> | ||
<DefaultBoxStyle {...props}> | ||
<PlusBtn | ||
onMouseOver={() => setIsHover(true)} | ||
onMouseOut={() => setIsHover(false)} | ||
> | ||
{props.children} | ||
<Image | ||
src={isHover ? Plus_White : Plus} | ||
alt='plus' | ||
width={50} | ||
height={50} | ||
/> | ||
</PlusBtn> | ||
</DefaultBoxStyle> | ||
</> | ||
); | ||
}; | ||
|
||
export default CreateBox; | ||
|
||
const DefaultBoxStyle = styled.div<{ | ||
width: number; | ||
height: number; | ||
}>` | ||
width: ${({ width }) => `${width}px`}; | ||
height: ${({ height }) => `${height}px`}; | ||
border-radius: 12px; | ||
border: 1px solid ${({ theme }) => theme.color.normal_gray}; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
cursor: pointer; | ||
`; | ||
|
||
const PlusBtn = styled.div` | ||
height: 100%; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
`; |