-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage_container.py
More file actions
35 lines (28 loc) · 967 Bytes
/
page_container.py
File metadata and controls
35 lines (28 loc) · 967 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
35
from reactpy import component, html
from reactpy.core.types import VdomDictConstructor
from reactpy_router import link
from utils.types import Props
@component
def _navbar():
return html.nav({'class_name': 'navbar navbar-dark bg-primary mb-4'},
html.div({'class_name': 'container'},
link(html.div({'class_name': 'btn navbar-brand'}, "Pollster"), to="/polls/"),
),
html.ul({'class_name': 'navbar-nav ml-auto'},
html.li({'class_name': 'nav-item'},
html.a({'class_name': 'btn navbar-brand', 'href': '/admin/'}, "Admin")
)
)
)
@component
def page_container(page: VdomDictConstructor, **props: Props):
return html._(
_navbar(),
html.div({'class_name': 'container'},
html.div({'class_name': 'row'},
html.div({'class_name': '.col-md-6 m-auto'},
page(**props)
)
)
)
)