Audit fixes, datapack warn

This commit is contained in:
oitsjustjose 2021-04-25 12:30:44 -07:00
commit d9899636e8
5 changed files with 122 additions and 22 deletions

View file

@ -11,6 +11,7 @@ import ConfigEdit from './components/view/ConfigEdit';
import ConfigRender from './components/view/ConfigRender';
import Login from './components/view/Login';
import Register from './components/view/Register';
import DatapackWarning from './components/modules/DatapackWarning';
import store from './redux/store';
export default () => {
@ -21,6 +22,7 @@ export default () => {
<Router>
<NavBar />
<div style={{ paddingTop: `${3.5}em` }} />
<DatapackWarning />
<Route exact path="/" component={ConfigCreate} />
<Route exact path="/edit" component={ConfigEdit} />
<Route exact path="/view" component={ConfigRender} />

View file

@ -0,0 +1,46 @@
import React, { useState } from 'react';
import { Button } from 'react-bootstrap';
import store from '../../redux/store';
export default () => {
const mc114Mode = store.getState().mc114;
const [show, setShow] = useState(mc114Mode && !JSON.parse(window.localStorage.getItem('hasSeenDatapackWarning')));
const onClose = () => {
window.localStorage.setItem('hasSeenDatapackWarning', true);
document.body.removeAttribute('style');
setShow(false);
};
if (show) {
document.body.style.overflow = 'hidden';
}
return (show && (
<div className="fullpage warning">
<h2>A Note on 1.16</h2>
<p>
Since you are on MC 1.14+ mode, there&apos;s a chance that you are using
Minecraft 1.16 or above. In 1.16 and above Geolosys has been changed
to use datapacks, so this configurator
{' '}
<b>will not work.</b>
</p>
<p>
Data for deposits go in
{' '}
<code>/data/geolosys/deposits</code>
. If you wish to override a built-in Geolosys data pack see the data schema
{' '}
<a href="http://oitsjustjo.se/u/478KLo_dY" target="_blank" rel="noreferrer noopener">
here.
</a>
</p>
<p>
You will only see this message once per browser
</p>
<Button onClick={onClose}>
Dismiss
</Button>
</div>
)) || <div />;
};

View file

@ -54,4 +54,23 @@ img.header {
.switch-nav-item, .switch-nav-item * {
cursor: pointer !important;
color: #fff;
}
.fullpage.warning {
width: 100vw;
height: 100vh;
z-index: 9999999;
position: fixed;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, .75);
color: white;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.fullpage.warning * {
max-width: 768px;
}