-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Karthik Ayangar <[email protected]>
- Loading branch information
Showing
33 changed files
with
563 additions
and
552 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export const AVATAR_URL="https://api.multiavatar.com" | ||
export const AVATAR_URL = 'https://api.multiavatar.com'; |
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,13 +1,13 @@ | ||
import { UserOrgDetails, UserOrgs } from "app/api/user"; | ||
import { createContext } from "react"; | ||
import { UserOrgDetails, UserOrgs } from 'app/api/user'; | ||
import { createContext } from 'react'; | ||
|
||
export interface UserContextType{ | ||
username: String | null; | ||
setUsername: (name: String)=>void; | ||
userOrgs: UserOrgs | null; | ||
setUserOrgs: (user_Orgs: UserOrgs)=> void | ||
export interface UserContextType { | ||
username: String | null; | ||
setUsername: (name: String) => void; | ||
userOrgs: UserOrgs | null; | ||
setUserOrgs: (user_Orgs: UserOrgs) => void; | ||
} | ||
|
||
const UserContext= createContext<UserContextType | undefined>(undefined); | ||
const UserContext = createContext<UserContextType | undefined>(undefined); | ||
|
||
export default UserContext; | ||
export default UserContext; |
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,23 +1,22 @@ | ||
import { FC, ReactNode, useState } from "react"; | ||
import UserContext from "./userContext"; | ||
import { UserOrgDetails, UserOrgs } from "app/api/user"; | ||
import { FC, ReactNode, useState } from 'react'; | ||
import UserContext from './userContext'; | ||
import { UserOrgDetails, UserOrgs } from 'app/api/user'; | ||
|
||
interface Props{ | ||
children: ReactNode | ||
interface Props { | ||
children: ReactNode; | ||
} | ||
|
||
const UserState: FC<Props>= ({children})=>{ | ||
const UserState: FC<Props> = ({ children }) => { | ||
const [username, setUsername] = useState<String | null>(null); | ||
const [userOrgs, setUserOrgs] = useState<UserOrgs | null>(null); | ||
|
||
const [username, setUsername] = useState<String | null>(null); | ||
const [userOrgs, setUserOrgs] = useState<UserOrgs|null>(null) | ||
return ( | ||
<UserContext.Provider | ||
value={{ username, setUsername, userOrgs, setUserOrgs }} | ||
> | ||
{children} | ||
</UserContext.Provider> | ||
); | ||
}; | ||
|
||
return ( | ||
<UserContext.Provider value={{username, setUsername, userOrgs, setUserOrgs}} > | ||
|
||
{children} | ||
|
||
</UserContext.Provider> | ||
) | ||
} | ||
|
||
export default UserState | ||
export default UserState; |
Oops, something went wrong.