Add temperature plugin
This commit is contained in:
parent
822eff6c5d
commit
cb8f6daccc
|
@ -1,6 +1,9 @@
|
||||||
import Warning from "./warning";
|
import Warning from "./warning";
|
||||||
import Manual from "./manual";
|
import Manual from "./manual";
|
||||||
|
import Temperature from "./temperature";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
warning: Warning,
|
warning: Warning,
|
||||||
manual: Manual
|
manual: Manual,
|
||||||
|
temperature: Temperature
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
import React from "react";
|
||||||
|
import PropTypes from "prop-types";
|
||||||
|
import GenericPageWithIcon from "./GenericPageWithIcon";
|
||||||
|
import { Sun } from "grommet-icons";
|
||||||
|
|
||||||
|
function Temperature(props) {
|
||||||
|
return (
|
||||||
|
<GenericPageWithIcon
|
||||||
|
title={props.data.temperature}
|
||||||
|
description={`The current temperature outside is ${props.data.temperature}℃`}
|
||||||
|
icon={<Sun color="plain" size="xlarge" />}
|
||||||
|
close={props.close}
|
||||||
|
/>);
|
||||||
|
}
|
||||||
|
|
||||||
|
Temperature.propTypes = {
|
||||||
|
data: PropTypes.object,
|
||||||
|
close: PropTypes.func
|
||||||
|
};
|
||||||
|
|
||||||
|
Temperature.pluginName = "Temperature";
|
||||||
|
|
||||||
|
export default Temperature;
|
Loading…
Reference in New Issue