Spaces:
Sleeping
Sleeping
update files
Browse files- layout/shell/header.py +22 -4
layout/shell/header.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
|
|
| 1 |
# header.py (或你專案中產生 header 的檔案)
|
| 2 |
from dash import html
|
| 3 |
import dash_mantine_components as dmc
|
|
|
|
| 4 |
|
| 5 |
HEADER_H = 50 # 想大一點改 72/80 即可
|
| 6 |
|
|
@@ -36,10 +38,26 @@ def generate_header():
|
|
| 36 |
|
| 37 |
right = dmc.Group(
|
| 38 |
align="center",
|
| 39 |
-
children=[
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
style={"height": "100%"},
|
| 44 |
)
|
| 45 |
|
|
|
|
| 1 |
+
from dash_iconify import DashIconify
|
| 2 |
# header.py (或你專案中產生 header 的檔案)
|
| 3 |
from dash import html
|
| 4 |
import dash_mantine_components as dmc
|
| 5 |
+
from student_login import create_student_badge
|
| 6 |
|
| 7 |
HEADER_H = 50 # 想大一點改 72/80 即可
|
| 8 |
|
|
|
|
| 38 |
|
| 39 |
right = dmc.Group(
|
| 40 |
align="center",
|
| 41 |
+
children=[
|
| 42 |
+
create_student_badge(),
|
| 43 |
+
dmc.Anchor(
|
| 44 |
+
href="/teacher",
|
| 45 |
+
children=dmc.Tooltip(
|
| 46 |
+
label="老師後台",
|
| 47 |
+
children=dmc.ActionIcon(
|
| 48 |
+
DashIconify(icon="tabler:layout-dashboard", height=18),
|
| 49 |
+
size="md",
|
| 50 |
+
variant="subtle",
|
| 51 |
+
color="gray",
|
| 52 |
+
),
|
| 53 |
+
),
|
| 54 |
+
style={"lineHeight": 0},
|
| 55 |
+
),
|
| 56 |
+
dmc.Switch(
|
| 57 |
+
id="color-scheme-switch", size="lg", color="gray",
|
| 58 |
+
onLabel="🌙", offLabel="☀️", persistence=True
|
| 59 |
+
),
|
| 60 |
+
],
|
| 61 |
style={"height": "100%"},
|
| 62 |
)
|
| 63 |
|