Skip to content

Commit

Permalink
[Task] #58, clean up react learn files
Browse files Browse the repository at this point in the history
  • Loading branch information
Type-Style committed May 7, 2024
1 parent 0d2bbbe commit 49c6d81
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 244 deletions.
2 changes: 1 addition & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ app.use((req, res, next) => { // limit body for specific http methods


// routes
app.get(['/', '/contacts'], (req, res) => {
app.get(['/'], (req, res) => {
logger.log(req.ip + " - " + res.locals.ip, true);
res.render("index");
});
Expand Down
22 changes: 4 additions & 18 deletions src/client/components/App.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,13 @@
import React from 'react';
import { BrowserRouter as Router, Route, Routes, Link } from 'react-router-dom';
import Contacts from './Contacts';
//import { BrowserRouter as Router, Route, Routes, Link } from 'react-router-dom';
import "./css/app.css";

import Provider from "./context"

const App = () => {
return (
<Provider>
<div className="app">
<Router>
<Routes>
<Route path="/contacts" element={<Contacts />} />
<Route path="/" element={
<>
<h1 className="headline">Hello, React! <br />
<Link to="/contacts">Go to Contacts</Link></h1>
</>
} />
</Routes>
</Router>
</div>
</Provider>
<div className="app">
<h1 className="headline">Hello, React!</h1>
</div>
);
}

Expand Down
56 changes: 0 additions & 56 deletions src/client/components/Contact.tsx

This file was deleted.

25 changes: 0 additions & 25 deletions src/client/components/Contacts.tsx

This file was deleted.

82 changes: 0 additions & 82 deletions src/client/components/context.tsx

This file was deleted.

36 changes: 0 additions & 36 deletions src/client/components/css/contact.module.css

This file was deleted.

7 changes: 0 additions & 7 deletions src/client/components/css/contacts.module.css

This file was deleted.

19 changes: 0 additions & 19 deletions src/client/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,7 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
declare module "*.module.css";
declare namespace client {
interface Contact {
id: string;
name: string;
email: string;
phone: string;
hobby?: string;
}

interface ContactProps {
contact: Contact;
}

interface Contacts {
contacts: Contact[];
dispatch?: (state: Contacts, action: string) => void;
}

interface ProviderProps {
children?: React.ReactNode;
}
}


0 comments on commit 49c6d81

Please sign in to comment.