Skip to content

Commit

Permalink
fixed formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
shivansh-bhatnagar18 committed May 30, 2024
1 parent 8d2b3ed commit a73de43
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 48 deletions.
8 changes: 4 additions & 4 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ const router = createBrowserRouter([
{
path: '/play',
element: <PlayOptions />,
},{
},
{
path: '/game',
element: <Game/>
element: <Game />,
},
{ path: '/about', element: <About /> },
],
},
]);

function App() {
return <RouterProvider router={router}/>
return <RouterProvider router={router} />;
}

export default App;
8 changes: 2 additions & 6 deletions frontend/src/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import './index.css';

function Navbar() {
return (
<div className='flex flex-row'>
Navbar
</div>
)
return <div className="flex flex-row">Navbar</div>;
}

export default Navbar
export default Navbar;
14 changes: 4 additions & 10 deletions frontend/src/library/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,10 @@
type ButtonProps = {
onClick: () => void;
children: React.ReactNode;
}
};

function Button({onClick, children}:ButtonProps) {
return (
<button onClick={onClick}>
{
children
}
</button>
)
function Button({ onClick, children }: ButtonProps) {
return <button onClick={onClick}>{children}</button>;
}

export default Button
export default Button;
3 changes: 1 addition & 2 deletions frontend/src/library/input.module.css
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

/* rules defined in this file are scoped to the js/ts file importing this. */
/* rules defined in this file are scoped to the js/ts file importing this. */
12 changes: 4 additions & 8 deletions frontend/src/pages/About.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@


function About() {
return (
<>
<h1>
About this project
</h1>
<p>This project was developed as a part of CSOC, IIT(BHU)</p>
<h1>About this project</h1>
<p>This project was developed as a part of CSOC, IIT(BHU)</p>
</>
)
);
}

export default About
export default About;
13 changes: 6 additions & 7 deletions frontend/src/pages/AppLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { Outlet } from "react-router-dom"
import Navbar from "../Navbar"

import { Outlet } from 'react-router-dom';
import Navbar from '../Navbar';

function AppLayout() {
return (
<div>
<Navbar/>
<Outlet/>
<Navbar />
<Outlet />
{/* todo: Add a footer component */}
</div>
)
);
}

export default AppLayout
export default AppLayout;
7 changes: 3 additions & 4 deletions frontend/src/pages/Error.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { Link } from "react-router-dom"

import { Link } from 'react-router-dom';

function Error() {
return (
<div>
This page does not exist!
<Link to="home">Go back to homepage</Link>
</div>
)
);
}

export default Error
export default Error;
6 changes: 2 additions & 4 deletions frontend/src/pages/Game.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@


function Game() {
return (
<div>
<div>X's turn</div>
</div>
)
);
}

export default Game
export default Game;
4 changes: 2 additions & 2 deletions frontend/src/pages/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Link } from "react-router-dom"
import { Link } from 'react-router-dom';

function Home() {
return (
Expand All @@ -9,4 +9,4 @@ function Home() {
);
}

export default Home
export default Home;
2 changes: 1 addition & 1 deletion frontend/src/pages/PlayOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Button from '../library/button';
function PlayOptions() {
const navigate = useNavigate();
function handleCreateGame() {
console.log("Creating a new game")
console.log('Creating a new game');
navigate('/game');
}

Expand Down

0 comments on commit a73de43

Please sign in to comment.