From 1fe43a98098eeef254a26b21d77e2d0ce8e55c30 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Mon, 4 Apr 2022 15:22:35 +0200
Subject: chore: add a FlippingLogo component

---
 src/components/molecules/layout/flipping-logo.tsx | 48 +++++++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 src/components/molecules/layout/flipping-logo.tsx

(limited to 'src/components/molecules/layout/flipping-logo.tsx')

diff --git a/src/components/molecules/layout/flipping-logo.tsx b/src/components/molecules/layout/flipping-logo.tsx
new file mode 100644
index 0000000..7bb7afc
--- /dev/null
+++ b/src/components/molecules/layout/flipping-logo.tsx
@@ -0,0 +1,48 @@
+import Logo from '@components/atoms/images/logo';
+import Image from 'next/image';
+import { FC } from 'react';
+import styles from './flipping-logo.module.scss';
+
+type FlippingLogoProps = {
+  /**
+   * Adds additional classes to the logo wrapper.
+   */
+  additionalClasses?: string;
+  /**
+   * Photo alternative text.
+   */
+  altText: string;
+  /**
+   * Logo image title.
+   */
+  logoTitle?: string;
+  /**
+   * Photo url.
+   */
+  photo: string;
+};
+
+/**
+ * FlippingLogo component
+ *
+ * Render a logo and a photo with a flipping effect.
+ */
+const FlippingLogo: FC<FlippingLogoProps> = ({
+  additionalClasses,
+  altText,
+  logoTitle,
+  photo,
+}) => {
+  return (
+    <div className={`${styles.logo} ${additionalClasses}`}>
+      <div className={styles.logo__front}>
+        <Image src={photo} alt={altText} layout="fill" objectFit="cover" />
+      </div>
+      <div className={styles.logo__back}>
+        <Logo title={logoTitle} />
+      </div>
+    </div>
+  );
+};
+
+export default FlippingLogo;
-- 
cgit v1.2.3

