Skip to content
This repository was archived by the owner on Feb 23, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
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
16 changes: 16 additions & 0 deletions src/Containers/Chair/AdvancedChair.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';
import { Meta, Story } from '@storybook/react';
import { AdvancedChair, IAdvancedChair } from './AdvancedChair';
import { createStoryTitle } from '../../Constants';

export default {
title: createStoryTitle('AdvancedChair'),
component: AdvancedChair,
} as Meta;

const Template: Story<IAdvancedChair> = (args) => <AdvancedChair {...args}/>;

export const VacantChair = Template.bind({});
VacantChair.args = {

};
70 changes: 70 additions & 0 deletions src/Containers/Chair/AdvancedChair.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import React from 'react';
import styled from "styled-components";

type Position = 'top' | 'bottom' | 'left' | 'right';

export interface IAdvancedChair {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re use existing interface

position: Position;
isVisible: boolean;
relativeSize: number;
}

export const AdvancedChair: React.FC<IAdvancedChair> = ({
position = 'top',
isVisible = true,
relativeSize = 1.0,
...props
}) => {
return (
<div{...props}>
<ChairBody>
<BackOfChair>
</BackOfChair>
<ChairSeat>
</ChairSeat>
<TopChairLeg>
</TopChairLeg>
<
>
<BottomChairLeg >
</BottomChairLeg >
</>
</ChairBody>
</div>
)
}

const ChairBody = styled.div`
display: grid;
grid-template-columns: 7px 21px 4px;
grid-template-rows: 2px 3px 5px 12px 5px 3px 2px;
grid-template-areas:
"back . ."
"back seat ."
"back seat firstleg"
"back seat ."
"back seat secondleg"
"back seat ."
"back . ."
`;
const BackOfChair = styled.div`
grid-area: back;
border-radius: 1px 3px 3px 1px;

background: linear-gradient(to right, #6495ED, #adbcf9);
`;
const ChairSeat = styled.div`
grid-area: seat;
border-radius: 0px 3px 3px 0px;
background: linear-gradient(to right, #6495ED, #adbcf9);
`;
const TopChairLeg = styled.div`
grid-area: firstleg;
border-radius: 0px 3px 3px 0px;
background: #6495ED;
`;
const BottomChairLeg = styled.div`
grid-area: secondleg;
border-radius: 0px 3px 3px 0px;
background: #6495ED;
`;