Fix issues highlighted by linter

This commit is contained in:
ponas committed 2019-05-09 16:07:48 +02:00
1 parent 640c38204a
commit 24f30560e3
14 files changed
+196 -87

No files matched your search

+7 -3
View File
@@ -4,7 +4,7 @@ import { Link, graphql } from 'gatsby'
import Img from 'gatsby-image' import Img from 'gatsby-image'
export default class AssociationList extends React.Component { export default class AssociationList extends React.Component {
render_association(association) { static renderAssociation(association) {
return ( return (
<Link className="association" to={association.path} key={association.id}> <Link className="association" to={association.path} key={association.id}>
{association.featured_media && association.featured_media.localFile && ( {association.featured_media && association.featured_media.localFile && (
@@ -32,10 +32,14 @@ export default class AssociationList extends React.Component {
return ( return (
<section className="associations"> <section className="associations">
<h1 className="page-title">{title}</h1> <h1 className="page-title">{title}</h1>
<p class="lead">Her burde det være en generell tekst om foreningene. Hva er en forening? Hvordan kan man bli med i en forening? Hva gjør foreningene? Kan jeg se alt som arrangeres av Kulturutvalget, for eksempel?</p> <p className="lead">
Her burde det være en generell tekst om foreningene. Hva er en
forening? Hvordan kan man bli med i en forening? Hva gjør foreningene?
Kan jeg se alt som arrangeres av Kulturutvalget, for eksempel?
</p>
<div className="association-list"> <div className="association-list">
{associations.map(({ node: association }) => {associations.map(({ node: association }) =>
this.render_association(association) this.renderAssociation(association)
)} )}
</div> </div>
</section> </section>
+44 -31
View File
@@ -3,40 +3,12 @@ import PropTypes from 'prop-types'
import { Link, graphql } from 'gatsby' import { Link, graphql } from 'gatsby'
import Img from 'gatsby-image' import Img from 'gatsby-image'
import _ from 'lodash' import _ from 'lodash'
import moment from 'moment' import moment from 'moment'
import 'moment/locale/nb' import 'moment/locale/nb'
moment.locale('nb') moment.locale('nb')
export default class EventList extends React.Component { export default class EventList extends React.Component {
render() {
const { events, title, onlyUpcoming, numDays, groupBy, showMore } = this.props
const filteredEvents = events.filter(({ node: event }) => {
const startTime = moment(event.start_time)
if (onlyUpcoming && !startTime.isSameOrAfter(new Date(), 'day')) {
return false
}
if (numDays) {
const lastDay = moment().add(numDays - 1, 'days')
if (!startTime.isSameOrBefore(lastDay, 'day')) {
return false
}
}
return true
})
return (
<section className="events">
{title && <h1 className="section-title">{title}</h1>}
{groupBy && this.renderEventsByDate(filteredEvents, groupBy)}
{!groupBy &&
filteredEvents.map(({ node: event }) => this.renderEvent(event))}
{showMore && <div className="show-more"><Link to="/program/" className="button">Vis alle</Link></div>}
</section>
)
}
renderEventsByDate(filteredEvents, groupBy) { renderEventsByDate(filteredEvents, groupBy) {
let groupByFormat = null let groupByFormat = null
if (groupBy === 'day') { if (groupBy === 'day') {
@@ -77,7 +49,7 @@ export default class EventList extends React.Component {
</div> </div>
<header className="event-header"> <header className="event-header">
<span <span
className={`event-date $(compactDate && event-date-is-compact)`} className={`event-date ${compactDate && 'event-date-is-compact'}`}
> >
<span className="event-date-weekday"> <span className="event-date-weekday">
{moment(event.start_time).format('dddd')}{' '} {moment(event.start_time).format('dddd')}{' '}
@@ -119,6 +91,47 @@ export default class EventList extends React.Component {
</Link> </Link>
) )
} }
render() {
const {
events,
title,
onlyUpcoming,
numDays,
groupBy,
showMore,
} = this.props
const filteredEvents = events.filter(({ node: event }) => {
const startTime = moment(event.start_time)
if (onlyUpcoming && !startTime.isSameOrAfter(new Date(), 'day')) {
return false
}
if (numDays) {
const lastDay = moment().add(numDays - 1, 'days')
if (!startTime.isSameOrBefore(lastDay, 'day')) {
return false
}
}
return true
})
return (
<section className="events">
{title && <h1 className="section-title">{title}</h1>}
{groupBy && this.renderEventsByDate(filteredEvents, groupBy)}
{!groupBy &&
filteredEvents.map(({ node: event }) => this.renderEvent(event))}
{showMore && (
<div className="show-more">
<Link to="/program/" className="button">
Vis alle
</Link>
</div>
)}
</section>
)
}
} }
EventList.propTypes = { EventList.propTypes = {
@@ -128,7 +141,7 @@ EventList.propTypes = {
numDays: PropTypes.number, numDays: PropTypes.number,
groupBy: PropTypes.string, groupBy: PropTypes.string,
compactDate: PropTypes.bool, compactDate: PropTypes.bool,
showMore: PropTypes.bool showMore: PropTypes.bool,
} }
EventList.defaultProps = { EventList.defaultProps = {
+60 -7
View File
@@ -11,17 +11,70 @@ const Footer = () => (
</Link> </Link>
</div> </div>
<nav className="social-nav"> <nav className="social-nav">
<a href="https://www.facebook.com/studentersamfundet" target="_blank"> <a
<svg xmlns="http://www.w3.org/2000/svg" width="49.652" height="49.652" viewBox="0 0 49.652 49.652"><path fill="#fff" d="M24.826 0C11.137 0 0 11.137 0 24.826c0 13.688 11.137 24.826 24.826 24.826 13.688 0 24.826-11.138 24.826-24.826C49.652 11.137 38.516 0 24.826 0zM31 25.7h-4.039v14.396h-5.985V25.7h-2.845v-5.088h2.845v-3.291c0-2.357 1.12-6.04 6.04-6.04l4.435.017v4.939h-3.219c-.524 0-1.269.262-1.269 1.386v2.99h4.56L31 25.7z"></path></svg> href="https://www.facebook.com/studentersamfundet"
target="_blank"
rel="noopener noreferrer"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="49.652"
height="49.652"
viewBox="0 0 49.652 49.652"
>
<path
fill="#fff"
d="M24.826 0C11.137 0 0 11.137 0 24.826c0 13.688 11.137 24.826 24.826 24.826 13.688 0 24.826-11.138 24.826-24.826C49.652 11.137 38.516 0 24.826 0zM31 25.7h-4.039v14.396h-5.985V25.7h-2.845v-5.088h2.845v-3.291c0-2.357 1.12-6.04 6.04-6.04l4.435.017v4.939h-3.219c-.524 0-1.269.262-1.269 1.386v2.99h4.56L31 25.7z"
/>
</svg>
</a> </a>
<a href="https://www.instagram.com/studentersamfundet/" target="_blank"> <a
<svg xmlns="http://www.w3.org/2000/svg" width="49.652" height="49.652" viewBox="0 0 49.652 49.652"><g fill="#fff"><path d="M24.825 29.796a4.978 4.978 0 0 0 4.972-4.97 4.954 4.954 0 0 0-.94-2.897 4.964 4.964 0 0 0-4.029-2.073c-1.659 0-3.126.82-4.031 2.072a4.947 4.947 0 0 0-.94 2.897 4.973 4.973 0 0 0 4.968 4.971zm10.853-11.05V13.96l-.623.002-4.164.013.016 4.787z"></path><path d="M24.826 0C11.137 0 0 11.137 0 24.826c0 13.688 11.137 24.826 24.826 24.826 13.688 0 24.826-11.138 24.826-24.826C49.652 11.137 38.516 0 24.826 0zm14.119 21.929v11.56a5.463 5.463 0 0 1-5.457 5.458H16.164a5.462 5.462 0 0 1-5.457-5.458V16.165a5.462 5.462 0 0 1 5.457-5.457h17.323a5.463 5.463 0 0 1 5.458 5.457v5.764z"></path><path d="M32.549 24.826c0 4.257-3.464 7.723-7.723 7.723s-7.722-3.466-7.722-7.723a7.67 7.67 0 0 1 .568-2.897h-4.215v11.56a2.706 2.706 0 0 0 2.706 2.704h17.323a2.707 2.707 0 0 0 2.706-2.704v-11.56h-4.217c.367.894.574 1.873.574 2.897z"></path></g></svg> href="https://www.instagram.com/studentersamfundet/"
target="_blank"
rel="noopener noreferrer"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="49.652"
height="49.652"
viewBox="0 0 49.652 49.652"
>
<g fill="#fff">
<path d="M24.825 29.796a4.978 4.978 0 0 0 4.972-4.97 4.954 4.954 0 0 0-.94-2.897 4.964 4.964 0 0 0-4.029-2.073c-1.659 0-3.126.82-4.031 2.072a4.947 4.947 0 0 0-.94 2.897 4.973 4.973 0 0 0 4.968 4.971zm10.853-11.05V13.96l-.623.002-4.164.013.016 4.787z" />
<path d="M24.826 0C11.137 0 0 11.137 0 24.826c0 13.688 11.137 24.826 24.826 24.826 13.688 0 24.826-11.138 24.826-24.826C49.652 11.137 38.516 0 24.826 0zm14.119 21.929v11.56a5.463 5.463 0 0 1-5.457 5.458H16.164a5.462 5.462 0 0 1-5.457-5.458V16.165a5.462 5.462 0 0 1 5.457-5.457h17.323a5.463 5.463 0 0 1 5.458 5.457v5.764z" />
<path d="M32.549 24.826c0 4.257-3.464 7.723-7.723 7.723s-7.722-3.466-7.722-7.723a7.67 7.67 0 0 1 .568-2.897h-4.215v11.56a2.706 2.706 0 0 0 2.706 2.704h17.323a2.707 2.707 0 0 0 2.706-2.704v-11.56h-4.217c.367.894.574 1.873.574 2.897z" />
</g>
</svg>
</a> </a>
<a href="https://twitter.com/dns1813" target="_blank"> <a
<svg xmlns="http://www.w3.org/2000/svg" width="49.652" height="49.652" viewBox="0 0 49.652 49.652"><path fill="#fff" d="M24.826 0C11.137 0 0 11.137 0 24.826c0 13.688 11.137 24.826 24.826 24.826 13.688 0 24.826-11.138 24.826-24.826C49.652 11.137 38.516 0 24.826 0zm11.075 19.144c.011.246.017.494.017.742 0 7.551-5.746 16.255-16.259 16.255-3.227 0-6.231-.943-8.759-2.565.447.053.902.08 1.363.08 2.678 0 5.141-.914 7.097-2.446a5.72 5.72 0 0 1-5.338-3.969 5.76 5.76 0 0 0 2.58-.096 5.715 5.715 0 0 1-4.583-5.603l.001-.072a5.69 5.69 0 0 0 2.587.714 5.71 5.71 0 0 1-2.541-4.755c0-1.048.281-2.03.773-2.874a16.225 16.225 0 0 0 11.777 5.972 5.707 5.707 0 0 1-.147-1.303 5.714 5.714 0 0 1 9.884-3.91 11.406 11.406 0 0 0 3.63-1.387 5.74 5.74 0 0 1-2.516 3.162 11.36 11.36 0 0 0 3.282-.899 11.494 11.494 0 0 1-2.848 2.954z"></path></svg> href="https://twitter.com/dns1813"
target="_blank"
rel="noopener noreferrer"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="49.652"
height="49.652"
viewBox="0 0 49.652 49.652"
>
<path
fill="#fff"
d="M24.826 0C11.137 0 0 11.137 0 24.826c0 13.688 11.137 24.826 24.826 24.826 13.688 0 24.826-11.138 24.826-24.826C49.652 11.137 38.516 0 24.826 0zm11.075 19.144c.011.246.017.494.017.742 0 7.551-5.746 16.255-16.259 16.255-3.227 0-6.231-.943-8.759-2.565.447.053.902.08 1.363.08 2.678 0 5.141-.914 7.097-2.446a5.72 5.72 0 0 1-5.338-3.969 5.76 5.76 0 0 0 2.58-.096 5.715 5.715 0 0 1-4.583-5.603l.001-.072a5.69 5.69 0 0 0 2.587.714 5.71 5.71 0 0 1-2.541-4.755c0-1.048.281-2.03.773-2.874a16.225 16.225 0 0 0 11.777 5.972 5.707 5.707 0 0 1-.147-1.303 5.714 5.714 0 0 1 9.884-3.91 11.406 11.406 0 0 0 3.63-1.387 5.74 5.74 0 0 1-2.516 3.162 11.36 11.36 0 0 0 3.282-.899 11.494 11.494 0 0 1-2.848 2.954z"
/>
</svg>
</a> </a>
<a href="https://www.flickr.com/groups/neuf/pool/" target="_blank"> <a href="https://www.flickr.com/groups/neuf/pool/" target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" width="97.75" height="97.75" viewBox="0 0 97.75 97.75"><path fill="#fff" d="M48.875 0C21.883 0 0 21.882 0 48.875S21.883 97.75 48.875 97.75 97.75 75.868 97.75 48.875 75.867 0 48.875 0zM28.277 66.361c-8.895 0-16.105-7.828-16.105-17.486s7.211-17.487 16.105-17.487 16.106 7.829 16.106 17.487-7.211 17.486-16.106 17.486zm40.731-.416c-9.152 0-16.57-7.735-16.57-17.279 0-9.542 7.418-17.278 16.57-17.278 9.15 0 16.57 7.736 16.57 17.278 0 9.544-7.42 17.279-16.57 17.279z"></path></svg> <svg
xmlns="http://www.w3.org/2000/svg"
width="97.75"
height="97.75"
viewBox="0 0 97.75 97.75"
>
<path
fill="#fff"
d="M48.875 0C21.883 0 0 21.882 0 48.875S21.883 97.75 48.875 97.75 97.75 75.868 97.75 48.875 75.867 0 48.875 0zM28.277 66.361c-8.895 0-16.105-7.828-16.105-17.486s7.211-17.487 16.105-17.487 16.106 7.829 16.106 17.487-7.211 17.486-16.106 17.486zm40.731-.416c-9.152 0-16.57-7.735-16.57-17.279 0-9.542 7.418-17.278 16.57-17.278 9.15 0 16.57 7.736 16.57 17.278 0 9.544-7.42 17.279-16.57 17.279z"
/>
</svg>
</a> </a>
</nav> </nav>
</div> </div>
+5 -1
View File
@@ -1,6 +1,6 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types'
import Helmet from 'react-helmet' import Helmet from 'react-helmet'
import Navbar from './Navbar' import Navbar from './Navbar'
import Footer from './Footer' import Footer from './Footer'
import '../css/main.scss' import '../css/main.scss'
@@ -14,4 +14,8 @@ const TemplateWrapper = ({ children }) => (
</div> </div>
) )
TemplateWrapper.propTypes = {
children: PropTypes.shape({}).isRequired,
}
export default TemplateWrapper export default TemplateWrapper
+8 -7
View File
@@ -1,6 +1,5 @@
import React from 'react' import React from 'react'
import { Link, StaticQuery, graphql } from 'gatsby' import { Link } from 'gatsby'
import github from '../img/github-icon.svg'
import logo from '../img/logo/logo-s.svg' import logo from '../img/logo/logo-s.svg'
export default class Navbar extends React.Component { export default class Navbar extends React.Component {
@@ -8,17 +7,17 @@ export default class Navbar extends React.Component {
super(props) super(props)
this.state = { this.state = {
showNav: false, showNav: false,
headerSize: 200 headerSize: 200,
} }
this.resizeHeader = this.resizeHeader.bind(this); this.resizeHeader = this.resizeHeader.bind(this)
} }
componentDidMount() { componentDidMount() {
window.addEventListener('scroll', this.resizeHeader); window.addEventListener('scroll', this.resizeHeader)
} }
componentWillUnmount() { componentWillUnmount() {
window.removeEventListener('scroll', this.resizeHeader); window.removeEventListener('scroll', this.resizeHeader)
} }
toggleNav() { toggleNav() {
@@ -38,7 +37,9 @@ export default class Navbar extends React.Component {
render() { render() {
return ( return (
<header <header
className={`site-header ${this.state.showNav ? 'site-nav-visible' : ''}`} className={`site-header ${
this.state.showNav ? 'site-nav-visible' : ''
}`}
> >
<nav className="site-nav"> <nav className="site-nav">
<Link to="/program/">Program</Link> <Link to="/program/">Program</Link>
+9 -3
View File
@@ -23,7 +23,7 @@ export default class PostList extends React.Component {
<div className="post-text"> <div className="post-text">
<header className="post-header"> <header className="post-header">
<h2 className="post-title">{post.title}</h2> <h2 className="post-title">{post.title}</h2>
{/*<div className="post-meta">{post.date}</div>*/} {/* <div className="post-meta">{post.date}</div> */}
</header> </header>
<div className="post-body"> <div className="post-body">
<div <div
@@ -37,7 +37,13 @@ export default class PostList extends React.Component {
</Link> </Link>
))} ))}
</div> </div>
{showMore && <div className="show-more"><Link to="/nyheter/" className="button">Vis alle</Link></div>} {showMore && (
<div className="show-more">
<Link to="/nyheter/" className="button">
Vis alle
</Link>
</div>
)}
</section> </section>
) )
} }
@@ -46,7 +52,7 @@ export default class PostList extends React.Component {
PostList.propTypes = { PostList.propTypes = {
posts: PropTypes.arrayOf(PropTypes.object), posts: PropTypes.arrayOf(PropTypes.object),
title: PropTypes.string, title: PropTypes.string,
showMore: PropTypes.bool showMore: PropTypes.bool,
} }
export const pageQuery = graphql` export const pageQuery = graphql`
+13 -12
View File
@@ -1,18 +1,17 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { graphql } from 'gatsby' import { graphql } from 'gatsby'
import Layout from '../components/Layout'
import Img from 'gatsby-image' import Img from 'gatsby-image'
import Layout from '../components/Layout'
export const AssociationTemplate = data => { export const AssociationTemplate = ({
const { title,
title, content,
content, featuredMedia,
hasFeaturedMedia, type,
featuredMedia, homepage,
type, }) => {
homepage, const hasFeaturedMedia = featuredMedia && !!featuredMedia.localFile
} = data
return ( return (
<section className="association-page"> <section className="association-page">
<h1 className="page-title">{title}</h1> <h1 className="page-title">{title}</h1>
@@ -38,6 +37,9 @@ export const AssociationTemplate = data => {
AssociationTemplate.propTypes = { AssociationTemplate.propTypes = {
title: PropTypes.string.isRequired, title: PropTypes.string.isRequired,
content: PropTypes.string, content: PropTypes.string,
featuredMedia: PropTypes.shape({}),
type: PropTypes.string,
homepage: PropTypes.string,
} }
const Association = ({ data }) => { const Association = ({ data }) => {
@@ -50,7 +52,6 @@ const Association = ({ data }) => {
content={association.content} content={association.content}
type={association.association_type} type={association.association_type}
homepage={association.association_homepage} homepage={association.association_homepage}
hasFeaturedMedia={!!association.featured_media.localFile}
featuredMedia={association.featured_media} featuredMedia={association.featured_media}
/> />
</Layout> </Layout>
@@ -58,7 +59,7 @@ const Association = ({ data }) => {
} }
Association.propTypes = { Association.propTypes = {
data: PropTypes.object.isRequired, data: PropTypes.shape({}).isRequired,
} }
export default Association export default Association
-3
View File
@@ -1,7 +1,4 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types'
import { graphql } from 'gatsby'
import { Link } from 'gatsby'
import Layout from '../components/Layout' import Layout from '../components/Layout'
export default class DesignManual extends React.Component { export default class DesignManual extends React.Component {
+1
View File
@@ -24,6 +24,7 @@ EventTypeProgram.propTypes = {
edges: PropTypes.array, edges: PropTypes.array,
}), }),
}), }),
pageContext: PropTypes.shape({}),
} }
export const pageQuery = graphql` export const pageQuery = graphql`
+8 -2
View File
@@ -47,7 +47,8 @@ export const EventTemplate = ({
{venueCustom && <span>{venueCustom}</span>} {venueCustom && <span>{venueCustom}</span>}
{venue && venue.title !== 'Hele huset' && ( {venue && venue.title !== 'Hele huset' && (
<span> <span>
{venue.preposition} <Link to={venue.path}>{venue.title}</Link> {venue.preposition}{' '}
<Link to={venue.path}>{venue.title}</Link>
</span> </span>
)} )}
{venue && venue.title === 'Hele huset' && ( {venue && venue.title === 'Hele huset' && (
@@ -102,7 +103,12 @@ export const EventTemplate = ({
</div> </div>
<div className="event-links"> <div className="event-links">
{ticketUrl && ( {ticketUrl && (
<a className="event-link ticket-url" href={ticketUrl} target="_blank"> <a
className="event-link ticket-url"
href={ticketUrl}
target="_blank"
rel="noopener noreferrer"
>
<span>Kjøp billetter</span> <span>Kjøp billetter</span>
</a> </a>
)} )}
+27 -10
View File
@@ -1,12 +1,10 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { graphql } from 'gatsby' import { graphql, Link } from 'gatsby'
import { Link } from 'gatsby'
import Layout from '../components/Layout' import Layout from '../components/Layout'
import PostList from '../components/PostList' import PostList from '../components/PostList'
import EventList from '../components/EventList' import EventList from '../components/EventList'
export default class IndexPage extends React.Component { export default class IndexPage extends React.Component {
render() { render() {
const { data } = this.props const { data } = this.props
@@ -15,11 +13,26 @@ export default class IndexPage extends React.Component {
return ( return (
<Layout> <Layout>
<EventList events={events} numDays={7} groupBy="day" title="Dette skjer" showMore /> <EventList
events={events}
numDays={7}
groupBy="day"
title="Dette skjer"
showMore
/>
<section className="volunteer"> <section className="volunteer">
<Link to="/bli-aktiv/" className="section-title">Bli frivillig</Link> <Link to="/bli-aktiv/" className="section-title">
<p>Vil du være med å arrangere greier på studentersamfundet? Sjekk ut de ulike <Link to="/bli-aktiv/">foreningene</Link> som holder til på Chateau Neuf.</p> Bli frivillig
<p>Vi trenger alltid flere engasjerte folk! Her er noen eksempler på roller du kan innta:</p> </Link>
<p>
Vil du være med å arrangere greier på studentersamfundet? Sjekk ut
de ulike <Link to="/bli-aktiv/">foreningene</Link> som holder til på
Chateau Neuf.
</p>
<p>
Vi trenger alltid flere engasjerte folk! Her er noen eksempler på
roller du kan innta:
</p>
<ul> <ul>
<li>Økonomiansvarlig</li> <li>Økonomiansvarlig</li>
<li>Skuespiller</li> <li>Skuespiller</li>
@@ -32,9 +45,13 @@ export default class IndexPage extends React.Component {
<div className="address"> <div className="address">
<h2>Besøk oss</h2> <h2>Besøk oss</h2>
<p>Vi holder til på Majorstua. Finn veibeskrivelse under.</p> <p>Vi holder til på Majorstua. Finn veibeskrivelse under.</p>
<label for="directions">Jeg vil reise fra:</label> <label htmlFor="directions">Jeg vil reise fra:</label>
<input type="text" name="directions" placeholder="Skriv inn adresse" /> <input
type="text"
id="directions"
name="directions"
placeholder="Skriv inn adresse"
/>
</div> </div>
<div className="opening-hours"> <div className="opening-hours">
<h2>Åpningstider</h2> <h2>Åpningstider</h2>
+1 -1
View File
@@ -31,7 +31,7 @@ const Page = ({ data }) => {
} }
Page.propTypes = { Page.propTypes = {
data: PropTypes.object.isRequired, data: PropTypes.shape({}).isRequired,
} }
export default Page export default Page
+10 -4
View File
@@ -2,17 +2,17 @@ import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import Helmet from 'react-helmet' import Helmet from 'react-helmet'
import { graphql, Link } from 'gatsby' import { graphql, Link } from 'gatsby'
import Layout from '../components/Layout'
import Img from 'gatsby-image' import Img from 'gatsby-image'
import moment from 'moment' import moment from 'moment'
import 'moment/locale/nb' import 'moment/locale/nb'
import Layout from '../components/Layout'
moment.locale('nb') moment.locale('nb')
export const BlogPostTemplate = ({ export const BlogPostTemplate = ({
content, content,
categories, // categories,
tags, // tags,
title, title,
date, date,
author, author,
@@ -52,6 +52,12 @@ export const BlogPostTemplate = ({
BlogPostTemplate.propTypes = { BlogPostTemplate.propTypes = {
content: PropTypes.node.isRequired, content: PropTypes.node.isRequired,
title: PropTypes.string, title: PropTypes.string,
date: PropTypes.string.isRequired,
featuredMedia: PropTypes.shape({}),
author: PropTypes.shape({
name: PropTypes.string,
slug: PropTypes.string,
}),
} }
const BlogPost = ({ data }) => { const BlogPost = ({ data }) => {
+3 -3
View File
@@ -1,8 +1,8 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { graphql } from 'gatsby' import { graphql } from 'gatsby'
import Layout from '../components/Layout'
import Img from 'gatsby-image' import Img from 'gatsby-image'
import Layout from '../components/Layout'
export class VenueTemplate extends React.Component { export class VenueTemplate extends React.Component {
render() { render() {
@@ -61,7 +61,7 @@ export class VenueTemplate extends React.Component {
VenueTemplate.propTypes = { VenueTemplate.propTypes = {
title: PropTypes.string.isRequired, title: PropTypes.string.isRequired,
content: PropTypes.string, content: PropTypes.string,
featuredImage: PropTypes.object, featuredMedia: PropTypes.shape({}),
floor: PropTypes.string, floor: PropTypes.string,
capacityLegal: PropTypes.string, capacityLegal: PropTypes.string,
capacityStanding: PropTypes.string, capacityStanding: PropTypes.string,
@@ -97,7 +97,7 @@ const VenuePage = ({ data }) => {
} }
VenuePage.propTypes = { VenuePage.propTypes = {
data: PropTypes.object.isRequired, data: PropTypes.shape({}).isRequired,
} }
export default VenuePage export default VenuePage