aboutsummaryrefslogtreecommitdiff
path: root/src/components/Scoreboard/Solution.js
diff options
context:
space:
mode:
authorEug-VS <eug-vs@keemail.me>2020-01-02 17:20:23 +0300
committerEug-VS <eug-vs@keemail.me>2020-01-02 17:20:23 +0300
commit7c4e13d11bc2fc5b0f03efc959dd551a30565e8a (patch)
tree897f94f10f6bf2289b191bc89679e7c18ef14424 /src/components/Scoreboard/Solution.js
parent88475b18f12e16fe32130a9e52ff6fe4297f5ba3 (diff)
downloadchrono-cube-ui-7c4e13d11bc2fc5b0f03efc959dd551a30565e8a.tar.gz
Create Scoreboard component & integrate with API
Diffstat (limited to 'src/components/Scoreboard/Solution.js')
-rw-r--r--src/components/Scoreboard/Solution.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/components/Scoreboard/Solution.js b/src/components/Scoreboard/Solution.js
new file mode 100644
index 0000000..3f46eb5
--- /dev/null
+++ b/src/components/Scoreboard/Solution.js
@@ -0,0 +1,32 @@
+import React from 'react';
+
+import {
+ Card,
+ CardContent,
+ Typography,
+ Paper,
+} from "@material-ui/core";
+
+import styled from "styled-components";
+
+const Solution = ({ solution }) => {
+
+ const author = solution.author? solution.author : 'anonymous';
+ return (
+ <PaperWrapper elevation={2} style={{backgroundColor: "#ddbea3"}}>
+ <Typography variant="h4" style={{fontWeight: "bold"}}>
+ { solution.result }
+ </Typography>
+ <Typography>
+ by {author}
+ </Typography>
+ </PaperWrapper>
+ )
+};
+
+const PaperWrapper = styled(Card)`
+ padding: 10px;
+ margin: 25px;
+`;
+
+export default Solution; \ No newline at end of file