Skip to content

Commit

Permalink
minor-feat: possibility to choose which page the "toBack" button appe…
Browse files Browse the repository at this point in the history
…ars on
  • Loading branch information
RomanFama592 committed Feb 9, 2024
1 parent 4697bc6 commit 0b537a3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "module",
"name": "tic-tac-toe-world",
"version": "1.2.5",
"version": "1.2.6",
"scripts": {
"dev": "astro dev --host",
"start:build": "astro check && astro build && astro preview --host",
Expand Down
10 changes: 8 additions & 2 deletions src/layouts/FramePage.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
---
import { goals, linkedIn, email, repoGithub } from "@/assets/ts/constants";
import { version } from "../../package.json";
interface Props {
enabledButtonBack?: boolean
}
const { enabledButtonBack = true }: Props = Astro.props;
---

<nav
Expand All @@ -9,7 +15,7 @@ import { version } from "../../package.json";
class="navbar sticky top-0 w-full h-[10dvh] z-20 shadow-lg bg-base-100 *:text-black justify-between lg:justify-around"
>
{
Astro.url.pathname !== "/" && (
enabledButtonBack && (
<button
onclick="window.history.back();"
id="toBack"
Expand Down Expand Up @@ -73,4 +79,4 @@ import { version } from "../../package.json";
v {version}
</h3>
</footer>
</main>
</main>
2 changes: 1 addition & 1 deletion src/pages/404.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import FramePage from "@/layouts/FramePage.astro";
title="Pagina no encontrada"
description=""
>
<FramePage>
<FramePage enabledButtonBack={false}>
<div class="flex items-center justify-center size-full m-auto">
<p class="m-5 text-2xl text-center text-pretty">
Lo sentimos pero <span id="pathnameSpan" class="p-1 bg-base-100 rounded-md font-semibold"
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const sections: ISections = {
---

<Html title="Welcome to Tic Tac Toe World." description="">
<FramePage>
<FramePage enabledButtonBack={false}>
{/* Header */}
<header
class="flex flex-col lg:flex-row
Expand Down

0 comments on commit 0b537a3

Please sign in to comment.