mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Adding Sidebar
This commit is contained in:
2
components/ui/Sidebar/Sidebar.module.css
Normal file
2
components/ui/Sidebar/Sidebar.module.css
Normal file
@@ -0,0 +1,2 @@
|
||||
.root {
|
||||
}
|
29
components/ui/Sidebar/Sidebar.tsx
Normal file
29
components/ui/Sidebar/Sidebar.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import cn from "classnames";
|
||||
import React, { FunctionComponent } from "react";
|
||||
import s from "./Sidebar.module.css";
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
children?: any;
|
||||
}
|
||||
|
||||
const Sidebar: FunctionComponent<Props> = ({ className, children }) => {
|
||||
const rootClassName = cn(s.root, className);
|
||||
return (
|
||||
<div className={rootClassName}>
|
||||
<div className="fixed inset-0 overflow-hidden">
|
||||
<div className="absolute inset-0 overflow-hidden">
|
||||
<section className="absolute inset-y-0 right-0 pl-10 max-w-full flex sm:pl-16 ">
|
||||
<div className="w-screen max-w-2xl">
|
||||
<div className="h-full flex flex-col bg-white shadow-xl overflow-y-scroll">
|
||||
<div className="flex-1">{children}</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Sidebar;
|
1
components/ui/Sidebar/index.ts
Normal file
1
components/ui/Sidebar/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { default } from "./Sidebar";
|
Reference in New Issue
Block a user