This commit is contained in:
@@ -20,7 +20,7 @@ class NewMedicineState(rx.State):
|
||||
last_scan_time: str = ""
|
||||
updated_uuid: bool = False
|
||||
scanning: bool = False
|
||||
rate: float = 2
|
||||
rate: float = 1
|
||||
lastupdatetime: int = 0
|
||||
|
||||
def start_scan(self):
|
||||
@@ -55,9 +55,7 @@ class NewMedicineState(rx.State):
|
||||
results = session.exec(statement)
|
||||
medicine = results.first()
|
||||
if medicine is not None:
|
||||
medicine_name = (
|
||||
f"{medicine.name} - {medicine.owner.name}"
|
||||
)
|
||||
medicine_name = f"{medicine.name} - {medicine.owner.name}"
|
||||
return True
|
||||
return False
|
||||
|
||||
@@ -208,9 +206,11 @@ def taken_form():
|
||||
rx.divider(),
|
||||
)
|
||||
|
||||
|
||||
def just_show(x):
|
||||
return rx.text(x)
|
||||
|
||||
|
||||
@template(route="/medicine", title="Medikamente")
|
||||
def medicine() -> rx.Component:
|
||||
"""The dashboard page.
|
||||
@@ -242,10 +242,7 @@ def medicine() -> rx.Component:
|
||||
border_bottom=styles.border,
|
||||
padding="1em",
|
||||
),
|
||||
rx.cond(
|
||||
NewMedicineState.show_med_add_form,
|
||||
new_medicine_form()
|
||||
),
|
||||
rx.cond(NewMedicineState.show_med_add_form, new_medicine_form()),
|
||||
rx.cond(
|
||||
NewMedicineState.updated_uuid,
|
||||
taken_form(),
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
"""The meds page."""
|
||||
from reflex_ipad.templates import template
|
||||
|
||||
import reflex as rx
|
||||
|
||||
|
||||
@template(route="/medicine", title="Medikamente")
|
||||
def dashboard() -> rx.Component:
|
||||
"""The dashboard page.
|
||||
|
||||
Returns:
|
||||
The UI for the dashboard page.
|
||||
"""
|
||||
return rx.vstack(
|
||||
rx.heading("Medikamente", font_size="3em"),
|
||||
rx.text("Heute schon genommen?"),
|
||||
rx.text(
|
||||
"Scan the Med",
|
||||
),
|
||||
)
|
||||
@@ -3,7 +3,7 @@
|
||||
from reflex_ipad import styles
|
||||
|
||||
# Import all the pages.
|
||||
from reflex_ipad.pages import *
|
||||
from reflex_ipad.pages import index, dashboard, settings
|
||||
from reflex_ipad import api
|
||||
from reflex_ipad.models import *
|
||||
|
||||
|
||||
Reference in New Issue
Block a user