From 99e42d7c529fd2138df7948c7e22fda6c11d97b0 Mon Sep 17 00:00:00 2001 From: Martin Bavio Date: Wed, 4 Nov 2020 14:48:48 -0300 Subject: [PATCH] Fix build --- .../common/FeatureBar/FeatureBar.module.css | 7 ++++ components/common/FeatureBar/FeatureBar.tsx | 39 +++++++++++++++++++ components/common/FeatureBar/index.ts | 1 + hooks/index.ts | 1 - hooks/useCart.ts | 0 5 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 components/common/FeatureBar/FeatureBar.module.css create mode 100644 components/common/FeatureBar/FeatureBar.tsx create mode 100644 components/common/FeatureBar/index.ts delete mode 100644 hooks/index.ts delete mode 100644 hooks/useCart.ts diff --git a/components/common/FeatureBar/FeatureBar.module.css b/components/common/FeatureBar/FeatureBar.module.css new file mode 100644 index 000000000..a3cb61cd2 --- /dev/null +++ b/components/common/FeatureBar/FeatureBar.module.css @@ -0,0 +1,7 @@ +.root { + @apply text-center p-6 bg-primary text-sm flex-row justify-center items-center font-medium fixed bottom-0 w-full z-30 transition-all duration-300 ease-out; + + @screen md { + @apply flex text-left; + } +} diff --git a/components/common/FeatureBar/FeatureBar.tsx b/components/common/FeatureBar/FeatureBar.tsx new file mode 100644 index 000000000..8923a721e --- /dev/null +++ b/components/common/FeatureBar/FeatureBar.tsx @@ -0,0 +1,39 @@ +import cn from 'classnames' +import s from './FeatureBar.module.css' + +interface FeatureBarProps { + className?: string + title: string + description?: string + hide?: boolean + action?: React.ReactNode +} + +const FeatureBar: React.FC = ({ + title, + description, + className, + action, + hide, +}) => { + const rootClassName = cn( + s.root, + { + transform: true, + 'translate-y-0 opacity-100': !hide, + 'translate-y-full opacity-0': hide, + }, + className + ) + return ( +
+ {title} + + {description} + + {action && action} +
+ ) +} + +export default FeatureBar diff --git a/components/common/FeatureBar/index.ts b/components/common/FeatureBar/index.ts new file mode 100644 index 000000000..d78bc9d20 --- /dev/null +++ b/components/common/FeatureBar/index.ts @@ -0,0 +1 @@ +export { default } from './FeatureBar' diff --git a/hooks/index.ts b/hooks/index.ts deleted file mode 100644 index 68ee6c61e..000000000 --- a/hooks/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as useCart } from './useCart' diff --git a/hooks/useCart.ts b/hooks/useCart.ts deleted file mode 100644 index e69de29bb..000000000