diff --git a/reflex_ipad/pages/medicine.py b/reflex_ipad/pages/medicine.py index 0ebe6e2..c26fdb6 100644 --- a/reflex_ipad/pages/medicine.py +++ b/reflex_ipad/pages/medicine.py @@ -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(), diff --git a/reflex_ipad/pages/meds.py b/reflex_ipad/pages/meds.py deleted file mode 100644 index ecf9421..0000000 --- a/reflex_ipad/pages/meds.py +++ /dev/null @@ -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", - ), - ) diff --git a/reflex_ipad/reflex_ipad.py b/reflex_ipad/reflex_ipad.py index 8e122bf..bdda4f5 100644 --- a/reflex_ipad/reflex_ipad.py +++ b/reflex_ipad/reflex_ipad.py @@ -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 *