Skip to content

Commit

Permalink
SP-07: Update focus
Browse files Browse the repository at this point in the history
  • Loading branch information
Tihi321 committed Aug 6, 2024
1 parent eaca8d4 commit 1fadfbf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
20 changes: 16 additions & 4 deletions src/blocks/shortcuts/CustomShortcuts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ export const CustomShortcuts = () => {
{!showCustomShortcuts() && (
<HiddenContainer>
<ShowShortcutsButton
onClick={() => {
onClick={(event) => {
event.preventDefault();
event.stopPropagation();
localStorage.setItem("showcustomshortcuts", "true");
setShowCustomShotcuts(true);
}}
Expand All @@ -213,7 +215,9 @@ export const CustomShortcuts = () => {
<Shortcut>
<Link href={values.url}>{values.name}</Link>
<RemoveButton
onClick={() => {
onClick={(event) => {
event.preventDefault();
event.stopPropagation();
const newShortcuts = shortcuts().filter(
(shortcut) => !isEqual(shortcut.name, values.name)
);
Expand All @@ -228,11 +232,19 @@ export const CustomShortcuts = () => {
</Shortcuts>
<AddContainer class={showInputs() ? "show" : ""}>
<ToggleButtons>
<AddButton onClick={() => setShowInputs(!showInputs())}>
<AddButton
onClick={(event) => {
event.preventDefault();
event.stopPropagation();
setShowInputs(!showInputs());
}}
>
{showInputs() ? "-" : "+"}
</AddButton>
<HideShortcutsButton
onClick={() => {
onClick={(event) => {
event.preventDefault();
event.stopPropagation();
localStorage.setItem("showcustomshortcuts", "false");
setShowCustomShotcuts(false);
}}
Expand Down
6 changes: 3 additions & 3 deletions src/layouts/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
};
document.addEventListener("DOMContentLoaded", () => {
const focusButton = document.querySelector(".focus");
const focusButton = document.querySelector("#focus-button");
focusButton?.addEventListener("click", () => {
toggleFocus();
});
Expand Down Expand Up @@ -39,7 +39,7 @@
</div>

<div class="socials">
<button class="focus">
<button id="focus-button" class="focus-button">
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
Expand Down Expand Up @@ -160,7 +160,7 @@
}
}

.focus {
.focus-button {
background-color: transparent;
border: none;
cursor: pointer;
Expand Down

0 comments on commit 1fadfbf

Please sign in to comment.