Add temperature plugin

This commit is contained in:
Ceda EI 2020-12-21 22:25:00 +05:30
parent 822eff6c5d
commit cb8f6daccc
2 changed files with 27 additions and 1 deletions

View File

@ -1,6 +1,9 @@
import Warning from "./warning";
import Manual from "./manual";
import Temperature from "./temperature";
export default {
warning: Warning,
manual: Manual
manual: Manual,
temperature: Temperature
};

View File

@ -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;