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 StorytellingPageSectionItem #495

Merged
merged 20 commits into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
1cb8b2d
chore(web): Add ActionItem component
FabPARKJAESUNG Jun 5, 2023
ce8a404
Chore(web): Add InsertionButton Component
FabPARKJAESUNG Jun 6, 2023
86a0b87
Chore(web): Add StorytellingPageSectionItem
FabPARKJAESUNG Jun 6, 2023
08df726
Fix(web): StorytellingPageSectionItem delete width
FabPARKJAESUNG Jun 7, 2023
174c6fb
Merge branch 'main' into feature/PASONA_PLATEAU-28
FabPARKJAESUNG Jun 7, 2023
6a457b8
Chore(web) : only StorytellingPageSectionItem
FabPARKJAESUNG Jun 8, 2023
a83454a
Fix(web): story test
FabPARKJAESUNG Jun 8, 2023
e1c05f8
Fix(web) : Dont need to in this task
FabPARKJAESUNG Jun 9, 2023
ff7f78e
Fix(web) : StroytellingPageSectionItem design
FabPARKJAESUNG Jun 9, 2023
ff834d6
Fix(web) : use Text component & storybook
FabPARKJAESUNG Jun 9, 2023
e771f09
Update web/src/beta/components/StorytellingPageSectionItem/index.tsx
atnagata Jun 13, 2023
3d4a9b5
Fix(web): Modification by feedback on StorytellingPageSectionItem
FabPARKJAESUNG Jun 13, 2023
f58c98a
Fix(web): Delete default style css
FabPARKJAESUNG Jun 13, 2023
b294179
Fix(web): render to args
FabPARKJAESUNG Jun 14, 2023
8cf7137
Fix(web): add story example and text property break-all
Jun 16, 2023
9d29f79
Merge branch 'main' into feature/PASONA_PLATEAU-28
Jun 20, 2023
60fba0b
Fix(web): changed color theme
FabPARKJAESUNG Jun 20, 2023
5b17a57
Fix(web): wrapper added to icon
Jun 22, 2023
fe1aa9d
Merge branch 'main' into feature/PASONA_PLATEAU-28
KaWaite Jun 23, 2023
b90f801
Merge branch 'main' into feature/PASONA_PLATEAU-28
KaWaite Jun 23, 2023
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/square.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/two-rectangle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions web/src/beta/components/Icon/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ import Logout from "./Icons/logout.svg";
import WorkspaceAdd from "./Icons/workspaceAdd.svg";
import Workspaces from "./Icons/workspaces.svg";

// Square
import Square from "./Icons/square.svg";
import TwoRectangle from "./Icons/two-rectangle.svg";

export default {
file: File,
dl: InfoTable,
Expand All @@ -66,7 +70,9 @@ export default {
ellipse: Ellipse,
playRight: PlayRight,
playLeft: PlayLeft,
square: Square,
timeline: Timeline,
twoRectangle: TwoRectangle,
actionbutton: ActionButton,
dashboard: Dashboard,
help: Help,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Meta, StoryObj } from "@storybook/react";

import StorytellingPageSectionItem from ".";

export default {
component: StorytellingPageSectionItem,
} as Meta;

type Story = StoryObj<typeof StorytellingPageSectionItem>;

export const Default: Story = {
args: {
icon: "square",
title: "New Page",
index: 1,
active: false,
},
};

export const LongText: Story = {
args: {
icon: "square",
title:
"gashjdjahasdasdasdasdasdjjashdjkashdjkahdjkhaskjdhasdasdasdasddfggjsdhasjkdhjkashdkjahskjdhakjshdkahskjdakjshdkjahsdkjhajksdhakjhsdkjhaksjhdakjhsdkjhakjsdhakjhsdkjsadasdasdahskdjhasdasdasdasdasdasdakjsdhksadasd",
index: 1,
active: false,
},
};
74 changes: 74 additions & 0 deletions web/src/beta/components/StorytellingPageSectionItem/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import { FC } from "react";

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

import Icon from "../Icon";
import Text from "../Text";

type Props = {
icon: string;
title: string;
index: number;
active?: boolean;
onAction?: () => void;
onClick?: () => void;
};

const StorytellingPageSectionItem: FC<Props> = ({
icon,
title,
index,
active,
onAction,
onClick,
}) => {
return (
<HorizontalBox>
<VerticalBox>
<Text size={"m"} color="#c7c5c5">
{index}
</Text>
<Icon icon={icon} />
</VerticalBox>
<TitleArea active={active}>
<Text
onClick={onClick}
size={"s"}
color="#ffffff"
otherProperties={{ wordBreak: "break-all" }}>
{title}
</Text>
<Icon icon="actionbutton" onClick={onAction} />
KaWaite marked this conversation as resolved.
Show resolved Hide resolved
</TitleArea>
</HorizontalBox>
);
};

const HorizontalBox = styled.div`
display: flex;
min-height: 56px;
gap: 4px;
cursor: pointer;
`;

const VerticalBox = styled.div`
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 4px;
`;

const TitleArea = styled.div<{ active?: boolean }>`
display: flex;
justify-content: space-between;
padding: 8px;
gap: 4px;

background: ${props => (props.active ? props.theme.main.select : props.theme.main.bg)};
KaWaite marked this conversation as resolved.
Show resolved Hide resolved
border: 1px solid ${props => (props.active ? props.theme.main.select : props.theme.main.border)};
border-radius: 6px;

width: 100%;
`;

export default StorytellingPageSectionItem;