Styling and icon fixes for cart sidebar

This commit is contained in:
paco
2020-10-08 18:00:05 -06:00
parent ccf6074573
commit f9660b4bc2
9 changed files with 85 additions and 16 deletions

View File

@@ -16,6 +16,7 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
active?: boolean
type?: 'submit' | 'reset' | 'button'
Component?: string | JSXElementConstructor<any>
width?: string | number
}
const Button: React.FC<ButtonProps> = forwardRef((props, buttonRef) => {
@@ -27,6 +28,7 @@ const Button: React.FC<ButtonProps> = forwardRef((props, buttonRef) => {
active,
onClick,
disabled,
width,
Component = 'button',
...rest
} = props
@@ -59,6 +61,9 @@ const Button: React.FC<ButtonProps> = forwardRef((props, buttonRef) => {
ref={mergeRefs([ref, buttonRef])}
{...rest}
{...buttonProps}
style={{
width,
}}
data-active={isPressed ? '' : undefined}
>
{children}

View File

@@ -72,8 +72,8 @@ const Sidebar: FC<Props> = ({ className, children, show = true, close }) => {
leaveFrom="translate-x-0"
leaveTo="translate-x-full"
>
<div className="h-full w-screen max-w-2xl">
<div className="h-full flex flex-col space-y-6 bg-white shadow-xl overflow-y-auto">
<div className="h-full w-screen max-w-md">
<div className="h-full flex flex-col bg-white shadow-xl overflow-y-auto">
{children}
</div>
</div>