Satisfy linter in event template
This commit is contained in:
1 parent
9fc324ded9
commit
cb53037a8b
2 files changed
+24
-11
No files matched your search
+7
-3
@@ -5,13 +5,17 @@
|
|||||||
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
|
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
|
||||||
"react/prefer-stateless-function": "off",
|
"react/prefer-stateless-function": "off",
|
||||||
"react/require-default-props": "off",
|
"react/require-default-props": "off",
|
||||||
"react/prop-types": "off",
|
"react/no-danger": "off",
|
||||||
"react/no-danger": "off"
|
"react/jsx-one-expression-per-line": "off"
|
||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
"import/core-modules": []
|
"import/core-modules": []
|
||||||
},
|
},
|
||||||
"env": {
|
"env": {
|
||||||
"browser": true
|
"browser": true,
|
||||||
|
"commonjs": true,
|
||||||
|
"es6": true,
|
||||||
|
"jest": true,
|
||||||
|
"node": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+17
-8
@@ -2,22 +2,23 @@ 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')
|
||||||
|
|
||||||
const formatPrices = (regular, student) => {
|
const formatPrices = (regular, student) => {
|
||||||
let cc = ''
|
let cc = ''
|
||||||
if (regular && regular != 0) {
|
if (regular && regular !== 0) {
|
||||||
cc += regular
|
cc += regular
|
||||||
}
|
}
|
||||||
if (student && student != 0) {
|
if (student && student !== 0) {
|
||||||
cc += ' / ' + student
|
cc += ` / ${student}`
|
||||||
}
|
}
|
||||||
return cc == '' ? 'Gratis' : cc
|
return cc === '' ? 'Gratis' : cc
|
||||||
}
|
}
|
||||||
|
|
||||||
export const EventTemplate = ({
|
export const EventTemplate = ({
|
||||||
@@ -106,8 +107,16 @@ export const EventTemplate = ({
|
|||||||
|
|
||||||
EventTemplate.propTypes = {
|
EventTemplate.propTypes = {
|
||||||
content: PropTypes.node.isRequired,
|
content: PropTypes.node.isRequired,
|
||||||
title: PropTypes.string,
|
title: PropTypes.string.isRequired,
|
||||||
featuredImage: PropTypes.object,
|
featuredMedia: PropTypes.shape({}),
|
||||||
|
startTime: PropTypes.string.isRequired,
|
||||||
|
endTime: PropTypes.string,
|
||||||
|
venue: PropTypes.string,
|
||||||
|
facebookUrl: PropTypes.string,
|
||||||
|
ticketUrl: PropTypes.string,
|
||||||
|
priceStudent: PropTypes.string,
|
||||||
|
priceRegular: PropTypes.string,
|
||||||
|
eventTypes: PropTypes.arrayOf(PropTypes.string),
|
||||||
}
|
}
|
||||||
|
|
||||||
const Event = ({ data }) => {
|
const Event = ({ data }) => {
|
||||||
|
|||||||
Reference in new issue
Block a user