Merge pull request #4020 from urbit/mp/landscape/breach

landscape: add breach notification
This commit is contained in:
matildepark 2020-11-25 19:26:39 -05:00 committed by GitHub
commit bda335ea7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,8 @@ import './css/fonts.css';
import light from './themes/light'; import light from './themes/light';
import dark from './themes/old-dark'; import dark from './themes/old-dark';
import { Text, Anchor, Row } from '@tlon/indigo-react';
import { Content } from './landscape/components/Content'; import { Content } from './landscape/components/Content';
import StatusBar from './components/StatusBar'; import StatusBar from './components/StatusBar';
import Omnibox from './components/leap/Omnibox'; import Omnibox from './components/leap/Omnibox';
@ -25,6 +27,7 @@ import GlobalApi from '~/logic/api/global';
import { uxToHex } from '~/logic/lib/util'; import { uxToHex } from '~/logic/lib/util';
import { foregroundFromBackground } from '~/logic/lib/sigil'; import { foregroundFromBackground } from '~/logic/lib/sigil';
const Root = styled.div` const Root = styled.div`
font-family: ${p => p.theme.fonts.sans}; font-family: ${p => p.theme.fonts.sans};
height: 100%; height: 100%;
@ -128,6 +131,9 @@ class App extends React.Component {
const notificationsCount = state.notificationsCount || 0; const notificationsCount = state.notificationsCount || 0;
const doNotDisturb = state.doNotDisturb || false; const doNotDisturb = state.doNotDisturb || false;
const showBanner = localStorage.getItem("2020BreachBanner") || "flex";
let banner = null;
return ( return (
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<Helmet> <Helmet>
@ -136,6 +142,21 @@ class App extends React.Component {
: null} : null}
</Helmet> </Helmet>
<Root background={background}> <Root background={background}>
<Row
ref={e => banner = e}
display={showBanner}
justifyContent="space-between"
width='100%'
p='2'
backgroundColor='yellow'>
<Text color='#000000'>
A network-wide breach is scheduled for early December 2020. Please visit <Anchor target="_blank" href="https://urbit.org/breach" color='inherit'>urbit.org/breach</Anchor> for more information.
</Text>
<Text cursor='pointer' fontWeight='500' onClick={() => {
banner.style.displaydisplay = "none";
localStorage.setItem("2020BreachBanner", "none");
}}>Dismiss</Text>
</Row>
<Router> <Router>
<ErrorBoundary> <ErrorBoundary>
<StatusBarWithRouter <StatusBarWithRouter