mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
Merge pull request #951 from oceanprotocol/issue-944-version-badge
V4 badge
This commit is contained in:
commit
e53bc8a841
16
src/components/@shared/atoms/Badge.jsx
Normal file
16
src/components/@shared/atoms/Badge.jsx
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import styles from './Badge.module.scss'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
|
export default function Badge({ label, size }) {
|
||||||
|
return (
|
||||||
|
<span className={styles.badge} style={{ fontSize: size }}>
|
||||||
|
{label}
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
Badge.propTypes = {
|
||||||
|
label: PropTypes.string,
|
||||||
|
size: PropTypes.string
|
||||||
|
}
|
16
src/components/@shared/atoms/Badge.module.scss
Normal file
16
src/components/@shared/atoms/Badge.module.scss
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
@import 'variables';
|
||||||
|
|
||||||
|
.badge {
|
||||||
|
display: inline-block;
|
||||||
|
font-size: $font-size-mini;
|
||||||
|
font-family: $font-family-base;
|
||||||
|
font-weight: $font-weight-bold;
|
||||||
|
line-height: 1 !important;
|
||||||
|
text-transform: uppercase;
|
||||||
|
padding: 0.2rem;
|
||||||
|
margin-left: 0.2rem;
|
||||||
|
border-radius: $border-radius;
|
||||||
|
color: $brand-white;
|
||||||
|
background: $brand-purple;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
@ -4,6 +4,8 @@ import { ReactComponent as Logo } from '@oceanprotocol/art/logo/logo.svg'
|
|||||||
import styles from './Header.module.scss'
|
import styles from './Header.module.scss'
|
||||||
import SearchButton from './Search/SearchButton'
|
import SearchButton from './Search/SearchButton'
|
||||||
import ToggleSwitch from './ToggleSwitch'
|
import ToggleSwitch from './ToggleSwitch'
|
||||||
|
import Badge from './@shared/atoms/Badge'
|
||||||
|
import { fontSizeMini } from '../styles/_variables.scss'
|
||||||
|
|
||||||
const query = graphql`
|
const query = graphql`
|
||||||
query {
|
query {
|
||||||
@ -37,7 +39,11 @@ const Header = () => (
|
|||||||
<div className={styles.headerContent}>
|
<div className={styles.headerContent}>
|
||||||
<Link to="/" className={styles.headerLogo}>
|
<Link to="/" className={styles.headerLogo}>
|
||||||
<Logo className={styles.headerLogoImage} />
|
<Logo className={styles.headerLogoImage} />
|
||||||
<h1 className={styles.headerTitle}>{siteTitle}</h1>
|
<h1 className={styles.headerTitle}>
|
||||||
|
{siteTitle}
|
||||||
|
{/* V4 badge */}
|
||||||
|
<Badge label="v4" size={fontSizeMini} />
|
||||||
|
</h1>
|
||||||
</Link>
|
</Link>
|
||||||
<nav className={styles.headerMenu}>
|
<nav className={styles.headerMenu}>
|
||||||
{sections.map(({ node }) => (
|
{sections.map(({ node }) => (
|
||||||
|
@ -5,6 +5,8 @@ import Content from '../components/Content'
|
|||||||
import styles from './HeaderHome.module.scss'
|
import styles from './HeaderHome.module.scss'
|
||||||
import SearchButton from '../components/Search/SearchButton'
|
import SearchButton from '../components/Search/SearchButton'
|
||||||
import ToggleSwitch from './ToggleSwitch'
|
import ToggleSwitch from './ToggleSwitch'
|
||||||
|
import Badge from './@shared/atoms/Badge'
|
||||||
|
import { fontSizeSmall } from '../styles/_variables.scss'
|
||||||
|
|
||||||
const HeaderHome = () => (
|
const HeaderHome = () => (
|
||||||
<StaticQuery
|
<StaticQuery
|
||||||
@ -32,7 +34,10 @@ const HeaderHome = () => (
|
|||||||
<a href={siteTaglineURL}>Immunefi</a>
|
<a href={siteTaglineURL}>Immunefi</a>
|
||||||
</div>
|
</div>
|
||||||
<Logo className={styles.headerLogo} />
|
<Logo className={styles.headerLogo} />
|
||||||
<h1 className={styles.headerTitle}>{siteTitle}</h1>
|
<h1 className={styles.headerTitle}>
|
||||||
|
{siteTitle}
|
||||||
|
<Badge label="v4" size={fontSizeSmall} />
|
||||||
|
</h1>
|
||||||
<p className={styles.headerDescription}>
|
<p className={styles.headerDescription}>
|
||||||
{siteDescription}
|
{siteDescription}
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
|
@ -69,3 +69,8 @@ $narrowWidth: 35rem;
|
|||||||
$box-shadow-color: rgba(0, 0, 0, 0.2);
|
$box-shadow-color: rgba(0, 0, 0, 0.2);
|
||||||
$border-color: #e2e2e2;
|
$border-color: #e2e2e2;
|
||||||
$background-content: #fff;
|
$background-content: #fff;
|
||||||
|
|
||||||
|
:export {
|
||||||
|
font-size-small: $font-size-small;
|
||||||
|
font-size-mini: $font-size-mini;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user