Skip to content

Commit 4e5bac1

Browse files
authored
Merge pull request #15 from apsinghdev/Feat/options-component
setup context for state management
2 parents ee5d457 + ea79f9c commit 4e5bac1

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

client/src/appContext.jsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* eslint-disable react/prop-types */
2+
// AppContext.js
3+
import { createContext, useState } from "react";
4+
5+
const AppContext = createContext();
6+
7+
const AppProvider = ({ children }) => {
8+
const [parentState, setParentState] = useState("Parent State");
9+
10+
return (
11+
<AppContext.Provider value={{ parentState, setParentState }}>
12+
{children}
13+
</AppContext.Provider>
14+
);
15+
};
16+
17+
export { AppContext, AppProvider };

client/src/components/Menu.jsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import MenuItem from "./MenuItem";
2+
import Socials from "./Socials";
3+
4+
function Menu(){
5+
return (
6+
<div className="w-20 h-auto bg-white z-100">
7+
<MenuItem feat="Start Collaboration"></MenuItem>
8+
<MenuItem feat="Start Chat"></MenuItem>
9+
<MenuItem feat="Save as pdf"></MenuItem>
10+
<MenuItem feat="Save as png"></MenuItem>
11+
<Socials></Socials>
12+
</div>
13+
);
14+
}
15+
16+
export default Menu;

client/src/components/MenuItem.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* eslint-disable react/prop-types */
2+
function MenuItem(props){
3+
return(
4+
<div>
5+
<h1>{props.feat}</h1>
6+
</div>
7+
)
8+
}
9+
10+
export default MenuItem;

0 commit comments

Comments
 (0)