Skip to content

Commit

Permalink
chore: re-add semicolons
Browse files Browse the repository at this point in the history
  • Loading branch information
jackcasstlesjones committed Dec 1, 2024
1 parent 2af6ac1 commit 974874a
Show file tree
Hide file tree
Showing 18 changed files with 134 additions and 136 deletions.
4 changes: 1 addition & 3 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"singleQuote": false,
"trailingComma": "es5",
"semi": false
"singleQuote": false
}
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = { extends: ["@commitlint/config-conventional"] }
module.exports = { extends: ["@commitlint/config-conventional"] };
4 changes: 2 additions & 2 deletions postcss.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ const config = {
plugins: {
tailwindcss: {},
},
}
};

export default config
export default config;
30 changes: 15 additions & 15 deletions src/app/addTool/components/AddToolTags.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
import { useEffect, useState } from "react"
import { useToolkitForm } from "@/context/ToolkitFormContext"
import Button from "@/ui/shared/Button"
import rxdbInit from "@/lib/db/rxdbInit"
import { useEffect, useState } from "react";
import { useToolkitForm } from "@/context/ToolkitFormContext";
import Button from "@/ui/shared/Button";
import rxdbInit from "@/lib/db/rxdbInit";

export default function AddTags() {
const { formState, setFormState } = useToolkitForm()
const [categories, setCategories] = useState<string[]>([])
const { formState, setFormState } = useToolkitForm();
const [categories, setCategories] = useState<string[]>([]);

useEffect(() => {
const fetchCategories = async () => {
const db = await rxdbInit()
const allCategories = await db.categories.find().exec()
setCategories(allCategories.map((cat) => cat.name))
}
fetchCategories()
}, [])
const db = await rxdbInit();
const allCategories = await db.categories.find().exec();
setCategories(allCategories.map((cat) => cat.name));
};
fetchCategories();
}, []);

const toggleCategory = (category: string) => {
setFormState((prev) => ({
...prev,
categories: prev.categories.includes(category)
? prev.categories.filter((c) => c !== category)
: [...prev.categories, category],
}))
}
}));
};

return (
<div>
Expand All @@ -44,5 +44,5 @@ export default function AddTags() {
))}
</div>
</div>
)
);
}
22 changes: 11 additions & 11 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import "../styles/globals.css"
import type { Metadata, Viewport } from "next"
import type { ReactNode } from "react"
import Navbar from "@/ui/layout/Navbar/Navbar"
import "../styles/globals.css";
import type { Metadata, Viewport } from "next";
import type { ReactNode } from "react";
import Navbar from "@/ui/layout/Navbar/Navbar";

const APP_NAME = "Things We Do"
const APP_DEFAULT_TITLE = "Things We Do"
const APP_TITLE_TEMPLATE = "%s - Thing We Do"
const APP_DESCRIPTION = "Best PWA app in the world!"
const APP_NAME = "Things We Do";
const APP_DEFAULT_TITLE = "Things We Do";
const APP_TITLE_TEMPLATE = "%s - Thing We Do";
const APP_DESCRIPTION = "Best PWA app in the world!";

export const metadata: Metadata = {
applicationName: APP_NAME,
Expand Down Expand Up @@ -41,11 +41,11 @@ export const metadata: Metadata = {
},
description: APP_DESCRIPTION,
},
}
};

export const viewport: Viewport = {
themeColor: "#FFFFFF",
}
};

export default function RootLayout({ children }: { children: ReactNode }) {
return (
Expand All @@ -56,5 +56,5 @@ export default function RootLayout({ children }: { children: ReactNode }) {
<Navbar />
</body>
</html>
)
);
}
18 changes: 9 additions & 9 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
"use client"
"use client";

import { useEffect } from "react"
import rxdbInit from "@/lib/db/rxdbInit"
import { useEffect } from "react";
import rxdbInit from "@/lib/db/rxdbInit";

export default function Home() {
useEffect(() => {
const init = async () => {
try {
await rxdbInit()
await rxdbInit();
} catch (error) {
console.error("Database initialization error:", error)
console.error("Database initialization error:", error);
}
}
init()
}, [])
};
init();
}, []);
return (
<>
<h1 className="text-red-500">Things We Do Home</h1>
</>
)
);
}
14 changes: 7 additions & 7 deletions src/app/sw.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { defaultCache } from "@serwist/next/worker"
import type { PrecacheEntry, SerwistGlobalConfig } from "serwist"
import { Serwist } from "serwist"
import { defaultCache } from "@serwist/next/worker";
import type { PrecacheEntry, SerwistGlobalConfig } from "serwist";
import { Serwist } from "serwist";

// This declares the value of `injectionPoint` to TypeScript.
// `injectionPoint` is the string that will be replaced by the
// actual precache manifest. By default, this string is set to
// `"self.__SW_MANIFEST"`.
declare global {
interface WorkerGlobalScope extends SerwistGlobalConfig {
__SW_MANIFEST: (PrecacheEntry | string)[] | undefined
__SW_MANIFEST: (PrecacheEntry | string)[] | undefined;
}
}

declare const self: ServiceWorkerGlobalScope
declare const self: ServiceWorkerGlobalScope;

const serwist = new Serwist({
precacheEntries: self.__SW_MANIFEST,
skipWaiting: true,
clientsClaim: true,
navigationPreload: true,
runtimeCaching: defaultCache,
})
});

serwist.addEventListeners()
serwist.addEventListeners();
34 changes: 17 additions & 17 deletions src/app/toolkit/components/CheckBox.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
"use client"
import { useState, useEffect } from "react"
"use client";
import { useState, useEffect } from "react";

interface CheckBoxComponentData {
id: number
checked?: boolean
name: string
link?: string
icon: string
category: string[]
id: number;
checked?: boolean;
name: string;
link?: string;
icon: string;
category: string[];
}

export default function CheckBox() {
const [data, setData] = useState<CheckBoxComponentData[]>([])
const [data, setData] = useState<CheckBoxComponentData[]>([]);

useEffect(() => {
const fetchData = async () => {
Expand Down Expand Up @@ -51,15 +51,15 @@ export default function CheckBox() {
icon: "🎤",
category: ["Category 7"],
},
]
setData(dummyData)
}
fetchData()
}, [])
];
setData(dummyData);
};
fetchData();
}, []);

const handleToggle = (id: number) => {
setData((prevData) => prevData.filter((item) => item.id !== id))
}
setData((prevData) => prevData.filter((item) => item.id !== id));
};

return (
<div className="flex flex-col space-y-4">
Expand Down Expand Up @@ -93,5 +93,5 @@ export default function CheckBox() {
</div>
))}
</div>
)
);
}
6 changes: 3 additions & 3 deletions src/app/toolkit/components/SearchBar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client"
import QuestionMarkButton from "../../../ui/shared/QuestionButton"
"use client";
import QuestionMarkButton from "../../../ui/shared/QuestionButton";

export default function SearchBar() {
return (
Expand Down Expand Up @@ -40,5 +40,5 @@ export default function SearchBar() {
</button>
</div>
</div>
)
);
}
14 changes: 7 additions & 7 deletions src/app/toolkit/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ReactNode } from "react"
import Header from "../../ui/layout/ToolkitHeader"
import CategoryBar from "../../ui/CategoryBar/CategoryBar"
import SearchBar from "./components/SearchBar"
import CheckBox from "./components/CheckBox"
import FloatingButton from "./components/floatingButton"
import { ReactNode } from "react";
import Header from "../../ui/layout/ToolkitHeader";
import CategoryBar from "../../ui/CategoryBar/CategoryBar";
import SearchBar from "./components/SearchBar";
import CheckBox from "./components/CheckBox";
import FloatingButton from "./components/floatingButton";

export default function ToolkitLayout({ children }: { children: ReactNode }) {
return (
Expand All @@ -24,5 +24,5 @@ export default function ToolkitLayout({ children }: { children: ReactNode }) {
{/* Floating Button */}
<FloatingButton />
</div>
)
);
}
4 changes: 2 additions & 2 deletions src/app/toolkit/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"use client"
"use client";
export default function Page() {
return <></>
return <></>;
}
28 changes: 14 additions & 14 deletions src/ui/CategoryBar/CategoryBar.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"use client"
import { useState } from "react"
import Button from "../shared/Button"
"use client";
import { useState } from "react";
import Button from "../shared/Button";

const categoryBarClass = `
whitespace-nowrap flex items-center gap-4 px-4 py-2
overflow-x-auto bg-twd-background border-b
border-gray-700 sm:gap-6 sm:px-6 focus:ring-2 focus:ring-twd-secondary-purple
`
`;

const CategoryBar = () => {
const categories = [
Expand All @@ -18,26 +18,26 @@ const CategoryBar = () => {
"Category 5",
"Category 6",
"Category 7",
]
];

const [selectedCategories, setSelectedCategories] = useState<string[]>([])
const [selectedCategories, setSelectedCategories] = useState<string[]>([]);

const handleCategoryClick = (category: string) => {
if (category === "All") {
setSelectedCategories(["All"])
setSelectedCategories(["All"]);
} else {
setSelectedCategories((prev) =>
prev.includes(category)
? prev.filter((c) => c !== category)
: [...prev.filter((c) => c !== "All"), category]
)
);
}
}
};

return (
<div className={categoryBarClass}>
{categories.map((category) => {
const isActive = selectedCategories.includes(category)
const isActive = selectedCategories.includes(category);

return (
<Button
Expand All @@ -51,10 +51,10 @@ const CategoryBar = () => {
onClick={() => handleCategoryClick(category)}
ariaPressed={isActive}
/>
)
);
})}
</div>
)
}
);
};

export default CategoryBar
export default CategoryBar;
14 changes: 7 additions & 7 deletions src/ui/layout/ToolkitHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"use client"
import ImageComponent from "../shared/Image"
import QuestionMarkButton from "../shared/QuestionButton"
"use client";
import ImageComponent from "../shared/Image";
import QuestionMarkButton from "../shared/QuestionButton";

const headerClasses = `
flex items-center justify-between
px-4 py-6 shadow-md sm:px-6 sm:py-3`
px-4 py-6 shadow-md sm:px-6 sm:py-3`;

const Header = () => {
return (
Expand All @@ -28,7 +28,7 @@ const Header = () => {
/>
</div>
</header>
)
}
);
};

export default Header
export default Header;
14 changes: 7 additions & 7 deletions src/ui/shared/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
interface ButtonProps {
label: string
onClick?: () => void
className?: string
ariaPressed?: boolean
label: string;
onClick?: () => void;
className?: string;
ariaPressed?: boolean;
}

const Button: React.FC<ButtonProps> = ({
Expand All @@ -19,7 +19,7 @@ const Button: React.FC<ButtonProps> = ({
>
{label}
</button>
)
}
);
};

export default Button
export default Button;
Loading

0 comments on commit 974874a

Please sign in to comment.