Merged 2.0.0-m3

This commit is contained in:
Philipp Czora
2018-10-19 08:44:03 +02:00
27 changed files with 1002 additions and 229 deletions

View File

@@ -1,6 +1,6 @@
//@flow
import React from "react";
import { withContextPath } from "./urls";
import {withContextPath} from "./urls";
type Props = {
src: string,
@@ -9,9 +9,18 @@ type Props = {
};
class Image extends React.Component<Props> {
createImageSrc = () => {
const { src } = this.props;
if (src.startsWith("http")) {
return src;
}
return withContextPath(src);
};
render() {
const { src, alt, className } = this.props;
return <img className={className} src={withContextPath(src)} alt={alt} />;
const { alt, className } = this.props;
return <img className={className} src={this.createImageSrc()} alt={alt} />;
}
}