-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore(web): Add InsertionButton (#496)
Co-authored-by: JAESUNG_PARK <[email protected]> Co-authored-by: JAESUNG_PARK <[email protected]> Co-authored-by: 長田淳史 <> Co-authored-by: KaWaite <[email protected]>
- Loading branch information
1 parent
d342489
commit b55cc94
Showing
4 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import InsertionButton from "."; | ||
|
||
export default { | ||
component: InsertionButton, | ||
} as Meta; | ||
|
||
type Story = StoryObj<typeof InsertionButton>; | ||
|
||
export const Default: Story = {}; |
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,52 @@ | ||
import Icon from "@reearth/beta/components/Icon"; | ||
import { styled } from "@reearth/services/theme"; | ||
|
||
type Props = { | ||
onClick?: () => void; | ||
}; | ||
|
||
const InsertionButton: React.FC<Props> = ({ onClick }) => { | ||
return ( | ||
<Box onClick={onClick}> | ||
<StyledIcon icon={"plus"} size={9.75} /> | ||
<Border /> | ||
</Box> | ||
); | ||
}; | ||
|
||
const Box = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
padding: 2px 0px; | ||
gap: 4px; | ||
border-radius: 6px; | ||
opacity: 0; | ||
:hover { | ||
opacity: 1; | ||
transition: all 0.5s ease; | ||
} | ||
:not(:hover) { | ||
transition: all 0.5s ease; | ||
} | ||
cursor: pointer; | ||
`; | ||
|
||
const Border = styled.object` | ||
height: 1px; | ||
width: 100%; | ||
background: ${props => props.theme.general.select}; | ||
border-radius: 1px; | ||
`; | ||
|
||
const StyledIcon = styled(Icon)` | ||
background: ${props => props.theme.general.select}; | ||
border-radius: 50%; | ||
padding: 2px; | ||
color: ${props => props.theme.general.bg.transparent}; | ||
`; | ||
|
||
export default InsertionButton; |