From 07919cd912f87ba2801efde1177a69cae75e86c3 Mon Sep 17 00:00:00 2001 From: Ivan <8611739+IRBorisov@users.noreply.github.com> Date: Thu, 12 Dec 2024 21:58:07 +0300 Subject: [PATCH] R: Remove .Provider from Contexts --- rsconcept/frontend/src/context/AccessModeContext.tsx | 2 +- rsconcept/frontend/src/context/AuthContext.tsx | 4 ++-- rsconcept/frontend/src/context/ConceptOptionsContext.tsx | 4 ++-- rsconcept/frontend/src/context/GlobalOssContext.tsx | 4 ++-- rsconcept/frontend/src/context/LibraryContext.tsx | 4 ++-- rsconcept/frontend/src/context/NavigationContext.tsx | 4 ++-- rsconcept/frontend/src/context/OssContext.tsx | 4 ++-- rsconcept/frontend/src/context/RSFormContext.tsx | 4 ++-- rsconcept/frontend/src/context/UserProfileContext.tsx | 4 ++-- rsconcept/frontend/src/context/UsersContext.tsx | 4 ++-- rsconcept/frontend/src/pages/OssPage/OssEditContext.tsx | 6 +++--- rsconcept/frontend/src/pages/RSFormPage/RSEditContext.tsx | 6 +++--- rsconcept/frontend/src/utils/labels.ts | 2 +- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/rsconcept/frontend/src/context/AccessModeContext.tsx b/rsconcept/frontend/src/context/AccessModeContext.tsx index 2819e121..c8fe0bcc 100644 --- a/rsconcept/frontend/src/context/AccessModeContext.tsx +++ b/rsconcept/frontend/src/context/AccessModeContext.tsx @@ -21,5 +21,5 @@ export const useAccessMode = () => { export const AccessModeState = ({ children }: React.PropsWithChildren) => { const [accessLevel, setAccessLevel] = useState(UserLevel.READER); - return {children}; + return {children}; }; diff --git a/rsconcept/frontend/src/context/AuthContext.tsx b/rsconcept/frontend/src/context/AuthContext.tsx index 0dfc5459..6af73bcf 100644 --- a/rsconcept/frontend/src/context/AuthContext.tsx +++ b/rsconcept/frontend/src/context/AuthContext.tsx @@ -186,7 +186,7 @@ export const AuthState = ({ children }: React.PropsWithChildren) => { }, [reload]); return ( - { }} > {children} - + ); }; diff --git a/rsconcept/frontend/src/context/ConceptOptionsContext.tsx b/rsconcept/frontend/src/context/ConceptOptionsContext.tsx index 5f807db7..d992e1d4 100644 --- a/rsconcept/frontend/src/context/ConceptOptionsContext.tsx +++ b/rsconcept/frontend/src/context/ConceptOptionsContext.tsx @@ -127,7 +127,7 @@ export const OptionsState = ({ children }: React.PropsWithChildren) => { }, [noNavigation]); return ( - { {children} - + ); }; diff --git a/rsconcept/frontend/src/context/GlobalOssContext.tsx b/rsconcept/frontend/src/context/GlobalOssContext.tsx index fa45c467..fd803c88 100644 --- a/rsconcept/frontend/src/context/GlobalOssContext.tsx +++ b/rsconcept/frontend/src/context/GlobalOssContext.tsx @@ -87,7 +87,7 @@ export const GlobalOssState = ({ children }: React.PropsWithChildren) => { ); return ( - { }} > {children} - + ); }; diff --git a/rsconcept/frontend/src/context/LibraryContext.tsx b/rsconcept/frontend/src/context/LibraryContext.tsx index c695717c..9a9295eb 100644 --- a/rsconcept/frontend/src/context/LibraryContext.tsx +++ b/rsconcept/frontend/src/context/LibraryContext.tsx @@ -291,7 +291,7 @@ export const LibraryState = ({ children }: React.PropsWithChildren) => { ); return ( - { }} > {children} - + ); }; diff --git a/rsconcept/frontend/src/context/NavigationContext.tsx b/rsconcept/frontend/src/context/NavigationContext.tsx index 0ad7dd35..3ab0e717 100644 --- a/rsconcept/frontend/src/context/NavigationContext.tsx +++ b/rsconcept/frontend/src/context/NavigationContext.tsx @@ -93,7 +93,7 @@ export const NavigationState = ({ children }: React.PropsWithChildren) => { }, [pathname, scrollTop]); return ( - { }} > {children} - + ); }; diff --git a/rsconcept/frontend/src/context/OssContext.tsx b/rsconcept/frontend/src/context/OssContext.tsx index f9690499..c13d5b6e 100644 --- a/rsconcept/frontend/src/context/OssContext.tsx +++ b/rsconcept/frontend/src/context/OssContext.tsx @@ -358,7 +358,7 @@ export const OssState = ({ itemID, children }: React.PropsWithChildren {children} - + ); }; diff --git a/rsconcept/frontend/src/context/RSFormContext.tsx b/rsconcept/frontend/src/context/RSFormContext.tsx index a372d228..11533474 100644 --- a/rsconcept/frontend/src/context/RSFormContext.tsx +++ b/rsconcept/frontend/src/context/RSFormContext.tsx @@ -549,7 +549,7 @@ export const RSFormState = ({ itemID, versionID, children }: React.PropsWithChil ); return ( - {children} - + ); }; diff --git a/rsconcept/frontend/src/context/UserProfileContext.tsx b/rsconcept/frontend/src/context/UserProfileContext.tsx index 65c224cd..d9c3841a 100644 --- a/rsconcept/frontend/src/context/UserProfileContext.tsx +++ b/rsconcept/frontend/src/context/UserProfileContext.tsx @@ -76,8 +76,8 @@ export const UserProfileState = ({ children }: React.PropsWithChildren) => { }, [reload]); return ( - + {children} - + ); }; diff --git a/rsconcept/frontend/src/context/UsersContext.tsx b/rsconcept/frontend/src/context/UsersContext.tsx index 0da6d656..41e1eee8 100644 --- a/rsconcept/frontend/src/context/UsersContext.tsx +++ b/rsconcept/frontend/src/context/UsersContext.tsx @@ -81,7 +81,7 @@ export const UsersState = ({ children }: React.PropsWithChildren) => { }, [reload]); return ( - { }} > {children} - + ); }; diff --git a/rsconcept/frontend/src/pages/OssPage/OssEditContext.tsx b/rsconcept/frontend/src/pages/OssPage/OssEditContext.tsx index 2ba047a9..5e3e4f79 100644 --- a/rsconcept/frontend/src/pages/OssPage/OssEditContext.tsx +++ b/rsconcept/frontend/src/pages/OssPage/OssEditContext.tsx @@ -82,7 +82,7 @@ const OssEditContext = createContext(null); export const useOssEdit = () => { const context = useContext(OssEditContext); if (context === null) { - throw new Error('useOssEdit has to be used within '); + throw new Error('useOssEdit has to be used within '); } return context; }; @@ -384,7 +384,7 @@ export const OssEditState = ({ selected, setSelected, children }: React.PropsWit ); return ( - + ); }; diff --git a/rsconcept/frontend/src/pages/RSFormPage/RSEditContext.tsx b/rsconcept/frontend/src/pages/RSFormPage/RSEditContext.tsx index db38cd49..44e6380a 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/RSEditContext.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/RSEditContext.tsx @@ -114,7 +114,7 @@ const RSEditContext = createContext(null); export const useRSEdit = () => { const context = useContext(RSEditContext); if (context === null) { - throw new Error('useRSEdit has to be used within '); + throw new Error('useRSEdit has to be used within '); } return context; }; @@ -628,7 +628,7 @@ export const RSEditState = ({ ); return ( - + ); }; diff --git a/rsconcept/frontend/src/utils/labels.ts b/rsconcept/frontend/src/utils/labels.ts index 2ccc9c89..063a29ac 100644 --- a/rsconcept/frontend/src/utils/labels.ts +++ b/rsconcept/frontend/src/utils/labels.ts @@ -1012,5 +1012,5 @@ export const prompts = { // ============== INTERNAL LABELS FOR DEVELOPERS TEXT ================ export function contextOutsideScope(contextName: string, contextState: string): string { - return `${contextName} has to be used within <${contextState}.Provider>`; + return `${contextName} has to be used within <${contextState}>`; }