MindCheck Bot commited on
Commit ·
2cbe320
1
Parent(s): 85bcd03
Fix mobile history navbar layout
Browse files
mindcheck-web/src/app/history/page.tsx
CHANGED
|
@@ -57,28 +57,36 @@ export default function HistoryPage() {
|
|
| 57 |
<>
|
| 58 |
{/* TopNavBar */}
|
| 59 |
<nav className="bg-surface dark:bg-on-background w-full top-0 sticky border-b border-outline-variant z-50">
|
| 60 |
-
<div className="flex
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
<
|
| 66 |
-
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
Screening History
|
| 69 |
</div>
|
| 70 |
-
|
|
|
|
|
|
|
| 71 |
{history.length > 0 && (
|
| 72 |
<button
|
| 73 |
onClick={clearHistory}
|
| 74 |
className="text-error hover:opacity-80 transition-opacity font-caption-sm text-caption-sm flex items-center gap-1"
|
| 75 |
>
|
| 76 |
<span className="material-symbols-outlined text-[18px]">delete</span>
|
| 77 |
-
Clear
|
| 78 |
</button>
|
| 79 |
)}
|
| 80 |
-
<Link href="/" className="px-4 py-2 bg-surface-container-high hover:bg-surface-container text-on-surface rounded font-caption-sm text-caption-sm transition-colors border border-outline-variant flex items-center gap-1">
|
| 81 |
-
Back to Home
|
|
|
|
| 82 |
</Link>
|
| 83 |
</div>
|
| 84 |
</div>
|
|
@@ -110,12 +118,12 @@ export default function HistoryPage() {
|
|
| 110 |
<table className="w-full text-left border-collapse">
|
| 111 |
<thead>
|
| 112 |
<tr className="border-b border-outline-variant bg-surface-container-low font-label-uppercase text-label-uppercase text-secondary">
|
| 113 |
-
<th className="py-4 px-6 font-semibold">#</th>
|
| 114 |
-
<th className="py-4 px-6 font-semibold">Date</th>
|
| 115 |
-
<th className="py-4 px-6 font-semibold">Score</th>
|
| 116 |
-
<th className="py-4 px-6 font-semibold">Category</th>
|
| 117 |
-
<th className="py-4 px-6 font-semibold">Method</th>
|
| 118 |
-
<th className="py-4 px-6 font-semibold text-right">Action</th>
|
| 119 |
</tr>
|
| 120 |
</thead>
|
| 121 |
<tbody className="font-body-md text-body-md text-on-surface">
|
|
@@ -127,26 +135,26 @@ export default function HistoryPage() {
|
|
| 127 |
className="border-b border-outline-variant hover:bg-surface-container-low transition-colors"
|
| 128 |
style={{ animation: `fadeSlideIn 0.4s ease-out ${i * 50}ms both` }}
|
| 129 |
>
|
| 130 |
-
<td className="py-4 px-6 text-on-surface-variant">{i + 1}</td>
|
| 131 |
-
<td className="py-4 px-6">
|
| 132 |
{new Date(item.date).toLocaleDateString("en-US", {
|
| 133 |
day: "numeric",
|
| 134 |
month: "short",
|
| 135 |
year: "numeric",
|
| 136 |
})}
|
| 137 |
</td>
|
| 138 |
-
<td className="py-4 px-6 font-medium">{Math.round(item.total_score)}</td>
|
| 139 |
-
<td className="py-4 px-6">
|
| 140 |
<span className={`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium border ${badgeStyle}`}>
|
| 141 |
{item.severity.label}
|
| 142 |
</span>
|
| 143 |
</td>
|
| 144 |
-
<td className="py-4 px-6">
|
| 145 |
<span className={`text-xs ${item.fallback ? "text-[#F57C00]" : "text-primary"}`}>
|
| 146 |
{item.fallback ? "Keyword" : "AI Model"}
|
| 147 |
</span>
|
| 148 |
</td>
|
| 149 |
-
<td className="py-4 px-6 text-right">
|
| 150 |
<Link
|
| 151 |
className="text-primary hover:text-primary-container font-medium flex items-center justify-end gap-1"
|
| 152 |
href={`/result?id=${i}`}
|
|
@@ -161,7 +169,7 @@ export default function HistoryPage() {
|
|
| 161 |
</table>
|
| 162 |
</div>
|
| 163 |
{/* Summary Footer */}
|
| 164 |
-
<div className="border-t border-outline-variant bg-surface-container-lowest px-6 py-4 flex items-center justify-between">
|
| 165 |
<div className="font-caption-sm text-caption-sm text-secondary">
|
| 166 |
{history.length} screening{history.length !== 1 ? "s" : ""} saved
|
| 167 |
</div>
|
|
@@ -179,7 +187,7 @@ export default function HistoryPage() {
|
|
| 179 |
<p className="font-caption-sm text-caption-sm text-on-surface-variant max-w-2xl">
|
| 180 |
MindCheck is not a substitute for professional medical diagnosis. Please contact a mental health professional if you are in an emergency.
|
| 181 |
</p>
|
| 182 |
-
<p className="font-caption-sm text-caption-sm text-on-surface-variant mt-2">©
|
| 183 |
</div>
|
| 184 |
</footer>
|
| 185 |
|
|
|
|
| 57 |
<>
|
| 58 |
{/* TopNavBar */}
|
| 59 |
<nav className="bg-surface dark:bg-on-background w-full top-0 sticky border-b border-outline-variant z-50">
|
| 60 |
+
<div className="flex items-center h-16 px-gutter max-w-container-max mx-auto">
|
| 61 |
+
{/* Left Side */}
|
| 62 |
+
<div className="flex-1 flex justify-start">
|
| 63 |
+
<Link href="/" className="font-hero-lg text-hero-lg font-bold text-primary dark:text-inverse-primary hidden md:block">
|
| 64 |
+
MindCheck
|
| 65 |
+
</Link>
|
| 66 |
+
<Link href="/" className="md:hidden text-primary flex items-center p-2 -ml-2">
|
| 67 |
+
<span className="material-symbols-outlined">arrow_back</span>
|
| 68 |
+
</Link>
|
| 69 |
+
</div>
|
| 70 |
+
|
| 71 |
+
{/* Center */}
|
| 72 |
+
<div className="text-base md:text-section-heading md:font-section-heading font-semibold text-primary truncate shrink-0 text-center">
|
| 73 |
Screening History
|
| 74 |
</div>
|
| 75 |
+
|
| 76 |
+
{/* Right Side */}
|
| 77 |
+
<div className="flex-1 flex justify-end items-center gap-2 md:gap-4">
|
| 78 |
{history.length > 0 && (
|
| 79 |
<button
|
| 80 |
onClick={clearHistory}
|
| 81 |
className="text-error hover:opacity-80 transition-opacity font-caption-sm text-caption-sm flex items-center gap-1"
|
| 82 |
>
|
| 83 |
<span className="material-symbols-outlined text-[18px]">delete</span>
|
| 84 |
+
<span className="hidden md:inline">Clear</span>
|
| 85 |
</button>
|
| 86 |
)}
|
| 87 |
+
<Link href="/" className="p-2 md:px-4 md:py-2 bg-surface-container-high hover:bg-surface-container text-on-surface rounded font-caption-sm text-caption-sm transition-colors border border-outline-variant flex items-center gap-1">
|
| 88 |
+
<span className="hidden md:inline">Back to Home</span>
|
| 89 |
+
<span className="material-symbols-outlined text-[20px] md:hidden">home</span>
|
| 90 |
</Link>
|
| 91 |
</div>
|
| 92 |
</div>
|
|
|
|
| 118 |
<table className="w-full text-left border-collapse">
|
| 119 |
<thead>
|
| 120 |
<tr className="border-b border-outline-variant bg-surface-container-low font-label-uppercase text-label-uppercase text-secondary">
|
| 121 |
+
<th className="py-3 px-3 md:py-4 md:px-6 font-semibold hidden md:table-cell">#</th>
|
| 122 |
+
<th className="py-3 px-3 md:py-4 md:px-6 font-semibold">Date</th>
|
| 123 |
+
<th className="py-3 px-3 md:py-4 md:px-6 font-semibold">Score</th>
|
| 124 |
+
<th className="py-3 px-3 md:py-4 md:px-6 font-semibold">Category</th>
|
| 125 |
+
<th className="py-3 px-3 md:py-4 md:px-6 font-semibold hidden md:table-cell">Method</th>
|
| 126 |
+
<th className="py-3 px-3 md:py-4 md:px-6 font-semibold text-right">Action</th>
|
| 127 |
</tr>
|
| 128 |
</thead>
|
| 129 |
<tbody className="font-body-md text-body-md text-on-surface">
|
|
|
|
| 135 |
className="border-b border-outline-variant hover:bg-surface-container-low transition-colors"
|
| 136 |
style={{ animation: `fadeSlideIn 0.4s ease-out ${i * 50}ms both` }}
|
| 137 |
>
|
| 138 |
+
<td className="py-3 px-3 md:py-4 md:px-6 text-on-surface-variant hidden md:table-cell">{i + 1}</td>
|
| 139 |
+
<td className="py-3 px-3 md:py-4 md:px-6">
|
| 140 |
{new Date(item.date).toLocaleDateString("en-US", {
|
| 141 |
day: "numeric",
|
| 142 |
month: "short",
|
| 143 |
year: "numeric",
|
| 144 |
})}
|
| 145 |
</td>
|
| 146 |
+
<td className="py-3 px-3 md:py-4 md:px-6 font-medium">{Math.round(item.total_score)}</td>
|
| 147 |
+
<td className="py-3 px-3 md:py-4 md:px-6">
|
| 148 |
<span className={`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium border ${badgeStyle}`}>
|
| 149 |
{item.severity.label}
|
| 150 |
</span>
|
| 151 |
</td>
|
| 152 |
+
<td className="py-3 px-3 md:py-4 md:px-6 hidden md:table-cell">
|
| 153 |
<span className={`text-xs ${item.fallback ? "text-[#F57C00]" : "text-primary"}`}>
|
| 154 |
{item.fallback ? "Keyword" : "AI Model"}
|
| 155 |
</span>
|
| 156 |
</td>
|
| 157 |
+
<td className="py-3 px-3 md:py-4 md:px-6 text-right">
|
| 158 |
<Link
|
| 159 |
className="text-primary hover:text-primary-container font-medium flex items-center justify-end gap-1"
|
| 160 |
href={`/result?id=${i}`}
|
|
|
|
| 169 |
</table>
|
| 170 |
</div>
|
| 171 |
{/* Summary Footer */}
|
| 172 |
+
<div className="border-t border-outline-variant bg-surface-container-lowest px-3 py-3 md:px-6 md:py-4 flex items-center justify-between">
|
| 173 |
<div className="font-caption-sm text-caption-sm text-secondary">
|
| 174 |
{history.length} screening{history.length !== 1 ? "s" : ""} saved
|
| 175 |
</div>
|
|
|
|
| 187 |
<p className="font-caption-sm text-caption-sm text-on-surface-variant max-w-2xl">
|
| 188 |
MindCheck is not a substitute for professional medical diagnosis. Please contact a mental health professional if you are in an emergency.
|
| 189 |
</p>
|
| 190 |
+
<p className="font-caption-sm text-caption-sm text-on-surface-variant mt-2">© {new Date().getFullYear()} MindCheck. All rights reserved.</p>
|
| 191 |
</div>
|
| 192 |
</footer>
|
| 193 |
|