v1.6.4/tutorial complete

This commit is contained in:
2020-08-26 23:28:07 -04:00
parent 60758dc35a
commit 14c90d4cb9
6 changed files with 400 additions and 12 deletions
+16 -1
View File
@@ -23,6 +23,7 @@ import {
PLAYER_SOURCE,
getShowWPButton,
getTutorialStatus,
setTutorialStatus,
} from './Api';
import Tutorial from './Tutorial';
@@ -74,6 +75,8 @@ const startResize = (ev) => {
const App = () => {
const closedNotification = { open: false, message: '' };
const [tutorialComponent, setTutorialComponent] = useState(null);
const [showFab, setShowFab] = useState(false);
const [tutorialComplete, setTutorialComplete] = useState(false);
const [status, setStatus] = useState({ active: false, message: '' });
const [visible, setVisible] = useState(false);
@@ -94,6 +97,7 @@ const App = () => {
setLoading(false);
});
getShowWPButton().then((showWPButton) => {
setShowFab(showWPButton);
if (showWPButton === true) {
document.querySelector('.watch-party-fab').classList.remove('watch-party-fab-hidden');
}
@@ -134,6 +138,11 @@ const App = () => {
if (document.fullscreenElement) setVisible(false);
};
const resetTutorial = (c = null) => {
setTutorialComponent(c);
setTutorialComplete(false);
};
return (
<ThemeProvider theme={darkTheme}>
<Snackbar
@@ -145,8 +154,11 @@ const App = () => {
autoHideDuration={6000}
/>
<Tutorial
setTutorialCompleteState={setTutorialComplete}
resetTutorial={resetTutorial}
tutorialComplete={tutorialComplete}
showFab={showFab}
visible={visible}
tutorialComponent={tutorialComponent}
/>
<div className="party-content-wrapper">
<div id="party-routes-wrapper">
@@ -162,6 +174,9 @@ const App = () => {
{loading && <Loading />}
{status[APP_VERSION_STRING] && status[APP_VERSION_STRING].active === true ? (
<Routes
showFab={showFab}
resetTutorial={resetTutorial}
tutorialComplete={tutorialComplete}
updateLoading={setLoading}
notify={(message) => setNotification({ open: true, message })}
appVersion={APP_VERSION}