From cbf47a8f23c43d541dd9ec66147d21f9607ee20c Mon Sep 17 00:00:00 2001 From: Hrishav Date: Wed, 15 Nov 2023 13:34:27 +0530 Subject: [PATCH] chore: Added Scarf Tag For Tracking Co-authored-by: Sahil Signed-off-by: Hrishav --- website/src/components/scarf/Scarf.jsx | 13 ++ website/src/components/scarf/index.js | 1 + website/src/theme/Footer/index.js | 167 +++++++++++++++++++++ website/src/theme/Footer/styles.module.css | 15 ++ 4 files changed, 196 insertions(+) create mode 100644 website/src/components/scarf/Scarf.jsx create mode 100644 website/src/components/scarf/index.js create mode 100644 website/src/theme/Footer/index.js create mode 100644 website/src/theme/Footer/styles.module.css diff --git a/website/src/components/scarf/Scarf.jsx b/website/src/components/scarf/Scarf.jsx new file mode 100644 index 00000000..84e6e118 --- /dev/null +++ b/website/src/components/scarf/Scarf.jsx @@ -0,0 +1,13 @@ +import React from 'react' + +const ScarfTag = () => { + return ( + scarf + ) +} + +export { ScarfTag } diff --git a/website/src/components/scarf/index.js b/website/src/components/scarf/index.js new file mode 100644 index 00000000..32b87524 --- /dev/null +++ b/website/src/components/scarf/index.js @@ -0,0 +1 @@ +export * from './Scarf' diff --git a/website/src/theme/Footer/index.js b/website/src/theme/Footer/index.js new file mode 100644 index 00000000..79c37a22 --- /dev/null +++ b/website/src/theme/Footer/index.js @@ -0,0 +1,167 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import React from 'react' +import clsx from 'clsx' +import Link from '@docusaurus/Link' +import { useThemeConfig } from '@docusaurus/theme-common' +import useBaseUrl from '@docusaurus/useBaseUrl' +import isInternalUrl from '@docusaurus/isInternalUrl' +import styles from './styles.module.css' +import ThemedImage from '@theme/ThemedImage' +import IconExternalLink from '@theme/IconExternalLink' +import { ScarfTag } from '../../components/scarf' + +function FooterLink({ to, href, label, prependBaseUrlToHref, ...props }) { + const toUrl = useBaseUrl(to) + const normalizedHref = useBaseUrl(href, { + forcePrependBaseUrl: true + }) + return ( + + {href && !isInternalUrl(href) ? ( + + {label} + + + ) : ( + label + )} + + ) +} + +function FooterLogo({ sources, alt, width, height }) { + return +} + +function MultiColumnLinks({ links }) { + return ( + <> + {links.map((linkItem, i) => ( +
+
{linkItem.title}
+
    + {linkItem.items.map((item, key) => + item.html ? ( +
  • + ) : ( +
  • + +
  • + ) + )} +
+
+ ))} + + ) +} + +function SimpleLinks({ links }) { + return ( +
+ {links.map((item, key) => ( + <> + {item.html ? ( + + ) : ( + + )} + {links.length !== key + 1 && ยท} + + ))} +
+ ) +} + +function isMultiColumnFooterLinks(links) { + return 'title' in links[0] +} + +function Footer() { + const { footer } = useThemeConfig() + const { copyright, links = [], logo = {} } = footer || {} + const sources = { + light: useBaseUrl(logo.src), + dark: useBaseUrl(logo.srcDark || logo.src) + } + + if (!footer) { + return null + } + + return ( + + ) +} + +export default React.memo(Footer) diff --git a/website/src/theme/Footer/styles.module.css b/website/src/theme/Footer/styles.module.css new file mode 100644 index 00000000..f68a4f9f --- /dev/null +++ b/website/src/theme/Footer/styles.module.css @@ -0,0 +1,15 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +.footerLogoLink { + opacity: 0.5; + transition: opacity var(--ifm-transition-fast) var(--ifm-transition-timing-default); +} + +.footerLogoLink:hover { + opacity: 1; +}