Skip to content

Commit 8638b77

Browse files
committed
Updated secrets view and favicon
1 parent 4c0af6c commit 8638b77

6 files changed

Lines changed: 17 additions & 18 deletions

File tree

‎public/ico/mudkipz.ico‎

129 KB
Binary file not shown.

‎src/app/(modal)/secrets/input/secret-input.tsx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ import { useRouter } from "next/navigation";
66
import { SnackbarVariant, StatDefinition } from "types";
77
import { useSnackbar } from "@context";
88
import stats from "@config/settings";
9-
import { IconProp } from "@fortawesome/fontawesome-svg-core";
109
import { useSettingStores } from "@stores";
11-
import { useActiveElement } from "@hooks/useActiveElement";
1210

1311
const CANCEL_AUDIO_SRC = '/audio/cancel.mp3';
1412
const TROPHY_AUDIO_SRC = '/audio/trophy.mp3';

‎src/app/(modal)/secrets/page.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import React from "react";
44
import { Modal, ModalMenuButton } from "@components/modal/modal";
55
import SecretsView from "./secrets-view";
6-
import { faHandPointer } from "@fortawesome/free-solid-svg-icons";
6+
import { faPenToSquare } from "@fortawesome/free-solid-svg-icons";
77
import "./secrets.scss";
88

99
export default function SecretsPage() {
@@ -14,7 +14,7 @@ export default function SecretsPage() {
1414
description: '',
1515
url: '/secrets/input',
1616
controllerIcon: 'b',
17-
mobileIcon: faHandPointer,
17+
mobileIcon: faPenToSquare,
1818
};
1919

2020
return (

‎src/app/(modal)/secrets/secrets-view.tsx‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
"use client";
22

33
import React, { useEffect, useRef, useState } from "react";
4-
import { StoreApi, ExtractState } from "zustand";
54
import { StorageValue } from "zustand/middleware";
65
import SecretView from "./secret-view";
7-
import { AchievementId, achievements, secretGroups, secrets, Setting, StatGroupDefinition } from "types";
6+
import { AchievementId, achievements, secretGroups, secrets, StatGroupDefinition } from "types";
87
import "./secrets.scss";
98
import { SettingState } from "@stores";
109

1110
const SECRET_TAP_MIN = 5;
1211

13-
14-
1512
export default function SecretsView() {
1613

1714
const tableRef = useRef<HTMLTableElement | null>(null);
1815
const [activeCell, setActiveCell] = useState<[number, number]>([0, 0]);
19-
//const [allUnlocked, setAllUnlocked] = useState(false);
2016
const allUnlocked = false;
2117

2218
const totalRows = secrets.length;
@@ -40,10 +36,14 @@ export default function SecretsView() {
4036
const items = secrets.filter(s => s.type === group.type);
4137
if (!items) return false;
4238
if (!group.isHidden) return true;
43-
items.forEach(i => {
44-
if (isUnlocked(i.id)) return true;
39+
const result = items.find(i => {
40+
const id = i.id;
41+
const unlocked = isUnlocked(id);
42+
if (unlocked) {
43+
return true;
44+
}
4545
});
46-
return false;
46+
return !!result;
4747
};
4848

4949
const handleKeyDown = (e: React.KeyboardEvent<HTMLTableElement>) => {

‎src/app/favicon.ico‎

39.1 KB
Binary file not shown.

‎src/components/modal/modal.tsx‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import useKeyboard from "@hooks/useKeyboard";
1111
import ControllerIcon, { ControllerButton } from "@components/icons/controller-icon";
1212
import { KeyPressAction } from "types";
1313
import "./modal.css";
14-
import { useActiveElement } from "@hooks/useActiveElement";
1514

1615
const AUDIO_SRC = '/audio/nav.mp3';
1716

@@ -86,7 +85,7 @@ export function ModalClose({ menuButton }: { menuButton?: ModalMenuButton }) {
8685
<Link href={menuButton.url ?? ''} onClick={onMenuItemClick}
8786
className=""
8887
ref={menuButtonRef}>
89-
<div className="items-center justify-items-center align-items-center inline-flex select-none my-auto">
88+
<div className="text-xl items-center justify-items-center align-items-center inline-flex select-none my-auto">
9089
<div className="relative max-w-10">
9190
<ControllerIcon icon={menuButton.controllerIcon} className="m-2" />
9291
</div>
@@ -119,7 +118,7 @@ export function ModalClose({ menuButton }: { menuButton?: ModalMenuButton }) {
119118
<Link href={menuButton.url ?? ''} onClick={menuButton.action}
120119
className=""
121120
ref={menuButtonRef}>
122-
<div className="items-center justify-items-center align-items-center inline-flex select-none my-auto">
121+
<div className="text-xl items-center justify-items-center align-items-center inline-flex select-none my-auto">
123122
<FontAwesomeIcon icon={menuButton.mobileIcon} className="w-7 h-7 aspect-square inline-flex my-auto max-w-10" />
124123
<span className="mx-2 my-auto">{menuButton.title}</span>
125124
</div>
@@ -148,7 +147,7 @@ export function ModalClose({ menuButton }: { menuButton?: ModalMenuButton }) {
148147
<Link href={menuButton.url ?? ''} onClick={menuButton.action}
149148
className=""
150149
ref={menuButtonRef}>
151-
<div className="items-center justify-items-center align-items-center inline-flex select-none my-auto">
150+
<div className="text-lg items-center justify-items-center align-items-center inline-flex select-none my-auto">
152151
<kbd className="h-9 w-13 px-2 py-1.5 text-gray-800 bg-gray-100 mx-0.75 border border-gray-200 rounded-lg dark:bg-gray-400/25 dark:text-white dark:border-gray-500/25">
153152
{menuButton.key.toUpperCase()}
154153
</kbd>
@@ -161,8 +160,10 @@ export function ModalClose({ menuButton }: { menuButton?: ModalMenuButton }) {
161160
<div className="modal-action grid text-white text-center object-center my-auto">
162161
{/* need to set the href so that the user can close modal by clicking on the buttton */}
163162
<Link href="/" >
164-
<div className="justify-between align-items-center text-lg hover:animate-pulse select-none my-auto">
165-
<kbd className="h-9 w-13 px-2 py-1.5 text-gray-800 bg-gray-100 mx-0.75 border border-gray-200 rounded-lg dark:bg-gray-400/25 dark:text-white dark:border-gray-500/25">Esc</kbd>
163+
<div className="text-lg items-center justify-items-center align-items-center inline-flex select-none my-auto">
164+
<kbd className="h-9 w-13 px-2 py-1.5 text-gray-800 bg-gray-100 mx-0.75 border border-gray-200 rounded-lg dark:bg-gray-400/25 dark:text-white dark:border-gray-500/25 flex">
165+
<span className="my-auto inline-block align-middle">Esc</span>
166+
</kbd>
166167
<span className="mx-2 my-auto">close</span>
167168
</div>
168169
</Link>

0 commit comments

Comments
 (0)