Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore(web): Add InsertionButton #496

Merged
merged 14 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions web/src/beta/components/Icon/Icons/plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions web/src/beta/components/Icon/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ import PlayRight from "./Icons/play-right.svg";
import PlayLeft from "./Icons/play-left.svg";
import Ellipse from "./Icons/ellipse.svg";

// Plus
import Plus from "./Icons/plus.svg";

export default {
file: File,
dl: InfoTable,
Expand All @@ -55,6 +58,7 @@ export default {
ellipse: Ellipse,
playRight: PlayRight,
playLeft: PlayLeft,
plus: Plus,
timeline: Timeline,
actionbutton: ActionButton,
};
11 changes: 11 additions & 0 deletions web/src/beta/components/InsertionButton/index.stories.tsx
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 = {};
54 changes: 54 additions & 0 deletions web/src/beta/components/InsertionButton/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { FC } from "react";

import { styled } from "@reearth/services/theme";

import Icon from "../Icon";

type Props = {
onClick?: () => void;
};

const InsertionButton: FC<Props> = ({ onClick }) => {
return (
<Box onClick={onClick}>
<Icon
icon={"plus"}
style={{
width: "9.75px",
height: "9.75px",
background: "#3b3cd0",
borderRadius: "50%",
padding: "2px",
color: "black",
}}
/>
<Border />
</Box>
);
};

const Box = styled.div`
keiya01 marked this conversation as resolved.
Show resolved Hide resolved
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;
}
cursor: pointer;
`;

const Border = styled.object`
height: 1px;
width: 100%;

background: ${props => props.theme.main.select};
border-radius: 1px;
`;
export default InsertionButton;