From fd7cd49790de0ed2d3178798536b43d780da8092 Mon Sep 17 00:00:00 2001 From: Aleksandr Gumroian Date: Fri, 25 Feb 2022 15:05:00 +0100 Subject: [PATCH] Add custom logo & favicon --- docs/components/Logo.js | 36 ++++++++++++++++++++++++++++++++++++ docs/components/logo.svg | 3 +++ styleguide.config.js | 6 ++++++ 3 files changed, 45 insertions(+) create mode 100644 docs/components/Logo.js create mode 100644 docs/components/logo.svg diff --git a/docs/components/Logo.js b/docs/components/Logo.js new file mode 100644 index 0000000..afa9748 --- /dev/null +++ b/docs/components/Logo.js @@ -0,0 +1,36 @@ +import React from "react"; +import PropTypes from "prop-types"; +import Styled from "rsg-components/Styled"; +import logo from "./logo.svg"; + +const styles = ({ fontFamily }) => ({ + logo: { + display: "flex", + alignItems: "center", + margin: 0, + fontFamily: fontFamily.base, + fontSize: 18, + fontWeight: "normal", + }, + image: { + height: "1.3em", + marginLeft: "-0.2em", + marginRight: "0.2em", + }, +}); + +export function LogoRenderer({ classes, children }) { + return ( +

+ React logo + {children} +

+ ); +} + +LogoRenderer.propTypes = { + classes: PropTypes.object.isRequired, + children: PropTypes.node, +}; + +export default Styled(styles)(LogoRenderer); diff --git a/docs/components/logo.svg b/docs/components/logo.svg new file mode 100644 index 0000000..7fb7f23 --- /dev/null +++ b/docs/components/logo.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/styleguide.config.js b/styleguide.config.js index 1e5a790..219e045 100644 --- a/styleguide.config.js +++ b/styleguide.config.js @@ -61,6 +61,9 @@ module.exports = { sectionDepth: 0, }, ], + template: { + favicon: "/docs/components/logo.svg", + }, require: [ "babel-polyfill", path.join(__dirname, "src/testUtils/mockGlobals"), @@ -73,6 +76,9 @@ module.exports = { "node_modules/@fortawesome/fontawesome-free/css/all.min.css" ), ], + styleguideComponents: { + LogoRenderer: path.join(__dirname, "docs/components/Logo"), + }, webpackConfig: { module: { rules: [