-
Notifications
You must be signed in to change notification settings - Fork 366
Expand file tree
/
Copy pathform_editor.py
More file actions
34 lines (31 loc) · 957 Bytes
/
form_editor.py
File metadata and controls
34 lines (31 loc) · 957 Bytes
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
31
32
33
34
import reflex as rx
from .. import routes, style, utils
from ..components import navbar, form_select, form_editor, field_editor_modal
@utils.require_login
def form_editor_page() -> rx.Component:
return style.layout(
navbar(),
rx.hstack(
form_select(),
rx.button(
"New Form",
on_click=rx.redirect(routes.FORM_EDIT_NEW),
type="button",
),
),
rx.divider(),
form_editor(),
rx.cond(
rx.State.form_id != "",
rx.fragment(
rx.button(
"Add Field",
on_click=rx.redirect(routes.edit_field(rx.State.form_id, "new")),
is_disabled=rx.State.form_id == "",
type="button",
),
field_editor_modal(),
),
),
rx.logo(height="3em", margin_bottom="12px"),
)