refactor: move presets into function
parent
59bbe0391b
commit
c358859e28
|
|
@ -39,14 +39,14 @@ class User:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def code_editor():
|
def code_presets():
|
||||||
code = ""
|
code = ""
|
||||||
cols = st.columns(len(SNIPPETS))
|
cols = st.columns(len(SNIPPETS))
|
||||||
for col, (k, v) in zip(cols, SNIPPETS.items()):
|
for col, (k, v) in zip(cols, SNIPPETS.items()):
|
||||||
with col:
|
with col:
|
||||||
if st.button(k):
|
if st.button(k):
|
||||||
code = v
|
code = v
|
||||||
monaco.st_monaco(key="default", code=code)
|
return code
|
||||||
|
|
||||||
|
|
||||||
code_editor()
|
monaco.st_monaco(key="default", code=code_presets())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue