Sidebar Styling issues with Mobile

This commit is contained in:
Bel Curcio 2021-06-01 17:40:39 -03:00
parent 3414739913
commit c1535cb8a6
10 changed files with 59 additions and 28 deletions

View File

@ -38,13 +38,13 @@ const CartSidebarView: FC = () => {
[s.empty]: error || success || isLoading || isEmpty, [s.empty]: error || success || isLoading || isEmpty,
})} })}
> >
<header className="px-4 pt-6 pb-4 sm:px-6"> <header className="pl-4 pr-6 pt-4 pb-4 lg:pt-6">
<div className="flex items-start justify-between space-x-3"> <div className="flex items-start justify-between space-x-3">
<div className="h-7 flex items-center"> <div className="h-7 flex items-center">
<button <button
onClick={handleClose} onClick={handleClose}
aria-label="Close panel" aria-label="Close panel"
className="hover:text-gray-500 transition ease-in-out duration-150 flex items-center focus:outline-none" className="hover:text-accent-3 transition ease-in-out duration-150 flex items-center focus:outline-none"
> >
<Cross className="h-6 w-6" /> <Cross className="h-6 w-6" />
<span className="ml-2 text-accent-7 text-xs hover:text-gray-500"> <span className="ml-2 text-accent-7 text-xs hover:text-gray-500">

View File

@ -45,7 +45,7 @@ const CheckoutSidebarView: FC = () => {
[s.empty]: error || success || isLoading || isEmpty, [s.empty]: error || success || isLoading || isEmpty,
})} })}
> >
<header className="px-4 pt-6 pb-4 sm:px-6"> <header className="pl-4 pr-6 pt-4 pb-4 lg:pt-6">
<div className="flex items-start justify-between space-x-3"> <div className="flex items-start justify-between space-x-3">
<div className="h-7 flex items-center"> <div className="h-7 flex items-center">
<button <button

View File

@ -11,7 +11,7 @@ const PaymentMethodView: FC = () => {
return ( return (
<div className={s.root}> <div className={s.root}>
<header className="px-4 pt-6 pb-4 sm:px-6"> <header className="pl-4 pr-6 pt-4 pb-4 lg:pt-6">
<div className="flex items-start justify-between space-x-3"> <div className="flex items-start justify-between space-x-3">
<div className="h-7 flex items-center"> <div className="h-7 flex items-center">
<button <button

View File

@ -11,7 +11,7 @@ const PaymentMethodView: FC = () => {
return ( return (
<div className={s.root}> <div className={s.root}>
<header className="px-4 pt-6 pb-4 sm:px-6"> <header className="pl-4 pr-6 pt-4 pb-4 lg:pt-6">
<div className="flex items-start justify-between space-x-3"> <div className="flex items-start justify-between space-x-3">
<div className="h-7 flex items-center"> <div className="h-7 flex items-center">
<button <button

View File

@ -3,6 +3,15 @@
overflow-y: hidden; overflow-y: hidden;
} }
.slider {
@apply relative h-full transition-opacity duration-150;
opacity: 0;
}
.slider.show {
opacity: 1;
}
.control { .control {
@apply bg-violet absolute bottom-10 right-10 flex flex-row @apply bg-violet absolute bottom-10 right-10 flex flex-row
border-accent-0 border text-accent-0 z-30 shadow-xl; border-accent-0 border text-accent-0 z-30 shadow-xl;
@ -36,23 +45,46 @@
.thumb { .thumb {
@apply transition-transform transition-colors ease-linear duration-75 overflow-hidden @apply transition-transform transition-colors ease-linear duration-75 overflow-hidden
inline-block cursor-pointer; inline-block cursor-pointer;
width: 275px; width: 125px;
} }
.thumb:focus,
.thumb.selected { .thumb.selected {
@apply bg-white; @apply bg-white;
} }
.thumb:hover {
transform: scale(1.02);
background-color: rgba(255, 255, 255, 0.08);
}
.album { .album {
@apply bg-violet-dark; @apply bg-violet-dark;
overflow-y: hidden; overflow-y: hidden;
overflow-x: auto; overflow-x: auto;
white-space: nowrap; white-space: nowrap;
height: 275px; height: 125px;
}
@screen md {
.thumb:hover {
transform: scale(1.02);
background-color: rgba(255, 255, 255, 0.08);
}
.thumb.selected {
@apply bg-white;
}
.album {
height: 235px;
}
.slider {
max-height: 700px;
}
.thumb {
width: 235px;
}
}
@screen lg {
.slider {
max-height: 750px;
}
} }

View File

@ -77,8 +77,7 @@ const ProductSlider: FC = ({ children }) => {
<div className={s.root} ref={sliderContainerRef}> <div className={s.root} ref={sliderContainerRef}>
<div <div
ref={ref} ref={ref}
className="relative keen-slider h-full transition-opacity duration-150" className={cn(s.slider, { [s.show]: isMounted }, 'keen-slider')}
style={{ opacity: isMounted ? 1 : 0 }}
> >
{slider && ( {slider && (
<div className={s.control}> <div className={s.control}>

View File

@ -4,7 +4,7 @@
.main { .main {
@apply relative px-0 pb-0 box-border flex flex-col col-span-1; @apply relative px-0 pb-0 box-border flex flex-col col-span-1;
min-height: 600px; min-height: 500px;
} }
.nameBox { .nameBox {
@ -22,13 +22,17 @@
} }
.sidebar { .sidebar {
@apply flex flex-col col-span-1 mx-auto max-w-8xl px-6 w-full h-full; @apply flex flex-col col-span-1 mx-auto max-w-8xl px-6 py-6 w-full h-full;
} }
.sliderContainer { .sliderContainer {
@apply flex items-center justify-center overflow-x-hidden bg-violet; @apply flex items-center justify-center overflow-x-hidden bg-violet;
} }
.imageContainer {
@apply text-center;
}
.imageContainer > div, .imageContainer > div,
.imageContainer > div > div { .imageContainer > div > div {
@apply h-full; @apply h-full;
@ -39,7 +43,7 @@
} }
.button { .button {
min-width: 300px; width: 100%;
} }
.wishlistButton { .wishlistButton {
@ -47,13 +51,7 @@
} }
@screen md { @screen md {
.main {
min-height: 700px;
}
.button { .button {
text-align: center;
width: 100%;
max-width: 300px; max-width: 300px;
} }
} }

View File

@ -185,7 +185,6 @@ const ProductView: FC<Props> = ({ product, relatedProducts }) => {
> >
<ProductCard <ProductCard
key={p.path} key={p.path}
className={s.relatedProduct}
variant="simple" variant="simple"
className="animated fadeIn" className="animated fadeIn"
product={p} product={p}

View File

@ -1,3 +1,8 @@
.root { .root {
@apply fixed inset-0 overflow-hidden h-full z-50; @apply fixed inset-0 overflow-hidden h-full z-50;
} }
.sidebar {
@apply h-full flex flex-col text-base bg-accent-0 shadow-xl overflow-y-auto;
min-width: 335px;
}

View File

@ -43,9 +43,7 @@ const Sidebar: FC<Props> = ({ children, open = false, onClose }) => {
/> />
<section className="absolute inset-y-0 right-0 pl-10 max-w-full flex sm:pl-16 outline-none"> <section className="absolute inset-y-0 right-0 pl-10 max-w-full flex sm:pl-16 outline-none">
<div className="h-full md:w-screen md:max-w-md"> <div className="h-full md:w-screen md:max-w-md">
<div className="h-full flex flex-col text-base bg-accent-0 shadow-xl overflow-y-auto"> <div className={s.sidebar}>{children}</div>
{children}
</div>
</div> </div>
</section> </section>
</div> </div>