Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove console logs #21

Merged
merged 4 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 20 additions & 23 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
# React + TypeScript + Vite
# Frontend

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
## Get Your Freaking Electives

Currently, two official plugins are available:
GYFE simplifies course selection by providing available depth and breadth electives for the upcoming semester.

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
### Running locally

## Expanding the ESLint configuration
First install [nodejs](https://nodejs.org/en/download/package-manager). Then install `pnpm` by running `npm install -g pnpm`.

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
Then follow the given steps to launch the frontend:

- Configure the top-level `parserOptions` property like this:
1. Clone the repository
```sh
git clone https://github.com/metakgp/gyfe.git
```
2. Install dependencies
```sh
cd gyfe/frontend
pnpm install
```
3. Start the server
```sh
pnpm dev
```

```js
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
}
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
This setup will launch the frontend. To start backend server also, please follow the instructions [here](https://github.com/metakgp/gyfe/blob/main/README.md)
1 change: 0 additions & 1 deletion frontend/src/components/Electives.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const Electives: React.FC = () => {

if (!res.ok) {
toast.error("Some Error Occured. Please Try Again.");
console.log(res.statusText);
return;
}

Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/MultiForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import ErrorPage from "./ErrorPage";

const MultiForm: React.FC = () => {
const { currentStep, user } = useAppContext();
console.log({ currentStep, user });
if (currentStep == 2 && user.sessionToken && user.ssoToken)
return <Electives />;
if (currentStep == 1 && user.sessionToken && user.securityQuestion)
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/RollForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const RollForm: React.FC = () => {
});

const resData = await res.json();
console.log(resData);

if (!res.ok) {
toast.error(resData.message);
if (res.status == 400) {
Expand Down
Loading