-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from chaaals/feat/add-reset-button
feat: implemented a reset feature when a user has selected a province
- Loading branch information
Showing
5 changed files
with
116 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { createContext, useState } from "react"; | ||
import { PROVINCES_LENGTH } from "../utils/constants"; | ||
|
||
const AppContext = createContext(); | ||
|
||
export const AppProvider = ({ children }) => { | ||
const [provinceLevels, setProvinceLevels] = useState( | ||
new Array(PROVINCES_LENGTH).fill(0) | ||
); | ||
|
||
return ( | ||
<AppContext.Provider | ||
value={{ | ||
provinceLevels, | ||
setProvinceLevels, | ||
}} | ||
> | ||
{children} | ||
</AppContext.Provider> | ||
); | ||
}; | ||
|
||
export default AppContext; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59536ff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
my-philippines-travel-map – ./
my-philippines-travel-map-git-main-ossph.vercel.app
my-philippines-travel-map.vercel.app
my-philippines-travel-map-ossph.vercel.app
my-philippines-travel-level.ossph.org
www.my-philippines-travel-level.com
my-philippines-travel-level.com