From 745dc7545efdd181becc5ae7659e85fa3d4689cf Mon Sep 17 00:00:00 2001 From: John Lu Date: Mon, 29 Jul 2024 22:29:23 -0400 Subject: [PATCH] Fixed Redirect Button - if came from foreign page, take to home page - if no href was passed down, take to wherever they were before - if an explicit href was passed down, take client to wherever the href is --- src/components/Back/Back.astro | 31 ++++++++++++++++++-- src/pages/practice/tag/[tag].astro | 2 +- src/pages/questions/[...path].astro | 2 +- src/pages/questions/solution/[...path].astro | 2 +- 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/components/Back/Back.astro b/src/components/Back/Back.astro index c2628e93..d02dab2f 100644 --- a/src/components/Back/Back.astro +++ b/src/components/Back/Back.astro @@ -1,8 +1,33 @@ --- const { href, label } = Astro.props; import "./Back.scss"; + +const usedLabel = label ? label : "Back"; --- - {label} +
+ + {usedLabel} +
+ + diff --git a/src/pages/practice/tag/[tag].astro b/src/pages/practice/tag/[tag].astro index a77c7044..bdcee49b 100644 --- a/src/pages/practice/tag/[tag].astro +++ b/src/pages/practice/tag/[tag].astro @@ -112,7 +112,7 @@ const tabTitle = tag
- +
diff --git a/src/pages/questions/[...path].astro b/src/pages/questions/[...path].astro index 9366aa67..1ddf8005 100644 --- a/src/pages/questions/[...path].astro +++ b/src/pages/questions/[...path].astro @@ -52,7 +52,7 @@ const title = formatString(path);
-
+

{title}

diff --git a/src/pages/questions/solution/[...path].astro b/src/pages/questions/solution/[...path].astro index 032212b4..c3339002 100644 --- a/src/pages/questions/solution/[...path].astro +++ b/src/pages/questions/solution/[...path].astro @@ -44,7 +44,7 @@ const question = await loadQuestion();
-
+