Skip to content

Commit

Permalink
Fix sidebar in Storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
dv297 committed Oct 20, 2022
1 parent 5cdec24 commit 1a2968e
Showing 1 changed file with 72 additions and 68 deletions.
140 changes: 72 additions & 68 deletions src/stories/ApplicationStyling.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useState } from 'react';
import {
ClipboardCheckIcon,
FolderIcon,
Expand Down Expand Up @@ -69,78 +69,82 @@ const ColorSwatch = (props: ColorSwatchProp) => {
};

// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
const Template: ComponentStory<typeof EditableTextDisplay> = () => (
<>
<_AppContext.Provider
value={{
teams: [],
workspaces: [],
userPreferences: {
userId: '',
hasFinishedSetup: true,
id: '',
workspaceId: '',
teamId: '',
},
selectedWorkspace: {
name: '',
id: '',
tag: '',
},
selectedTeam: {
name: '',
id: '',
},
}}
>
<Sidebar
header={
<div className="cursor-pointer">
<div className="flex flex-row items-center">
<div>
<ArrowBackIcon />
const Template: ComponentStory<typeof EditableTextDisplay> = () => {
const [sidebarOpen, setSidebarOpen] = useState(false);

return (
<>
<_AppContext.Provider
value={{
teams: [],
workspaces: [],
userPreferences: {
userId: '',
hasFinishedSetup: true,
id: '',
workspaceId: '',
teamId: '',
},
selectedWorkspace: {
name: '',
id: '',
tag: '',
},
selectedTeam: {
name: '',
id: '',
},
}}
>
<Sidebar
header={
<div className="cursor-pointer">
<div className="flex flex-row items-center">
<div>
<ArrowBackIcon />
</div>
<span className="ml-2 font-bold text-md">Back</span>
</div>
<span className="ml-2 font-bold text-md">Back</span>
</div>
</div>
}
footer={
<button
className={
'sidebar-element group flex items-center px-2 py-2 text-sm font-medium rounded-md w-full'
}
onClick={() => {}}
>
<PeopleIcon
}
footer={
<button
className={
'text-gray-400 group-hover:text-gray-300 mr-3 flex-shrink-0 h-6 w-6'
'sidebar-element group flex items-center px-2 py-2 text-sm font-medium rounded-md w-full'
}
aria-hidden="true"
/>
Personal
</button>
}
navigation={navigation}
setSidebarOpen={() => {}}
sidebarOpen
/>
<DashboardBodyLayout setSidebarOpen={() => {}} isLoading={false}>
<ConstrainDashboardContainer>
<p className="mb-4 font-bold text-lg">Color Swatches</p>
<div className="flex flex-col gap-y-4">
<div className="flex flex-row gap-x-4">
<ColorSwatch className="bg-accent-blue-900" />
<ColorSwatch className="bg-accent-blue-700" />
<ColorSwatch className="bg-accent-blue-500" />
<ColorSwatch className="bg-accent-blue-300" />
<ColorSwatch className="bg-accent-blue-100" />
onClick={() => {}}
>
<PeopleIcon
className={
'text-gray-400 group-hover:text-gray-300 mr-3 flex-shrink-0 h-6 w-6'
}
aria-hidden="true"
/>
Personal
</button>
}
navigation={navigation}
setSidebarOpen={setSidebarOpen}
sidebarOpen={sidebarOpen}
/>
<DashboardBodyLayout setSidebarOpen={setSidebarOpen} isLoading={false}>
<ConstrainDashboardContainer>
<p className="mb-4 font-bold text-lg">Color Swatches</p>
<div className="flex flex-col gap-y-4">
<div className="flex flex-row gap-x-4">
<ColorSwatch className="bg-accent-blue-900" />
<ColorSwatch className="bg-accent-blue-700" />
<ColorSwatch className="bg-accent-blue-500" />
<ColorSwatch className="bg-accent-blue-300" />
<ColorSwatch className="bg-accent-blue-100" />
</div>
</div>
</div>
</ConstrainDashboardContainer>
</DashboardBodyLayout>
</_AppContext.Provider>
</>
);
</ConstrainDashboardContainer>
</DashboardBodyLayout>
</_AppContext.Provider>
</>
);
};

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

1 comment on commit 1a2968e

@vercel
Copy link

@vercel vercel bot commented on 1a2968e Oct 20, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

planner – ./

planner-dv297.vercel.app
planner-nine.vercel.app
planner-git-main-dv297.vercel.app

Please sign in to comment.