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.
Showing
10 changed files
with
191 additions
and
28 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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; | ||
`; |
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
Oops, something went wrong.