{filterList}
diff --git a/src/assets/proficon.svg b/src/assets/proficon.svg
new file mode 100644
index 0000000..611b759
--- /dev/null
+++ b/src/assets/proficon.svg
@@ -0,0 +1,25 @@
+
+
+
\ No newline at end of file
diff --git a/src/components/Bank.js b/src/components/Bank.js
new file mode 100644
index 0000000..b726a80
--- /dev/null
+++ b/src/components/Bank.js
@@ -0,0 +1,16 @@
+import React from "react";
+import { useSelector, useDispatch } from 'react-redux';
+import {actionCreators } from '../state/index';
+
+function Bank(props) {
+ const dispatch = useDispatch();
+ const data = useSelector(state => state.amount);
+ console.log(data)
+
+ return (
+ <>
+>
+ );
+}
+
+export default Bank;
diff --git a/src/components/FilterButton.js b/src/components/FilterButton.js
index 6ff6626..4fa689b 100644
--- a/src/components/FilterButton.js
+++ b/src/components/FilterButton.js
@@ -1,5 +1,9 @@
import React from "react";
+//import { CapButton } from "@capillarytech/cap-ui-library";
import "../App.css"
+import {useSelector} from 'react-redux';
+
+
function FilterButton(props) {
return (
diff --git a/src/components/Form.js b/src/components/Form.js
index 6c95858..bf55527 100644
--- a/src/components/Form.js
+++ b/src/components/Form.js
@@ -3,11 +3,15 @@ import "../App.css"
class Form extends Component {
constructor(props) {
+
super(props);
+
+ console.log(this.props);
this.state = {
name: "",
date: "",
- description: ""
+ description: "",
+
};
}
diff --git a/src/components/Profile.js b/src/components/Profile.js
new file mode 100644
index 0000000..c28917d
--- /dev/null
+++ b/src/components/Profile.js
@@ -0,0 +1,49 @@
+import React, { useState } from "react";
+import { useSelector, useDispatch } from 'react-redux';
+import { actionCreators } from '../state/index';
+import { connect } from 'react-redux';
+import "../App.css"
+//import {profileAdd} from '../state/action-creators/index'
+
+
+
+const Profile = ({ props, profileAdd }) => {
+ const [name, setName] = useState("");
+ function handleChange(e) {
+ setName(e.target.value);
+ }
+ function handleSubmit(e) {
+ e.preventDefault();
+ profileAdd([], name);
+ //props.addProfile(name);
+ setName("");
+ }
+ return (
+
+ );
+}
+
+
+const mapStateToProps = (state) => ({})
+
+const mapDispatchToProps = (dispatch) => ({ profileAdd: (todo, name) => (dispatch(actionCreators.profileAdd(todo, name))) })
+
+export default connect(mapStateToProps, mapDispatchToProps)(Profile);
diff --git a/src/components/dropdown.js b/src/components/dropdown.js
new file mode 100644
index 0000000..9b68217
--- /dev/null
+++ b/src/components/dropdown.js
@@ -0,0 +1,89 @@
+import React, { useState } from 'react';
+import { useSelector, useDispatch } from 'react-redux';
+import imgsrc from '../assets/proficon.svg';
+const ProfileDropdown = (props) => {
+ const [expanded, setExpanded] = useState(false);
+ const selectedProfile = useSelector(state => state.selectedProfile);
+ const profiles = useSelector(state => state.profiles);
+ const dispatch = useDispatch();
+
+ const handleClick = profile => {
+ //dispatch(selectProfile(profile));
+ setExpanded(false);
+ props.setProf(props.name);
+ };
+
+ return (
+
setExpanded(true)}
+ onMouseLeave={() => setExpanded(false)}
+ >
+
+ {expanded && (
+
+ {profiles.map(profile => (
+ -
+
+
+ ))}
+
+ )}
+
+ );
+};
+
+
+
+
+
+function Dropdown(props) {
+
+ const data = useSelector(state => state.profile);
+ console.log(`data ${data}`)
+
+ const [expanded, setExpanded] = useState(false);
+ const [selectedProfile, setSelectedProfile] = useState(data[0]);
+
+ const handleProfileSelect = (profile) => {
+ setSelectedProfile(profile);
+ setExpanded(false);
+ props.setProf(profile);
+ };
+
+ return (
+
+
+ {expanded && (
+
+ {data.map((profile) => (
+ -
+
+
+ ))}
+
+
+ )}
+
+
)
+}
+
+export default Dropdown;
\ No newline at end of file
diff --git a/src/components/profReducer.js b/src/components/profReducer.js
new file mode 100644
index 0000000..44bddfe
--- /dev/null
+++ b/src/components/profReducer.js
@@ -0,0 +1,16 @@
+import React from "react";
+import { useSelector, useDispatch } from 'react-redux';
+import {actionCreators } from '../state/index';
+
+function ProfReducer(props) {
+ const dispatch = useDispatch();
+ const data = useSelector(state => state.profile);
+ console.log(data)
+
+ return (
+ <>
+>
+ );
+}
+
+export default ProfReducer;
diff --git a/src/components/profileButton.js b/src/components/profileButton.js
new file mode 100644
index 0000000..da2943b
--- /dev/null
+++ b/src/components/profileButton.js
@@ -0,0 +1,23 @@
+import React from "react";
+//import { CapButton } from "@capillarytech/cap-ui-library";
+import "../App.css"
+import {useSelector} from 'react-redux';
+
+
+function ProfileButton(props) {
+ console.log(props);
+ return (
+
+
+ );
+ }
+export default ProfileButton;
diff --git a/src/components/searchBox.js b/src/components/searchBox.js
index 270a22f..f84204c 100644
--- a/src/components/searchBox.js
+++ b/src/components/searchBox.js
@@ -1,6 +1,8 @@
import React, { useState } from "react";
+import { useSelector, useDispatch } from 'react-redux';
function SearchBox(props) {
+ const data = useSelector(state => state.amount);
const [searchQuery, setSearchQuery] = useState("");
function handleSearch(event) {
@@ -14,6 +16,7 @@ function SearchBox(props) {
return (
diff --git a/src/index.js b/src/index.js
index 0eea987..bbfd8c5 100644
--- a/src/index.js
+++ b/src/index.js
@@ -2,13 +2,19 @@ import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
+import {store} from './state/store';
+import { Provider } from 'react-redux';
+
import reportWebVitals from './reportWebVitals';
const DATA = [];
+const profile=['Default'];
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
-
-
+
+
+
+
);
diff --git a/src/state/action-creators/index.js b/src/state/action-creators/index.js
new file mode 100644
index 0000000..5f6e4fb
--- /dev/null
+++ b/src/state/action-creators/index.js
@@ -0,0 +1,17 @@
+export const depositMoney=(amount)=>{
+ console.log(amount);
+ return(dispatch)=>{
+ dispatch({
+ type:'desposit',
+ payload:amount})
+ }
+}
+
+export const profileAdd=(list,name)=>{
+ console.log(`ActionCreator- ${name}`);
+ return(dispatch)=>{
+ dispatch({
+ type:'add',
+ payload:{name:name,list:list}})
+ }
+}
\ No newline at end of file
diff --git a/src/state/index.js b/src/state/index.js
new file mode 100644
index 0000000..f35a3d6
--- /dev/null
+++ b/src/state/index.js
@@ -0,0 +1 @@
+export * as actionCreators from './action-creators/index';
diff --git a/src/state/reducer/amountReducer.js b/src/state/reducer/amountReducer.js
new file mode 100644
index 0000000..d0339b1
--- /dev/null
+++ b/src/state/reducer/amountReducer.js
@@ -0,0 +1,13 @@
+/* eslint-disable no-undef */
+const reducer = (state=0,action)=>{
+ console.log(action);
+ if (action.type==='desposit'){
+ return state+action.payload;
+ }
+ else{
+ console.log(state);
+ return state;
+ }
+}
+
+export default reducer;
\ No newline at end of file
diff --git a/src/state/reducer/index.js b/src/state/reducer/index.js
new file mode 100644
index 0000000..8bb0e04
--- /dev/null
+++ b/src/state/reducer/index.js
@@ -0,0 +1,11 @@
+/* eslint-disable no-undef */
+import {combineReducers} from 'redux';
+import amountReducer from './amountReducer';
+import ProfileAdder from './profileChange';
+
+const reducers= combineReducers({
+ amount: amountReducer,
+ profile: ProfileAdder
+})
+
+export default reducers;
\ No newline at end of file
diff --git a/src/state/reducer/profileChange.js b/src/state/reducer/profileChange.js
new file mode 100644
index 0000000..33517d6
--- /dev/null
+++ b/src/state/reducer/profileChange.js
@@ -0,0 +1,14 @@
+const initialState=[]; //profile list
+/* eslint-disable no-undef */
+export const reducer = (state=initialState,action)=>{
+ console.log(`reducer : ${action}`);
+ if (action.type==='add'){
+ return [...state, action.payload.name];
+ }
+ else{
+ console.log(state);
+ return state;
+ }
+}
+
+export default reducer;
\ No newline at end of file
diff --git a/src/state/reducer/todoReducer.js b/src/state/reducer/todoReducer.js
new file mode 100644
index 0000000..6c11fd4
--- /dev/null
+++ b/src/state/reducer/todoReducer.js
@@ -0,0 +1,32 @@
+const initialState=[];//tasks list
+/* eslint-disable no-undef */
+export const reducer = (state=initialState,action)=>{
+ console.log(action);
+
+ switch (action.type){
+ case 'todoAdd':
+ const newTask = { id: nanoid(), name:action.payload.name, deadline: action.payload.deadline, description: action.payload.description, pid: prof,completed: false };
+ console.log(newTask)
+ return [...state,action.payload.name];
+ case 'todoDelete':
+ const remainingTasks = state.filter((task) => action.payload !== task.id);
+ return remainingTasks;
+ case 'todoEdit':
+ const updatedState=state.map((task) => {
+ if (action.payload.id === task.id) {
+ //
+ return { ...task, name: action.payload.newName, deadline: action.payload.newDeadline }
+ }
+ else{
+ return task;
+ }
+ })
+ return updatedState;
+ default:
+ return state;
+ }
+}
+
+
+
+export default reducer;
\ No newline at end of file
diff --git a/src/state/store.js b/src/state/store.js
new file mode 100644
index 0000000..46d02e1
--- /dev/null
+++ b/src/state/store.js
@@ -0,0 +1,8 @@
+import {applyMiddleware,createStore,compose} from 'redux';
+import {configureStore} from '@reduxjs/toolkit';
+import thunk from 'redux-thunk';
+
+import reducers from './reducer';
+const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
+// eslint-disable-next-line no-undef
+export const store= createStore(reducers,{},composeEnhancers(applyMiddleware(thunk)))