mirror of
				https://gitlab.nic.cz/turris/reforis/foris-js.git
				synced 2025-11-03 23:00:31 +01:00 
			
		
		
		
	Add custom logo & favicon
This commit is contained in:
		
							
								
								
									
										36
									
								
								docs/components/Logo.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								docs/components/Logo.js
									
									
									
									
									
										Normal file
									
								
							@@ -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 (
 | 
				
			||||||
 | 
					        <h1 className={classes.logo}>
 | 
				
			||||||
 | 
					            <img className={classes.image} src={logo} alt="React logo" />
 | 
				
			||||||
 | 
					            {children}
 | 
				
			||||||
 | 
					        </h1>
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					LogoRenderer.propTypes = {
 | 
				
			||||||
 | 
					    classes: PropTypes.object.isRequired,
 | 
				
			||||||
 | 
					    children: PropTypes.node,
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export default Styled(styles)(LogoRenderer);
 | 
				
			||||||
							
								
								
									
										3
									
								
								docs/components/logo.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								docs/components/logo.svg
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					<svg xmlns="http://www.w3.org/2000/svg" width="1000" height="1000">
 | 
				
			||||||
 | 
					    <path d="M288.258 240.0394L717.5586-.44c.803 62.277-1.8207 124.502-1.4996 186.7266 1.8208 7.6343-7.2288 10.1966-12.102 13.4908L286.4375 432.1518l1.8206-192.1124zm2.284 277.645L711 278.3176l-.8416 192.7742L457.357 614.514l-1.842 289.03-167.7097 95.8926 2.7365-481.753z"/>
 | 
				
			||||||
 | 
					</svg>
 | 
				
			||||||
| 
		 After Width: | Height: | Size: 349 B  | 
@@ -61,6 +61,9 @@ module.exports = {
 | 
				
			|||||||
            sectionDepth: 0,
 | 
					            sectionDepth: 0,
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
    ],
 | 
					    ],
 | 
				
			||||||
 | 
					    template: {
 | 
				
			||||||
 | 
					        favicon: "/docs/components/logo.svg",
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
    require: [
 | 
					    require: [
 | 
				
			||||||
        "babel-polyfill",
 | 
					        "babel-polyfill",
 | 
				
			||||||
        path.join(__dirname, "src/testUtils/mockGlobals"),
 | 
					        path.join(__dirname, "src/testUtils/mockGlobals"),
 | 
				
			||||||
@@ -73,6 +76,9 @@ module.exports = {
 | 
				
			|||||||
            "node_modules/@fortawesome/fontawesome-free/css/all.min.css"
 | 
					            "node_modules/@fortawesome/fontawesome-free/css/all.min.css"
 | 
				
			||||||
        ),
 | 
					        ),
 | 
				
			||||||
    ],
 | 
					    ],
 | 
				
			||||||
 | 
					    styleguideComponents: {
 | 
				
			||||||
 | 
					        LogoRenderer: path.join(__dirname, "docs/components/Logo"),
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
    webpackConfig: {
 | 
					    webpackConfig: {
 | 
				
			||||||
        module: {
 | 
					        module: {
 | 
				
			||||||
            rules: [
 | 
					            rules: [
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user