Skip to content

Commit

Permalink
delete comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Miro-wq committed Sep 16, 2024
1 parent f15f5cf commit 53f435c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 39 deletions.
39 changes: 1 addition & 38 deletions src/components/App/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,8 @@ import { nanoid } from 'nanoid';
import ContactForm from '../ContactForm/ContactForm';
import ContactList from '../ContactList/ContactList';
import Filter from '../Filter/Filter';

import './App.module.css';

// class App extends Component {
// state = {
// contacts: [],
// filter: '',
// }

const App = () => {
const [contacts, setContacts] = useState(() => {
const savedContacts = localStorage.getItem('contacts');
Expand All @@ -24,19 +17,6 @@ useEffect(() => {
localStorage.setItem('contacts', JSON.stringify(contacts));
}, [contacts]);


// componentDidMount() {
// const contacts = localStorage.getItem('contacts');
// if (contacts) {
// this.setState({ contacts: JSON.parse(contacts) });
// }
// }
// componentDidUpdate(prevState) {
// if (this.state.contacts !== prevState.contacts) {
// localStorage.setItem('contacts', JSON.stringify(this.state.contacts));
// }
// }

const addContact = (name, number) => {
const isDuplicate = contacts.some(
contact => contact.name.toLowerCase() === name.toLowerCase()
Expand Down Expand Up @@ -82,21 +62,4 @@ useEffect(() => {
);
};

export default App;

// export const App = () => {
// return (
// <div
// style={{
// height: '100vh',
// display: 'flex',
// justifyContent: 'center',
// alignItems: 'center',
// fontSize: 40,
// color: '#010101'
// }}
// >
// React homework template
// </div>
// );
// };
export default App;
2 changes: 1 addition & 1 deletion src/index.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "normalize.css"; /* bring in normalize.css styles */
@import "normalize.css";

body {
margin: 0;
Expand Down

0 comments on commit 53f435c

Please sign in to comment.