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 all 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 @@ -51,6 +51,9 @@ import Workspaces from "./Icons/workspaces.svg";
import Square from "./Icons/square.svg";
import TwoRectangle from "./Icons/two-rectangle.svg";

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

export default {
file: File,
dl: InfoTable,
Expand All @@ -74,6 +77,7 @@ export default {
playRight: PlayRight,
playLeft: PlayLeft,
square: Square,
plus: Plus,
timeline: Timeline,
twoRectangle: TwoRectangle,
actionbutton: ActionButton,
Expand Down
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 = {};
52 changes: 52 additions & 0 deletions web/src/beta/components/InsertionButton/index.tsx
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`
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;
}
: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;