Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanDaGue committed Sep 2, 2024
2 parents e25f4de + 4d7ecda commit 2e0281d
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/App/AppUI.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

import { CreateTodoButton } from '../CreateTodoButton';
import { CreateTodoButton2 } from '../CreateTodoButton2';
import { CreateTodoButton2 } from '../CreateTodoButton2';
import { TodoItem } from '../TodoItem';
import { TodoList } from '../TodoList';
import { TodoCont } from '../TodoCont';
Expand Down Expand Up @@ -62,6 +63,7 @@ function AppUI() {
{openModal && (
<Modal>
<TodoForm></TodoForm>
<TodoForm></TodoForm>
</Modal>
)}
{openModal2 && (
Expand Down
7 changes: 7 additions & 0 deletions src/CreateTodoButton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ function CreateTodoButton(props){
return(
<button
className="CreatedTodobutton Icon Icon-svg2"
<<<<<<< HEAD
onClick={handleClick}
=======
onClick={()=>
//console.log('You push the button'),
props.setOpenModal(state=>!state)
}
>>>>>>> 4d7ecdaa26183bf6106f58e85bb73118ceac79fe

> <IconPlus/> </button>
)
Expand Down
40 changes: 40 additions & 0 deletions src/CreateTodoButton2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import "./CreateTodoButton2.css"
import { IconComplete } from './IconComplete'
import React from "react";
function CreateTodoButton2(props){
<<<<<<< HEAD
const handleClick = () => {
props.setOpenModal2(state => !state);
if(props.setOpenModal2){
Expand All @@ -15,6 +16,20 @@ function CreateTodoButton2(props){
return(
<button
className="CreatedTodobutton2 Icon Icon-svg2"
=======
const [isActive, setIsActive] = React.useState(false);

const handleClick = () => {
if (window.confirm('Do you confirm?')) {
console.log('ok');
} else {
console.log('false');
}
};
return(
<button
className="CreatedTodobutton Icon Icon-svg2"
>>>>>>> 4d7ecdaa26183bf6106f58e85bb73118ceac79fe
onClick={handleClick}
>
<IconComplete/>
Expand All @@ -26,3 +41,28 @@ export { CreateTodoButton2 };


// import React from 'react';
<<<<<<< HEAD
=======

// const YourComponent = () => {
// const handleClick = () => {
// if (window.confirm('Do you confirm?')) {
// console.log('ok');
// } else {
// console.log('false');
// }
// };

// return (
// <button onClick={handleClick} className="CreatedTodobutton">
// <span className="Icon Icon-svg Icon-complete">
// <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
// <path d="M21.03 5.72a.75.75 0 0 1 0 1.06l-11.5 11.5a.747.747 0 0 1-1.072-.012l-5.5-5.75a.75.75 0 1 1 1.084-1.036l4.97 5.195L19.97 5.72a.75.75 0 0 1 1.06 0Z"></path>
// </svg>
// </span>
// </button>
// );
// };

// export default YourComponent;
>>>>>>> 4d7ecdaa26183bf6106f58e85bb73118ceac79fe
3 changes: 3 additions & 0 deletions src/TodoContext/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,11 @@ function TodoProvider({children}){
TodoDelet,
openModal,
setOpenModal,
<<<<<<< HEAD
openModal2,
setOpenModal2,
=======
>>>>>>> 4d7ecdaa26183bf6106f58e85bb73118ceac79fe
addTodo,
}}>
{children}
Expand Down

0 comments on commit 2e0281d

Please sign in to comment.