Skip to content

Commit

Permalink
style: fix formatting
Browse files Browse the repository at this point in the history
Signed-off-by: rare-magma <[email protected]>
  • Loading branch information
rare-magma committed Jul 26, 2024
1 parent b4c7642 commit f4fd54e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 32 deletions.
2 changes: 1 addition & 1 deletion e2e/accessibility.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from "@playwright/test";
import { AxeBuilder } from "@axe-core/playwright";
import { expect, test } from "@playwright/test";

test("should not have any automatically detectable accessibility issues on landing page", async ({
page,
Expand Down
9 changes: 4 additions & 5 deletions src/components/Budget/BudgetPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { lazy, Suspense, useEffect, useState } from "react";
import { Suspense, lazy, useEffect, useState } from "react";
import { Col, Container, Row, ToastContainer } from "react-bootstrap";
import { useHotkeys } from "react-hotkeys-hook";
import { useParams } from "react-router-dom";
Expand Down Expand Up @@ -79,8 +79,8 @@ export function BudgetPage() {
// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
useEffect(() => {
try {
const shouldLoadBudgetsFromList = budgetList && budgetList.length >= 1 &&
Array.isArray(budgetList);
const shouldLoadBudgetsFromList =
budgetList && budgetList.length >= 1 && Array.isArray(budgetList);

if (shouldLoadBudgetsFromList) {
if (name.trim() !== "undefined") {
Expand Down Expand Up @@ -138,8 +138,7 @@ export function BudgetPage() {
<div className="card-columns">
<StatCard
key={`${budget?.expenses.total} + ${budget?.incomes.total}-${budget.id}-stat-card`}
onShowGraphs={() =>
setShowGraphs(true)}
onShowGraphs={() => setShowGraphs(true)}
/>

<div className="mt-3" />
Expand Down
34 changes: 16 additions & 18 deletions src/components/NavBar/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ export interface SearchOption {

export function NavBar() {
const searchRef = useRef<TypeaheadRef>(null);
const nameRef = useRef<HTMLInputElement>() as React.MutableRefObject<
HTMLInputElement
>;
const nameRef =
useRef<HTMLInputElement>() as React.MutableRefObject<HTMLInputElement>;
const deleteButtonRef = useRef<HTMLButtonElement>(null);

const [expanded, setExpanded] = useState(false);
Expand Down Expand Up @@ -98,9 +97,8 @@ export function NavBar() {
setTheme("dark");
}

mediaQueryList.addEventListener(
"change",
(event) => setTheme(event.matches ? "dark" : "light"),
mediaQueryList.addEventListener("change", (event) =>
setTheme(event.matches ? "dark" : "light"),
);
}, []);

Expand Down Expand Up @@ -240,9 +238,7 @@ export function NavBar() {
placement="end"
show={expanded}
>
<Offcanvas.Header
style={{ justifyContent: "space-between" }}
>
<Offcanvas.Header style={{ justifyContent: "space-between" }}>
<Offcanvas.Title id={`offcanvasNavbarLabel-expand-md`}>
{budget?.name ?? "guitos"}
</Offcanvas.Title>
Expand Down Expand Up @@ -289,11 +285,13 @@ export function NavBar() {
buttonAriaLabel={"undo change"}
buttonClassName="w-100"
buttonVariant={"outline-info"}
buttonIcon={expanded
? (
buttonIcon={
expanded ? (
"undo"
) : (
<BsArrowCounterclockwise aria-hidden />
)
: <BsArrowCounterclockwise aria-hidden />}
}
/>

<NavBarItem
Expand All @@ -305,9 +303,9 @@ export function NavBar() {
buttonAriaLabel={"redo change"}
buttonClassName="w-100"
buttonVariant={"outline-info"}
buttonIcon={expanded
? "redo"
: <BsArrowClockwise aria-hidden />}
buttonIcon={
expanded ? "redo" : <BsArrowClockwise aria-hidden />
}
/>
</>
)}
Expand Down Expand Up @@ -360,9 +358,9 @@ export function NavBar() {
buttonClassName="w-100"
buttonVariant={"outline-info"}
buttonLink="https://github.com/rare-magma/guitos#getting-started"
buttonIcon={expanded
? "instructions"
: <BsQuestionLg aria-hidden />}
buttonIcon={
expanded ? "instructions" : <BsQuestionLg aria-hidden />
}
target="_blank"
/>
</Nav>
Expand Down
14 changes: 6 additions & 8 deletions src/components/StatCard/StatCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,13 @@ export function StatCard({ onShowGraphs }: StatCardProps) {
const stat = budget?.stats;
const [autoGoal, setAutoGoal] = useState(false);

const shouldCalculateAvailablePerc = revenuePercentage <= 100 && stat &&
stat.available > 0;
const shouldCalculateAvailablePerc =
revenuePercentage <= 100 && stat && stat.available > 0;

const goalRef = useRef<HTMLInputElement>() as React.MutableRefObject<
HTMLInputElement
>;
const reservesRef = useRef<HTMLInputElement>() as React.MutableRefObject<
HTMLInputElement
>;
const goalRef =
useRef<HTMLInputElement>() as React.MutableRefObject<HTMLInputElement>;
const reservesRef =
useRef<HTMLInputElement>() as React.MutableRefObject<HTMLInputElement>;

useHotkeys("g", (e) => !e.repeat && focusRef(goalRef), {
preventDefault: true,
Expand Down

0 comments on commit f4fd54e

Please sign in to comment.