Skip to content

Commit

Permalink
Prettier formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nulzo committed Oct 27, 2023
1 parent e9fc36b commit 0a5fc28
Show file tree
Hide file tree
Showing 60 changed files with 3,083 additions and 2,255 deletions.
11 changes: 4 additions & 7 deletions frontend-ts/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
module.exports = {
root: true,
env: { browser: true, es2020: true, es6: true, node: true, },
env: { browser: true, es2020: true, es6: true, node: true },
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",

],
ignorePatterns: ["dist", ".eslintrc.cjs"],
parser: "@typescript-eslint/parser",
plugins: ["react-refresh"],
rules: {
"indent": ["error", 2],
indent: ["error", 2],
"linebreak-style": ["error", "unix"], // Use Unix line endings
"quotes": ["error", "double"], // Use single quotes
"semi": ["error", "always"], // Require semicolons at the end of statements
quotes: ["error", "double"], // Use single quotes
semi: ["error", "always"], // Require semicolons at the end of statements
"no-console": "off", // You can disable this rule if you want to allow console.log
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
};


1 change: 0 additions & 1 deletion frontend-ts/components.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{

"style": "new-york",
"rsc": true,
"tsx": true,
Expand Down
26 changes: 12 additions & 14 deletions frontend-ts/index.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image" href="/UNO.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- <script src="https://cdn.tailwindcss.com"></script> -->
<title>CSLC Tutoring Portal</title>
</head>

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image" href="/UNO.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- <script src="https://cdn.tailwindcss.com"></script> -->
<title>CSLC Tutoring Portal</title>
</head>

<body class="overscroll-none">
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>

</html>
<body class="overscroll-none">
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
3 changes: 2 additions & 1 deletion frontend-ts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"eslint-plugin-react-refresh": "^0.4.3",
"highlight.js": "^11.8.0",
"lucide-react": "^0.277.0",
"prettier": "^3.0.3",
"react": "^18.2.0",
"react-csv": "^2.2.2",
"react-day-picker": "^8.9.0",
Expand Down Expand Up @@ -83,6 +82,7 @@
"autoprefixer": "^10.4.15",
"eslint": "^8.52.0",
"postcss": "^8.4.29",
"prettier": "^3.0.3",
"tailwindcss": "^3.3.3",
"typescript": "^5.0.2",
"vite": "^4.4.5"
Expand Down
4 changes: 2 additions & 2 deletions frontend-ts/src/API/axios.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Axios from "axios";

export const axios_base = Axios.create({
baseURL: "http://localhost:6969/api/",
});
baseURL: "http://localhost:6969/api/",
});
30 changes: 15 additions & 15 deletions frontend-ts/src/API/courses/useFetchCourse.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import axios from "axios"
import axios from "axios";
import { keepPreviousData, useQuery } from "@tanstack/react-query";

export default function useFetchCourse() {
async function getCourse() {
const { data } = await axios.get('http://localhost:6969/api/courses/')
return data
}
const data = useQuery({
queryKey: ["courses"],
queryFn: () => getCourse(),
placeholderData: keepPreviousData,
staleTime: 30000,
})
if (data) {
return data
}
}
async function getCourse() {
const { data } = await axios.get("http://localhost:6969/api/courses/");
return data;
}
const data = useQuery({
queryKey: ["courses"],
queryFn: () => getCourse(),
placeholderData: keepPreviousData,
staleTime: 30000,
});
if (data) {
return data;
}
}
30 changes: 15 additions & 15 deletions frontend-ts/src/API/issues/useFetchIssue.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import axios from "axios"
import axios from "axios";
import { keepPreviousData, useQuery } from "@tanstack/react-query";

export default function useFetchIssue() {
async function getIssue() {
const { data } = await axios.get('http://localhost:6969/api/issues/')
return data
}
const data = useQuery({
queryKey: ["issues"],
queryFn: () => getIssue(),
placeholderData: keepPreviousData,
staleTime: 30000,
})
if (data) {
return data
}
}
async function getIssue() {
const { data } = await axios.get("http://localhost:6969/api/issues/");
return data;
}
const data = useQuery({
queryKey: ["issues"],
queryFn: () => getIssue(),
placeholderData: keepPreviousData,
staleTime: 30000,
});
if (data) {
return data;
}
}
30 changes: 15 additions & 15 deletions frontend-ts/src/API/professors/useFetchProfessor.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import axios from "axios"
import axios from "axios";
import { keepPreviousData, useQuery } from "@tanstack/react-query";

export default function useFetchProfessor() {
async function getProfessors() {
const { data } = await axios.get('http://localhost:6969/api/professors/')
return data
}
const data = useQuery({
queryKey: ["professors"],
queryFn: () => getProfessors(),
placeholderData: keepPreviousData,
staleTime: 30000,
})
if (data) {
return data
}
}
async function getProfessors() {
const { data } = await axios.get("http://localhost:6969/api/professors/");
return data;
}
const data = useQuery({
queryKey: ["professors"],
queryFn: () => getProfessors(),
placeholderData: keepPreviousData,
staleTime: 30000,
});
if (data) {
return data;
}
}
30 changes: 15 additions & 15 deletions frontend-ts/src/API/sections/useFetchSection.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import axios from "axios"
import axios from "axios";
import { keepPreviousData, useQuery } from "@tanstack/react-query";

export default function useFetchSection() {
async function getSection() {
const { data } = await axios.get('http://localhost:6969/api/sections/')
return data
}
const data = useQuery({
queryKey: ["sections"],
queryFn: () => getSection(),
placeholderData: keepPreviousData,
staleTime: 30000,
})
if (data) {
return data
}
}
async function getSection() {
const { data } = await axios.get("http://localhost:6969/api/sections/");
return data;
}
const data = useQuery({
queryKey: ["sections"],
queryFn: () => getSection(),
placeholderData: keepPreviousData,
staleTime: 30000,
});
if (data) {
return data;
}
}
30 changes: 15 additions & 15 deletions frontend-ts/src/API/tickets/useFetchTicket.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import axios from "axios"
import axios from "axios";
import { keepPreviousData, useQuery } from "@tanstack/react-query";

export default function useFetchTicket() {
async function getTicket() {
const { data } = await axios.get('http://localhost:6969/api/tickets/')
return data
}
const data = useQuery({
queryKey: ["tickets"],
queryFn: () => getTicket(),
placeholderData: keepPreviousData,
staleTime: 30000,
})
if (data) {
return data
}
}
async function getTicket() {
const { data } = await axios.get("http://localhost:6969/api/tickets/");
return data;
}
const data = useQuery({
queryKey: ["tickets"],
queryFn: () => getTicket(),
placeholderData: keepPreviousData,
staleTime: 30000,
});
if (data) {
return data;
}
}
30 changes: 15 additions & 15 deletions frontend-ts/src/API/tutors/useFetchTutor.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import axios from "axios"
import axios from "axios";
import { keepPreviousData, useQuery } from "@tanstack/react-query";

export default function useFetchTutor() {
async function getTutors() {
const { data } = await axios.get('http://localhost:6969/api/tutors/')
return data
}
const data = useQuery({
queryKey: ["tutors"],
queryFn: () => getTutors(),
placeholderData: keepPreviousData,
staleTime: 30000,
})
if (data) {
return data
}
}
async function getTutors() {
const { data } = await axios.get("http://localhost:6969/api/tutors/");
return data;
}
const data = useQuery({
queryKey: ["tutors"],
queryFn: () => getTutors(),
placeholderData: keepPreviousData,
staleTime: 30000,
});
if (data) {
return data;
}
}
4 changes: 2 additions & 2 deletions frontend-ts/src/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { useEffect } from "react";

export default function Root() {
useEffect(() => {
const theme = localStorage.getItem('theme');
const theme = localStorage.getItem("theme");
if (theme) {
document.getElementById("root")?.classList.add('theme', theme);
document.getElementById("root")?.classList.add("theme", theme);
}
}, []);
return (
Expand Down
2 changes: 1 addition & 1 deletion frontend-ts/src/components/assets/CalendarIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default function CalendarIcon({ className }: any) {
const classname = `stroke-foreground ${className}`
const classname = `stroke-foreground ${className}`;
return (
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down
28 changes: 19 additions & 9 deletions frontend-ts/src/components/assets/ClockIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
export default function ClockIcon() {
return (
<svg xmlns="http://www.w3.org/2000/svg" className="stroke-foreground" width="20" height="20" viewBox="0 0 24 24" strokeWidth="1.5" fill="none" strokeLinecap="round" strokeLinejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" />
<path d="M12 12h-3.5" />
<path d="M12 7v5" />
</svg>
)
}
return (
<svg
xmlns="http://www.w3.org/2000/svg"
className="stroke-foreground"
width="20"
height="20"
viewBox="0 0 24 24"
strokeWidth="1.5"
fill="none"
strokeLinecap="round"
strokeLinejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" />
<path d="M12 12h-3.5" />
<path d="M12 7v5" />
</svg>
);
}
Loading

0 comments on commit 0a5fc28

Please sign in to comment.