File size: 797 Bytes
cb5b71d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import streamlit as st

from core.state import CurrentStep
from utils import init_state
from views.splash import render_splash
from views.wizard import render_editor

init_state()


def _back_to_menu():
    """Sends the user back to the menu."""
    init_state(force=True)


st.set_page_config(page_title="Croissant Editor", page_icon="🥐", layout="wide")
col1, col2 = st.columns([10, 1])
col1.header("Croissant Editor")
if st.session_state[CurrentStep] != CurrentStep.splash:
    col2.write("\n")  # Vertical box to shift the button menu
    col2.button("Menu", on_click=_back_to_menu)


if st.session_state[CurrentStep] == CurrentStep.splash:
    render_splash()
elif st.session_state[CurrentStep] == CurrentStep.editor:
    render_editor()
else:
    st.warning("invalid unhandled app state")