Fixed linting 😃

Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
2020-02-06 21:18:11 +01:00
parent c4775134de
commit fee40613f1
16 changed files with 249 additions and 157 deletions

View File

@ -1,19 +1,25 @@
import { Component, CSSProperties } from "react"
import React, { Component, CSSProperties } from 'react'
interface props {
src: string,
alt?: string,
interface Props {
src: string
alt?: string
style?: CSSProperties
parentStyle?: CSSProperties
}
export default class Picture extends Component<props, {}> {
export default class Picture extends Component<Props, {}> {
public render() {
const sets = require(`../images${this.props.src}?resize&sizes[]=300&sizes[]=600&sizes[]=1000`)
return (
<picture style={this.props.parentStyle}>
<source srcSet={require(`../images${this.props.src}?webp`).default} type="image/webp" />
<img srcSet={sets.srcSet} src={sets.src} alt={this.props.alt} style={Object.assign({width: "100%", objectFit: "cover"}, this.props.style)} />
<img
srcSet={sets.srcSet}
src={sets.src}
alt={this.props.alt}
style={
Object.assign({width: '100%', objectFit: 'cover'}, this.props.style)
} />
</picture>
)
}