From dc4a53b422142913d881c29ddfe32e294801d249 Mon Sep 17 00:00:00 2001 From: Lukas Brabec Date: Sep 15 2020 06:31:02 +0000 Subject: motd alert --- diff --git a/public/env.js b/public/env.js index 7d0e732..793aab0 100644 --- a/public/env.js +++ b/public/env.js @@ -1,4 +1,5 @@ window.env = { SUBDIR: '/landing_page', - ORACULUM_API_URL_v1: 'https://packager.fedorainfracloud.org:5000/api/v1/' + ORACULUM_API_URL_v1: 'https://packager.fedorainfracloud.org:5000/api/v1/', + _TEMP_MOTD_URL: 'https://pagure.io/fedora-qa/motd/raw/master/f/motd-test.json', }; diff --git a/src/index.css b/src/index.css index 27f6835..e947159 100644 --- a/src/index.css +++ b/src/index.css @@ -56,10 +56,10 @@ h1 { .padded { padding-top: 0.5em; - + } -.timeline { +.timeline { border-spacing: 0; border-collapse: collapse; margin: 0 auto; @@ -138,3 +138,11 @@ ol.steps > li { border-top-style: solid; border-top-width: 1px; } + +.motd { + width: 100%; +} + +.motd-box { + background-color: #777; +} diff --git a/src/landingpage/LandingPage.js b/src/landingpage/LandingPage.js index b1bee82..a879d39 100644 --- a/src/landingpage/LandingPage.js +++ b/src/landingpage/LandingPage.js @@ -7,6 +7,7 @@ import Events from "./Events" import Blockers from "./Blockers" import Minutes from "./Minutes" import Hideable from "./Hideable" +import MOTD from "./Motd" import _ from "lodash" @@ -101,6 +102,9 @@ class LandingPage extends Component { + + + {components}
diff --git a/src/landingpage/Motd.js b/src/landingpage/Motd.js new file mode 100644 index 0000000..ea5b6a6 --- /dev/null +++ b/src/landingpage/Motd.js @@ -0,0 +1,38 @@ +import React, { Component } from "react" + +class MOTD extends Component { + constructor(props) { + super(props) + this.state = { + enabled: false, + message: undefined, + type: undefined, + link: undefined, + } + } + + componentDidMount() { + fetch(window.env._TEMP_MOTD_URL) + .then(blob => blob.json()) + .then(data => { + this.setState({...data}) + }) + } + + render() { + if(!this.state.enabled) + return null + + return ( +
+
+

Message from Fedora QA team:

+ {this.state.message}
+ Learn more +
+
+ ) + } +} + +export default MOTD