1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00

svg setup, style generic header

This commit is contained in:
Matthias Kretschmann 2018-11-07 17:00:54 +01:00
parent a0db8045e1
commit 598bf16613
Signed by: m
GPG Key ID: 606EEEF3C479A91F
6 changed files with 105 additions and 8 deletions

View File

@ -7,3 +7,6 @@ end_of_line = lf
indent_style = space indent_style = space
insert_final_newline = true insert_final_newline = true
trim_trailing_whitespace = true trim_trailing_whitespace = true
[*.json]
indent_size = 2

View File

@ -1,7 +1,7 @@
module.exports = { module.exports = {
siteMetadata: { siteMetadata: {
title: 'Ocean Protocol Docs', title: 'Ocean Protocol Documentation',
descritpion: '', description: '',
siteUrl: process.env.SITE_URL || 'https://docs.oceanprotocol.com' siteUrl: process.env.SITE_URL || 'https://docs.oceanprotocol.com'
}, },
plugins: [ plugins: [
@ -40,7 +40,14 @@ module.exports = {
includePaths: [`${__dirname}/src/styles`] includePaths: [`${__dirname}/src/styles`]
} }
}, },
'gatsby-plugin-react-svg', {
resolve: 'gatsby-plugin-svgr',
options: {
icon: true,
viewBox: false
// see https://github.com/smooth-code/svgr for a list of all options
}
},
'gatsby-plugin-catch-links', 'gatsby-plugin-catch-links',
'gatsby-plugin-react-helmet', 'gatsby-plugin-react-helmet',
'gatsby-transformer-sharp', 'gatsby-transformer-sharp',

View File

@ -4,15 +4,17 @@
"version": "0.0.1", "version": "0.0.1",
"author": "Ocean Protocol <devops@oceanprotocol.com>", "author": "Ocean Protocol <devops@oceanprotocol.com>",
"dependencies": { "dependencies": {
"@oceanprotocol/art": "^1.0.2",
"gatsby": "^2.0.19", "gatsby": "^2.0.19",
"gatsby-image": "^2.0.15", "gatsby-image": "^2.0.15",
"gatsby-plugin-catch-links": "^2.0.6", "gatsby-plugin-catch-links": "^2.0.6",
"gatsby-plugin-manifest": "^2.0.5", "gatsby-plugin-manifest": "^2.0.5",
"gatsby-plugin-offline": "^2.0.11", "gatsby-plugin-offline": "^2.0.11",
"gatsby-plugin-react-helmet": "^3.0.0", "gatsby-plugin-react-helmet": "^3.0.0",
"gatsby-plugin-react-svg": "^2.0.0-beta1", "gatsby-plugin-react-svg": "^2.0.0",
"gatsby-plugin-sass": "^2.0.3", "gatsby-plugin-sass": "^2.0.3",
"gatsby-plugin-sharp": "^2.0.7", "gatsby-plugin-sharp": "^2.0.7",
"gatsby-plugin-svgr": "^2.0.0-alpha",
"gatsby-remark-autolink-headers": "^2.0.10", "gatsby-remark-autolink-headers": "^2.0.10",
"gatsby-remark-images": "^2.0.6", "gatsby-remark-images": "^2.0.6",
"gatsby-remark-prismjs": "^3.0.3", "gatsby-remark-prismjs": "^3.0.3",

View File

@ -1,12 +1,17 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { Link } from 'gatsby' import { Link } from 'gatsby'
import { ReactComponent as Logo } from '@oceanprotocol/art/logo/logo-white.svg'
import styles from './Header.module.scss'
const Header = ({ siteTitle }) => ( const Header = ({ siteTitle }) => (
<header> <header className={styles.header}>
<h1 style={{ margin: 0 }}> <div className={styles.headerContent}>
<Link to="/">{siteTitle}</Link> <Link to={'/'} className={styles.headerLogo}>
</h1> <Logo className={styles.headerLogoImage} />
<h1 className={styles.headerTitle}>{siteTitle}</h1>
</Link>
</div>
</header> </header>
) )

View File

@ -0,0 +1,51 @@
@import 'variables';
.header {
background: $brand-black;
width: 100%;
padding: $spacer / 2;
padding-right: $spacer / 1.5;
}
.headerContent {
max-width: $break-point--huge;
margin-left: auto;
margin-right: auto;
display: flex;
justify-content: space-between;
align-items: center;
}
.headerLogo {
display: flex;
align-items: center;
width: 50%;
cursor: pointer;
&:hover,
&:focus,
&:active {
transform: none;
}
}
.headerLogoImage {
width: 60px;
height: 60px;
fill: #fff;
}
.headerTitle {
font-size: $font-size-h4;
color: $brand-white;
margin-left: $spacer;
display: none;
@media (min-width: $break-point--small) {
display: inline-block;
}
}
.headerMenu {
justify-self: flex-end;
}

View File

@ -3,6 +3,19 @@ import PropTypes from 'prop-types'
import { Link, graphql } from 'gatsby' import { Link, graphql } from 'gatsby'
import Layout from '../components/Layout' import Layout from '../components/Layout'
const SectionLink = ({ to, title, children }) => (
<Link to={to}>
<h3>{title}</h3>
<p>{children}</p>
</Link>
)
SectionLink.propTypes = {
to: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
children: PropTypes.any
}
const IndexPage = ({ data, location }) => { const IndexPage = ({ data, location }) => {
const { edges } = data.allMarkdownRemark const { edges } = data.allMarkdownRemark
@ -20,6 +33,22 @@ const IndexPage = ({ data, location }) => {
return ( return (
<Layout location={location}> <Layout location={location}>
<h1>Hi there</h1> <h1>Hi there</h1>
<SectionLink to="/concepts/introduction/" title="Core Concepts">
Understand the fundamentals of Ocean Protocol.
</SectionLink>
<SectionLink to="/setup/" title="Setup Guides">
Setting up the Ocean Protocol components.
</SectionLink>
<SectionLink to="/tutorials/" title="Tutorials">
Browse tutorials for most common setup and development
use-cases.
</SectionLink>
<h1>Docs list</h1>
<ul>{DocsList}</ul> <ul>{DocsList}</ul>
</Layout> </Layout>
) )