-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added global context and started example with Banner (#387)
* added global context and started example with Banner * ran npm i * fixing pr checks --------- Co-authored-by: Dennis Wang <[email protected]> Co-authored-by: denniswangcodes <[email protected]>
- Loading branch information
1 parent
a4d9ba1
commit 541eef0
Showing
4 changed files
with
517 additions
and
444 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,35 @@ | ||
import React, { createContext, FC, ReactNode, useContext } from 'react'; | ||
|
||
const marketingText = { | ||
banner: { | ||
mainHigh: 'Support Local', | ||
mainLow: 'Nonprofits', | ||
mainSubtext: | ||
'Be part of our community of volunteers, nonprofits, and individuals through the Givingful exchange platform.', | ||
CTAButton: 'Join Now', | ||
}, | ||
|
||
signup: { | ||
buttonLabel: 'Example1', | ||
formFieldLabel: 'Example2', | ||
}, | ||
} as const; | ||
|
||
const MarketingTextContext = createContext<typeof marketingText>(marketingText); | ||
|
||
interface MarketingTextProviderProps { | ||
children: ReactNode; | ||
} | ||
|
||
export const MarketingTextProvider: FC<MarketingTextProviderProps> = ({ children }) => { | ||
return ( | ||
<MarketingTextContext.Provider value={marketingText}>{children}</MarketingTextContext.Provider> | ||
); | ||
}; | ||
|
||
// Custom hook for consuming the context | ||
export const useMarketingText = () => { | ||
return useContext(MarketingTextContext); | ||
}; | ||
|
||
export default MarketingTextProvider; |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
export * from './UserProvider'; | ||
export * from './MarketingTextProvider'; | ||
export * from './SettingsProvider'; | ||
export * from './ModalProvider'; |
Oops, something went wrong.