From 13b5fcb8a20e882bfa619fe9927173d23101650c Mon Sep 17 00:00:00 2001 From: Amit Raikwar | OMF <149316922+onemanfighter@users.noreply.github.com> Date: Tue, 7 May 2024 23:34:29 +0530 Subject: [PATCH] [Refactor]: Rename zustand_store into store. (#32) --- craco.config.js | 12 +++--------- src/components/navigation/Navigation.tsx | 2 +- .../notification/NotificationComponent.tsx | 2 +- .../alert_toast_provider/AlertToastProvider.tsx | 2 +- .../already_login/AlreadyLoginServiceProvider.tsx | 2 +- .../ImagePreviewModalProvider.tsx | 2 +- src/provider/router_provider/RouterProvider.tsx | 2 +- src/provider/theme_provider/ThemeProvider.tsx | 2 +- .../private/MainRootScreen/MainRootScreen.tsx | 2 +- .../private/screens/dashboard_home/DashboardHome.tsx | 2 +- .../profile/profile_preview/ProfilePreviewScreen.tsx | 2 +- .../profile/profile_setting/ProfileSettingScreen.tsx | 2 +- .../private/screens/projects/ProjectScreen.tsx | 2 +- .../projects/project_add/ProjectAddScreen.tsx | 2 +- .../projects/project_delete/ProjectDeleteScreen.tsx | 2 +- .../projects/project_edit/ProjectEditScreen.tsx | 2 +- .../projects/project_main/ProjectMainScreen.tsx | 2 +- .../project_preview/ProjectPreviewComponent.tsx | 2 +- .../project_preview/ProjectPreviewScreen.tsx | 2 +- src/screens/public/login_screen/LoginScreen.tsx | 2 +- src/screens/public/signup_screen/SignupScreen.tsx | 2 +- src/service/local_storage/auth/AuthStorageApi.ts | 2 +- src/service/local_storage/theme/ThemeStorageApi.ts | 2 +- src/service/supabase/supa_auth/AuthApi.ts | 2 +- src/service/supabase/supa_auth/actions/AuthSignIn.ts | 2 +- .../supastore/user_profile/UserProfileStoreApi.ts | 2 +- .../supastore/user_profile/actions/UserDataRead.ts | 2 +- src/{zustand_store => store}/index.ts | 0 .../selectors/Alert/Alert.selector.ts | 4 ++-- .../selectors/Alert/index.ts | 0 .../selectors/Auth/Auth.selector.ts | 2 +- src/{zustand_store => store}/selectors/Auth/index.ts | 0 .../selectors/ImageModal/ImageModal.selector.ts | 2 +- .../selectors/ImageModal/index.ts | 0 .../selectors/Notification/Notification.selector.ts | 2 +- .../selectors/Notification/index.ts | 0 .../selectors/Profile/Profile.selector.ts | 2 +- .../selectors/Profile/index.ts | 0 .../selectors/Projects/Projects.selector.ts | 2 +- .../selectors/Projects/index.ts | 0 .../selectors/Theme/Theme.selector.ts | 2 +- .../selectors/Theme/index.ts | 0 src/{zustand_store => store}/selectors/index.ts | 0 .../slice/Alert/Alert.slice.ts | 2 +- src/{zustand_store => store}/slice/Alert/index.ts | 0 src/{zustand_store => store}/slice/Alert/types.ts | 0 .../slice/Auth/Auth.slice.ts | 2 +- src/{zustand_store => store}/slice/Auth/index.ts | 0 src/{zustand_store => store}/slice/Auth/types.ts | 0 .../slice/ImageModal/ImageModal.slice.ts | 2 +- .../slice/ImageModal/index.ts | 0 .../slice/ImageModal/types.ts | 0 .../slice/Notification/Notification.slice.ts | 2 +- .../slice/Notification/index.ts | 0 .../slice/Notification/types.ts | 0 .../slice/Profile/Profile.slice.ts | 2 +- src/{zustand_store => store}/slice/Profile/index.ts | 0 src/{zustand_store => store}/slice/Profile/types.ts | 0 .../slice/Projects/Projects.slice.ts | 2 +- src/{zustand_store => store}/slice/Projects/index.ts | 0 src/{zustand_store => store}/slice/Projects/types.ts | 0 .../slice/Theme/Theme.slice.ts | 2 +- src/{zustand_store => store}/slice/Theme/index.ts | 0 src/{zustand_store => store}/slice/Theme/types.ts | 0 src/{zustand_store => store}/slice/index.ts | 0 src/{zustand_store => store}/store/appStore.tsx | 2 +- src/{zustand_store => store}/store/index.ts | 0 src/{zustand_store => store}/store/types.ts | 2 +- tsconfig.path.json | 6 +++--- 69 files changed, 49 insertions(+), 55 deletions(-) rename src/{zustand_store => store}/index.ts (100%) rename src/{zustand_store => store}/selectors/Alert/Alert.selector.ts (77%) rename src/{zustand_store => store}/selectors/Alert/index.ts (100%) rename src/{zustand_store => store}/selectors/Auth/Auth.selector.ts (91%) rename src/{zustand_store => store}/selectors/Auth/index.ts (100%) rename src/{zustand_store => store}/selectors/ImageModal/ImageModal.selector.ts (77%) rename src/{zustand_store => store}/selectors/ImageModal/index.ts (100%) rename src/{zustand_store => store}/selectors/Notification/Notification.selector.ts (80%) rename src/{zustand_store => store}/selectors/Notification/index.ts (100%) rename src/{zustand_store => store}/selectors/Profile/Profile.selector.ts (77%) rename src/{zustand_store => store}/selectors/Profile/index.ts (100%) rename src/{zustand_store => store}/selectors/Projects/Projects.selector.ts (86%) rename src/{zustand_store => store}/selectors/Projects/index.ts (100%) rename src/{zustand_store => store}/selectors/Theme/Theme.selector.ts (74%) rename src/{zustand_store => store}/selectors/Theme/index.ts (100%) rename src/{zustand_store => store}/selectors/index.ts (100%) rename src/{zustand_store => store}/slice/Alert/Alert.slice.ts (94%) rename src/{zustand_store => store}/slice/Alert/index.ts (100%) rename src/{zustand_store => store}/slice/Alert/types.ts (100%) rename src/{zustand_store => store}/slice/Auth/Auth.slice.ts (95%) rename src/{zustand_store => store}/slice/Auth/index.ts (100%) rename src/{zustand_store => store}/slice/Auth/types.ts (100%) rename src/{zustand_store => store}/slice/ImageModal/ImageModal.slice.ts (89%) rename src/{zustand_store => store}/slice/ImageModal/index.ts (100%) rename src/{zustand_store => store}/slice/ImageModal/types.ts (100%) rename src/{zustand_store => store}/slice/Notification/Notification.slice.ts (91%) rename src/{zustand_store => store}/slice/Notification/index.ts (100%) rename src/{zustand_store => store}/slice/Notification/types.ts (100%) rename src/{zustand_store => store}/slice/Profile/Profile.slice.ts (98%) rename src/{zustand_store => store}/slice/Profile/index.ts (100%) rename src/{zustand_store => store}/slice/Profile/types.ts (100%) rename src/{zustand_store => store}/slice/Projects/Projects.slice.ts (95%) rename src/{zustand_store => store}/slice/Projects/index.ts (100%) rename src/{zustand_store => store}/slice/Projects/types.ts (100%) rename src/{zustand_store => store}/slice/Theme/Theme.slice.ts (89%) rename src/{zustand_store => store}/slice/Theme/index.ts (100%) rename src/{zustand_store => store}/slice/Theme/types.ts (100%) rename src/{zustand_store => store}/slice/index.ts (100%) rename src/{zustand_store => store}/store/appStore.tsx (95%) rename src/{zustand_store => store}/store/index.ts (100%) rename src/{zustand_store => store}/store/types.ts (95%) diff --git a/craco.config.js b/craco.config.js index fde5b68..b5b55f9 100644 --- a/craco.config.js +++ b/craco.config.js @@ -13,15 +13,9 @@ module.exports = { '@screens/*': path.resolve(__dirname, './src/screens/*'), '@service': path.resolve(__dirname, './src/service'), '@service/*': path.resolve(__dirname, './src/service/*'), - '@zustand_store': path.resolve(__dirname, './src/zustand_store'), - '@zustand_store/slice': path.resolve( - __dirname, - './src/zustand_store/slice' - ), - '@selectors': path.resolve( - __dirname, - './src/zustand_store/selectors' - ), + '@store': path.resolve(__dirname, './src/store'), + '@store/slice': path.resolve(__dirname, './src/store/slice'), + '@selectors': path.resolve(__dirname, './src/store/selectors'), }, }, }; diff --git a/src/components/navigation/Navigation.tsx b/src/components/navigation/Navigation.tsx index 8bf01d7..2099df4 100644 --- a/src/components/navigation/Navigation.tsx +++ b/src/components/navigation/Navigation.tsx @@ -12,7 +12,7 @@ import { import { NavigationComponentProps } from './types'; import { profileSelector, themeSelector, useShallow } from '@selectors'; -import { Theme, appStore } from '@zustand_store'; +import { Theme, appStore } from '@store'; /** * Navigation component. diff --git a/src/components/notification/NotificationComponent.tsx b/src/components/notification/NotificationComponent.tsx index 6cefb77..da9e9e5 100644 --- a/src/components/notification/NotificationComponent.tsx +++ b/src/components/notification/NotificationComponent.tsx @@ -1,6 +1,6 @@ import { NOTIFICATION_MODAL_ID } from './constants'; import { useTranslation } from 'react-i18next'; -import { appStore } from '@zustand_store'; +import { appStore } from '@store'; import { notificationSelector, useShallow } from '@selectors'; /** diff --git a/src/provider/alert_toast_provider/AlertToastProvider.tsx b/src/provider/alert_toast_provider/AlertToastProvider.tsx index 7d6a766..6a7ad0d 100644 --- a/src/provider/alert_toast_provider/AlertToastProvider.tsx +++ b/src/provider/alert_toast_provider/AlertToastProvider.tsx @@ -1,6 +1,6 @@ import { ToastAlertComponent } from '@dash-ui'; import { ToastAlertProviderProps } from './types'; -import { appStore } from '@zustand_store'; +import { appStore } from '@store'; import { alertSelector, useShallow } from '@selectors'; /** diff --git a/src/provider/already_login/AlreadyLoginServiceProvider.tsx b/src/provider/already_login/AlreadyLoginServiceProvider.tsx index 2e8b380..f176d64 100644 --- a/src/provider/already_login/AlreadyLoginServiceProvider.tsx +++ b/src/provider/already_login/AlreadyLoginServiceProvider.tsx @@ -1,7 +1,7 @@ import { useEffect } from 'react'; import { alreadySignedIn } from '@service/supabase/supa_auth/AuthApi'; import { AlreadyLoginServiceProviderProps } from './types'; -import { appStore } from '@zustand_store'; +import { appStore } from '@store'; import { authSelector, useShallow } from '@selectors'; const AlreadyLoginServiceProvider = ( diff --git a/src/provider/image_preview_modal_provider/ImagePreviewModalProvider.tsx b/src/provider/image_preview_modal_provider/ImagePreviewModalProvider.tsx index 090d1f3..ba35d97 100644 --- a/src/provider/image_preview_modal_provider/ImagePreviewModalProvider.tsx +++ b/src/provider/image_preview_modal_provider/ImagePreviewModalProvider.tsx @@ -1,6 +1,6 @@ import { ImagePreviewModal } from '@dash-ui'; import { ImagePreviewModalProviderProps } from './types'; -import { appStore } from '@zustand_store'; +import { appStore } from '@store'; import { imageModalSelector, useShallow } from '@selectors'; const ImagePreviewModalProvider = (props: ImagePreviewModalProviderProps) => { diff --git a/src/provider/router_provider/RouterProvider.tsx b/src/provider/router_provider/RouterProvider.tsx index 95edb41..fbd9a27 100644 --- a/src/provider/router_provider/RouterProvider.tsx +++ b/src/provider/router_provider/RouterProvider.tsx @@ -1,6 +1,6 @@ import { RouterProvider } from 'react-router-dom'; import { privateRouter, publicRouter } from '@router'; -import { appStore } from '@zustand_store'; +import { appStore } from '@store'; import { authSelector, useShallow } from '@selectors'; /** diff --git a/src/provider/theme_provider/ThemeProvider.tsx b/src/provider/theme_provider/ThemeProvider.tsx index 42d74bc..c83e85a 100644 --- a/src/provider/theme_provider/ThemeProvider.tsx +++ b/src/provider/theme_provider/ThemeProvider.tsx @@ -1,4 +1,4 @@ -import { appStore } from '@zustand_store'; +import { appStore } from '@store'; import { themeSelector, useShallow } from '@selectors'; import { ThemeProviderProps } from './types'; diff --git a/src/screens/private/MainRootScreen/MainRootScreen.tsx b/src/screens/private/MainRootScreen/MainRootScreen.tsx index cdc085f..f060069 100644 --- a/src/screens/private/MainRootScreen/MainRootScreen.tsx +++ b/src/screens/private/MainRootScreen/MainRootScreen.tsx @@ -2,7 +2,7 @@ import { Outlet } from 'react-router-dom'; import { signOut } from '@service/supabase/supa_auth/AuthApi'; import { useEffect, useState } from 'react'; import { NavigationComponent, SidebarComponent } from '@dash-ui'; -import { appStore, syncForTheFirstTime } from '@zustand_store'; +import { appStore, syncForTheFirstTime } from '@store'; import { authSelector, profileSelector, useShallow } from '@selectors'; const MainRootScreen = () => { diff --git a/src/screens/private/screens/dashboard_home/DashboardHome.tsx b/src/screens/private/screens/dashboard_home/DashboardHome.tsx index a9952e8..b31e091 100644 --- a/src/screens/private/screens/dashboard_home/DashboardHome.tsx +++ b/src/screens/private/screens/dashboard_home/DashboardHome.tsx @@ -1,6 +1,6 @@ import { NotificationButton, NotificationButtonType } from '@dash-ui'; import { getErrorAlertData } from '@provider'; -import { NotificationData, appStore } from '@zustand_store'; +import { NotificationData, appStore } from '@store'; import { alertSelector, notificationSelector, useShallow } from '@selectors'; /** diff --git a/src/screens/private/screens/profile/profile_preview/ProfilePreviewScreen.tsx b/src/screens/private/screens/profile/profile_preview/ProfilePreviewScreen.tsx index fca9054..8811439 100644 --- a/src/screens/private/screens/profile/profile_preview/ProfilePreviewScreen.tsx +++ b/src/screens/private/screens/profile/profile_preview/ProfilePreviewScreen.tsx @@ -15,7 +15,7 @@ import { } from '@assets'; import { TitleCard, TooltipComponent } from '@dash-ui'; import { profileSelector, useShallow } from '@selectors'; -import { appStore } from '@zustand_store'; +import { appStore } from '@store'; /** * The text style for the profile preview screen. diff --git a/src/screens/private/screens/profile/profile_setting/ProfileSettingScreen.tsx b/src/screens/private/screens/profile/profile_setting/ProfileSettingScreen.tsx index 91c0c59..983554a 100644 --- a/src/screens/private/screens/profile/profile_setting/ProfileSettingScreen.tsx +++ b/src/screens/private/screens/profile/profile_setting/ProfileSettingScreen.tsx @@ -22,7 +22,7 @@ import { WebsiteIcon, } from '@assets'; import { InputText, InputType } from '@dash-ui'; -import { appStore } from '@zustand_store'; +import { appStore } from '@store'; import { alertSelector, authSelector, diff --git a/src/screens/private/screens/projects/ProjectScreen.tsx b/src/screens/private/screens/projects/ProjectScreen.tsx index 34b3ea0..4d7538c 100644 --- a/src/screens/private/screens/projects/ProjectScreen.tsx +++ b/src/screens/private/screens/projects/ProjectScreen.tsx @@ -4,7 +4,7 @@ import { NavLink, Outlet, useLocation } from 'react-router-dom'; import { TooltipComponent } from '@dash-ui'; import { getAllProjects } from '@service/supabase/supastore/projects/ProjectsStoreApi'; import { AddIcon, DeleteIcon, EditIcon, PreviewIcon } from '@assets'; -import { appStore } from '@zustand_store'; +import { appStore } from '@store'; import { authSelector, projectsSelector, useShallow } from '@selectors'; import getSubNavTitle from '../../../../util/nav/NavTitle'; diff --git a/src/screens/private/screens/projects/project_add/ProjectAddScreen.tsx b/src/screens/private/screens/projects/project_add/ProjectAddScreen.tsx index 2060da7..bde845b 100644 --- a/src/screens/private/screens/projects/project_add/ProjectAddScreen.tsx +++ b/src/screens/private/screens/projects/project_add/ProjectAddScreen.tsx @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react'; import { useParams } from 'react-router-dom'; import { ProjectCard, getProjectCardData } from '@dash-ui'; -import { appStore } from '@zustand_store'; +import { appStore } from '@store'; import { projectsSelector, useShallow } from '@selectors'; /** diff --git a/src/screens/private/screens/projects/project_delete/ProjectDeleteScreen.tsx b/src/screens/private/screens/projects/project_delete/ProjectDeleteScreen.tsx index 059c54e..09bfe1b 100644 --- a/src/screens/private/screens/projects/project_delete/ProjectDeleteScreen.tsx +++ b/src/screens/private/screens/projects/project_delete/ProjectDeleteScreen.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react'; import { useParams } from 'react-router-dom'; import { ProjectCard, getProjectCardData } from '@dash-ui'; -import { appStore } from '@zustand_store'; +import { appStore } from '@store'; import { projectsSelector, useShallow } from '@selectors'; type IProjectDeleteScreenProps = {}; diff --git a/src/screens/private/screens/projects/project_edit/ProjectEditScreen.tsx b/src/screens/private/screens/projects/project_edit/ProjectEditScreen.tsx index e39ae0a..998382b 100644 --- a/src/screens/private/screens/projects/project_edit/ProjectEditScreen.tsx +++ b/src/screens/private/screens/projects/project_edit/ProjectEditScreen.tsx @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react'; import { useParams } from 'react-router-dom'; import { ProjectCard, getProjectCardData } from '@dash-ui'; import { projectsSelector, useShallow } from '@selectors'; -import { appStore } from '@zustand_store'; +import { appStore } from '@store'; type IProjectEditScreenProps = {}; diff --git a/src/screens/private/screens/projects/project_main/ProjectMainScreen.tsx b/src/screens/private/screens/projects/project_main/ProjectMainScreen.tsx index 87da38c..c2d8548 100644 --- a/src/screens/private/screens/projects/project_main/ProjectMainScreen.tsx +++ b/src/screens/private/screens/projects/project_main/ProjectMainScreen.tsx @@ -1,6 +1,6 @@ import { ProjectCard, getProjectCardData } from '@dash-ui'; import { projectsSelector, useShallow } from '@selectors'; -import { appStore } from '@zustand_store'; +import { appStore } from '@store'; const ProjectMainScreen = () => { const { projectData } = appStore(useShallow(projectsSelector)); diff --git a/src/screens/private/screens/projects/project_preview/ProjectPreviewComponent.tsx b/src/screens/private/screens/projects/project_preview/ProjectPreviewComponent.tsx index 5dfd92c..a8bdce8 100644 --- a/src/screens/private/screens/projects/project_preview/ProjectPreviewComponent.tsx +++ b/src/screens/private/screens/projects/project_preview/ProjectPreviewComponent.tsx @@ -4,7 +4,7 @@ import { ImagePreviewModalButton } from '@dash-ui'; import { ProjectData } from '@service/supabase/supastore/projects/ProjectsCollection'; import { WebsiteIcon, GithubIcon, HostingerIcon } from '@assets'; import { imageModalSelector, useShallow } from '@selectors'; -import { appStore } from '@zustand_store'; +import { appStore } from '@store'; export type IProjectPreviewComponentProps = { project: ProjectData; diff --git a/src/screens/private/screens/projects/project_preview/ProjectPreviewScreen.tsx b/src/screens/private/screens/projects/project_preview/ProjectPreviewScreen.tsx index 8afdf54..cbecc3d 100644 --- a/src/screens/private/screens/projects/project_preview/ProjectPreviewScreen.tsx +++ b/src/screens/private/screens/projects/project_preview/ProjectPreviewScreen.tsx @@ -2,7 +2,7 @@ import { useParams } from 'react-router-dom'; import { useEffect, useState } from 'react'; import ProjectPreviewComponent from './ProjectPreviewComponent'; import { projectsSelector, useShallow } from '@selectors'; -import { appStore } from '@zustand_store'; +import { appStore } from '@store'; type ProjectSelectData = { projectId: string; diff --git a/src/screens/public/login_screen/LoginScreen.tsx b/src/screens/public/login_screen/LoginScreen.tsx index 80df1ea..3c1025f 100644 --- a/src/screens/public/login_screen/LoginScreen.tsx +++ b/src/screens/public/login_screen/LoginScreen.tsx @@ -6,7 +6,7 @@ import { LoginCred } from '@service/supabase/supa_auth/actions/AuthSignIn'; import { signIn } from '@service/supabase/supa_auth/AuthApi'; import { validatePassword } from '../../../util/input/Input'; import { useTranslation } from 'react-i18next'; -import { AuthDataState, appStore } from '@zustand_store'; +import { AuthDataState, appStore } from '@store'; import { authSelector, useShallow } from '@selectors'; interface UpdateProps { diff --git a/src/screens/public/signup_screen/SignupScreen.tsx b/src/screens/public/signup_screen/SignupScreen.tsx index c0e7c29..97ed056 100644 --- a/src/screens/public/signup_screen/SignupScreen.tsx +++ b/src/screens/public/signup_screen/SignupScreen.tsx @@ -5,7 +5,7 @@ import { SignUpCred } from '@service/supabase/supa_auth/actions/AuthSignUp'; import { signUp } from '@service/supabase/supa_auth/AuthApi'; import { getSuccessAlertData } from '@provider'; import { useTranslation } from 'react-i18next'; -import { appStore } from '@zustand_store'; +import { appStore } from '@store'; import { alertSelector, useShallow } from '@selectors'; /** diff --git a/src/service/local_storage/auth/AuthStorageApi.ts b/src/service/local_storage/auth/AuthStorageApi.ts index 3e3b212..a930ce0 100644 --- a/src/service/local_storage/auth/AuthStorageApi.ts +++ b/src/service/local_storage/auth/AuthStorageApi.ts @@ -1,4 +1,4 @@ -import { AuthDataState } from '@zustand_store'; +import { AuthDataState } from '@store'; import { AuthTokenKey } from '../token_constants/StorageConstant'; /** diff --git a/src/service/local_storage/theme/ThemeStorageApi.ts b/src/service/local_storage/theme/ThemeStorageApi.ts index 41f6ceb..43cd5c4 100644 --- a/src/service/local_storage/theme/ThemeStorageApi.ts +++ b/src/service/local_storage/theme/ThemeStorageApi.ts @@ -1,4 +1,4 @@ -import { Theme } from '@zustand_store'; +import { Theme } from '@store'; import { themeKey } from '../token_constants/StorageConstant'; /** diff --git a/src/service/supabase/supa_auth/AuthApi.ts b/src/service/supabase/supa_auth/AuthApi.ts index 6b44bbc..56b812f 100644 --- a/src/service/supabase/supa_auth/AuthApi.ts +++ b/src/service/supabase/supa_auth/AuthApi.ts @@ -1,4 +1,4 @@ -import { AuthDataState } from '@zustand_store'; +import { AuthDataState } from '@store'; import { AuthTokenKey } from '../../local_storage/token_constants/StorageConstant'; import { firebaseForgotPassword } from './actions/AuthForgotPassword'; import { LoginCred, firebaseSingIn } from './actions/AuthSignIn'; diff --git a/src/service/supabase/supa_auth/actions/AuthSignIn.ts b/src/service/supabase/supa_auth/actions/AuthSignIn.ts index 033cea4..cc3c0eb 100644 --- a/src/service/supabase/supa_auth/actions/AuthSignIn.ts +++ b/src/service/supabase/supa_auth/actions/AuthSignIn.ts @@ -1,4 +1,4 @@ -import { AuthDataState } from '@zustand_store'; +import { AuthDataState } from '@store'; import { SupabaseAuth } from '../../supabase_main/Supabase'; /** diff --git a/src/service/supabase/supastore/user_profile/UserProfileStoreApi.ts b/src/service/supabase/supastore/user_profile/UserProfileStoreApi.ts index ee56164..f828a8b 100644 --- a/src/service/supabase/supastore/user_profile/UserProfileStoreApi.ts +++ b/src/service/supabase/supastore/user_profile/UserProfileStoreApi.ts @@ -2,7 +2,7 @@ import { ToastAlertData } from '@provider'; import { UserProfileData } from './UserCollection'; import { getUserUsingId } from './actions/UserDataRead'; import { updateUserData } from './actions/UserDataWrite'; -import { UserData } from '@zustand_store'; +import { UserData } from '@store'; /** * Method to get the user profileData diff --git a/src/service/supabase/supastore/user_profile/actions/UserDataRead.ts b/src/service/supabase/supastore/user_profile/actions/UserDataRead.ts index 1790b14..1e90b54 100644 --- a/src/service/supabase/supastore/user_profile/actions/UserDataRead.ts +++ b/src/service/supabase/supastore/user_profile/actions/UserDataRead.ts @@ -1,4 +1,4 @@ -import { UserData } from '@zustand_store'; +import { UserData } from '@store'; import { SupabaseUsersDB } from '../../../supabase_main/Supabase'; import { SocialLink, SocialType, UserProfileData } from '../UserCollection'; diff --git a/src/zustand_store/index.ts b/src/store/index.ts similarity index 100% rename from src/zustand_store/index.ts rename to src/store/index.ts diff --git a/src/zustand_store/selectors/Alert/Alert.selector.ts b/src/store/selectors/Alert/Alert.selector.ts similarity index 77% rename from src/zustand_store/selectors/Alert/Alert.selector.ts rename to src/store/selectors/Alert/Alert.selector.ts index af3ec3f..61df5a3 100644 --- a/src/zustand_store/selectors/Alert/Alert.selector.ts +++ b/src/store/selectors/Alert/Alert.selector.ts @@ -1,5 +1,5 @@ -import { ToastAlertData } from '@zustand_store/slice'; -import { AppStoreState } from '@zustand_store'; +import { ToastAlertData } from 'src/store/slice'; +import { AppStoreState } from '@store'; export const alertSelector = (state: AppStoreState) => ({ alertData: state.Alert.alertData, diff --git a/src/zustand_store/selectors/Alert/index.ts b/src/store/selectors/Alert/index.ts similarity index 100% rename from src/zustand_store/selectors/Alert/index.ts rename to src/store/selectors/Alert/index.ts diff --git a/src/zustand_store/selectors/Auth/Auth.selector.ts b/src/store/selectors/Auth/Auth.selector.ts similarity index 91% rename from src/zustand_store/selectors/Auth/Auth.selector.ts rename to src/store/selectors/Auth/Auth.selector.ts index b7c332a..87779a4 100644 --- a/src/zustand_store/selectors/Auth/Auth.selector.ts +++ b/src/store/selectors/Auth/Auth.selector.ts @@ -1,4 +1,4 @@ -import { AppStoreState } from '@zustand_store'; +import { AppStoreState } from '@store'; import { getAuthKeyData } from '@service/local_storage/auth/AuthStorageApi'; export const authSelector = (state: AppStoreState) => ({ diff --git a/src/zustand_store/selectors/Auth/index.ts b/src/store/selectors/Auth/index.ts similarity index 100% rename from src/zustand_store/selectors/Auth/index.ts rename to src/store/selectors/Auth/index.ts diff --git a/src/zustand_store/selectors/ImageModal/ImageModal.selector.ts b/src/store/selectors/ImageModal/ImageModal.selector.ts similarity index 77% rename from src/zustand_store/selectors/ImageModal/ImageModal.selector.ts rename to src/store/selectors/ImageModal/ImageModal.selector.ts index f72ecc5..11b3d6f 100644 --- a/src/zustand_store/selectors/ImageModal/ImageModal.selector.ts +++ b/src/store/selectors/ImageModal/ImageModal.selector.ts @@ -1,4 +1,4 @@ -import { AppStoreState } from '@zustand_store'; +import { AppStoreState } from '@store'; export const imageModalSelector = (state: AppStoreState) => ({ imageString: state.ImageModal.imageString, diff --git a/src/zustand_store/selectors/ImageModal/index.ts b/src/store/selectors/ImageModal/index.ts similarity index 100% rename from src/zustand_store/selectors/ImageModal/index.ts rename to src/store/selectors/ImageModal/index.ts diff --git a/src/zustand_store/selectors/Notification/Notification.selector.ts b/src/store/selectors/Notification/Notification.selector.ts similarity index 80% rename from src/zustand_store/selectors/Notification/Notification.selector.ts rename to src/store/selectors/Notification/Notification.selector.ts index 1fd7d14..faebcf5 100644 --- a/src/zustand_store/selectors/Notification/Notification.selector.ts +++ b/src/store/selectors/Notification/Notification.selector.ts @@ -1,4 +1,4 @@ -import { AppStoreState } from 'src/zustand_store/store'; +import { AppStoreState } from 'src/store/store'; export const notificationSelector = (state: AppStoreState) => ({ notificationData: state.Notification.data, diff --git a/src/zustand_store/selectors/Notification/index.ts b/src/store/selectors/Notification/index.ts similarity index 100% rename from src/zustand_store/selectors/Notification/index.ts rename to src/store/selectors/Notification/index.ts diff --git a/src/zustand_store/selectors/Profile/Profile.selector.ts b/src/store/selectors/Profile/Profile.selector.ts similarity index 77% rename from src/zustand_store/selectors/Profile/Profile.selector.ts rename to src/store/selectors/Profile/Profile.selector.ts index c7a77bb..4b3804b 100644 --- a/src/zustand_store/selectors/Profile/Profile.selector.ts +++ b/src/store/selectors/Profile/Profile.selector.ts @@ -1,4 +1,4 @@ -import { AppStoreState } from 'src/zustand_store/store'; +import { AppStoreState } from 'src/store/store'; export const profileSelector = (state: AppStoreState) => ({ profileData: state.Profile.data, diff --git a/src/zustand_store/selectors/Profile/index.ts b/src/store/selectors/Profile/index.ts similarity index 100% rename from src/zustand_store/selectors/Profile/index.ts rename to src/store/selectors/Profile/index.ts diff --git a/src/zustand_store/selectors/Projects/Projects.selector.ts b/src/store/selectors/Projects/Projects.selector.ts similarity index 86% rename from src/zustand_store/selectors/Projects/Projects.selector.ts rename to src/store/selectors/Projects/Projects.selector.ts index 3ea57e5..45f80b5 100644 --- a/src/zustand_store/selectors/Projects/Projects.selector.ts +++ b/src/store/selectors/Projects/Projects.selector.ts @@ -1,4 +1,4 @@ -import { AppStoreState } from '@zustand_store'; +import { AppStoreState } from '@store'; export const projectsSelector = (state: AppStoreState) => ({ projectData: state.Projects.projects, diff --git a/src/zustand_store/selectors/Projects/index.ts b/src/store/selectors/Projects/index.ts similarity index 100% rename from src/zustand_store/selectors/Projects/index.ts rename to src/store/selectors/Projects/index.ts diff --git a/src/zustand_store/selectors/Theme/Theme.selector.ts b/src/store/selectors/Theme/Theme.selector.ts similarity index 74% rename from src/zustand_store/selectors/Theme/Theme.selector.ts rename to src/store/selectors/Theme/Theme.selector.ts index 0ebb299..82a8599 100644 --- a/src/zustand_store/selectors/Theme/Theme.selector.ts +++ b/src/store/selectors/Theme/Theme.selector.ts @@ -1,4 +1,4 @@ -import { AppStoreState } from '@zustand_store'; +import { AppStoreState } from '@store'; export const themeSelector = (state: AppStoreState) => ({ themeValue: state.Theme.themeValue, diff --git a/src/zustand_store/selectors/Theme/index.ts b/src/store/selectors/Theme/index.ts similarity index 100% rename from src/zustand_store/selectors/Theme/index.ts rename to src/store/selectors/Theme/index.ts diff --git a/src/zustand_store/selectors/index.ts b/src/store/selectors/index.ts similarity index 100% rename from src/zustand_store/selectors/index.ts rename to src/store/selectors/index.ts diff --git a/src/zustand_store/slice/Alert/Alert.slice.ts b/src/store/slice/Alert/Alert.slice.ts similarity index 94% rename from src/zustand_store/slice/Alert/Alert.slice.ts rename to src/store/slice/Alert/Alert.slice.ts index 9322b56..8c47926 100644 --- a/src/zustand_store/slice/Alert/Alert.slice.ts +++ b/src/store/slice/Alert/Alert.slice.ts @@ -1,4 +1,4 @@ -import { AppStoreSlice } from '@zustand_store'; +import { AppStoreSlice } from '@store'; import { AlertState, AlertStateSlice, diff --git a/src/zustand_store/slice/Alert/index.ts b/src/store/slice/Alert/index.ts similarity index 100% rename from src/zustand_store/slice/Alert/index.ts rename to src/store/slice/Alert/index.ts diff --git a/src/zustand_store/slice/Alert/types.ts b/src/store/slice/Alert/types.ts similarity index 100% rename from src/zustand_store/slice/Alert/types.ts rename to src/store/slice/Alert/types.ts diff --git a/src/zustand_store/slice/Auth/Auth.slice.ts b/src/store/slice/Auth/Auth.slice.ts similarity index 95% rename from src/zustand_store/slice/Auth/Auth.slice.ts rename to src/store/slice/Auth/Auth.slice.ts index a7314c2..e09f393 100644 --- a/src/zustand_store/slice/Auth/Auth.slice.ts +++ b/src/store/slice/Auth/Auth.slice.ts @@ -1,4 +1,4 @@ -import { AppStoreSlice } from '@zustand_store'; +import { AppStoreSlice } from '@store'; import { AuthDataState, AuthStateSlice } from './types'; import { getAuthKeyData } from '@service/local_storage/auth/AuthStorageApi'; diff --git a/src/zustand_store/slice/Auth/index.ts b/src/store/slice/Auth/index.ts similarity index 100% rename from src/zustand_store/slice/Auth/index.ts rename to src/store/slice/Auth/index.ts diff --git a/src/zustand_store/slice/Auth/types.ts b/src/store/slice/Auth/types.ts similarity index 100% rename from src/zustand_store/slice/Auth/types.ts rename to src/store/slice/Auth/types.ts diff --git a/src/zustand_store/slice/ImageModal/ImageModal.slice.ts b/src/store/slice/ImageModal/ImageModal.slice.ts similarity index 89% rename from src/zustand_store/slice/ImageModal/ImageModal.slice.ts rename to src/store/slice/ImageModal/ImageModal.slice.ts index a658c05..677636a 100644 --- a/src/zustand_store/slice/ImageModal/ImageModal.slice.ts +++ b/src/store/slice/ImageModal/ImageModal.slice.ts @@ -1,4 +1,4 @@ -import { AppStoreSlice } from '@zustand_store'; +import { AppStoreSlice } from '@store'; import { ImageModalState, ImageModalStateSlice } from './types'; const initialState: ImageModalState = { diff --git a/src/zustand_store/slice/ImageModal/index.ts b/src/store/slice/ImageModal/index.ts similarity index 100% rename from src/zustand_store/slice/ImageModal/index.ts rename to src/store/slice/ImageModal/index.ts diff --git a/src/zustand_store/slice/ImageModal/types.ts b/src/store/slice/ImageModal/types.ts similarity index 100% rename from src/zustand_store/slice/ImageModal/types.ts rename to src/store/slice/ImageModal/types.ts diff --git a/src/zustand_store/slice/Notification/Notification.slice.ts b/src/store/slice/Notification/Notification.slice.ts similarity index 91% rename from src/zustand_store/slice/Notification/Notification.slice.ts rename to src/store/slice/Notification/Notification.slice.ts index 71a15df..0ce9966 100644 --- a/src/zustand_store/slice/Notification/Notification.slice.ts +++ b/src/store/slice/Notification/Notification.slice.ts @@ -1,4 +1,4 @@ -import { AppStoreSlice } from '@zustand_store'; +import { AppStoreSlice } from '@store'; import { NotificationState, NotificationStateSlice } from './types'; const initialState: NotificationState = { diff --git a/src/zustand_store/slice/Notification/index.ts b/src/store/slice/Notification/index.ts similarity index 100% rename from src/zustand_store/slice/Notification/index.ts rename to src/store/slice/Notification/index.ts diff --git a/src/zustand_store/slice/Notification/types.ts b/src/store/slice/Notification/types.ts similarity index 100% rename from src/zustand_store/slice/Notification/types.ts rename to src/store/slice/Notification/types.ts diff --git a/src/zustand_store/slice/Profile/Profile.slice.ts b/src/store/slice/Profile/Profile.slice.ts similarity index 98% rename from src/zustand_store/slice/Profile/Profile.slice.ts rename to src/store/slice/Profile/Profile.slice.ts index 183b4a4..7506bbe 100644 --- a/src/zustand_store/slice/Profile/Profile.slice.ts +++ b/src/store/slice/Profile/Profile.slice.ts @@ -2,7 +2,7 @@ import { SocialType, UserProfileData, } from '@service/supabase/supastore/user_profile/UserCollection'; -import { AppStoreSlice } from 'src/zustand_store/store'; +import { AppStoreSlice } from 'src/store/store'; import { ProfileStateSlice, UserProfileState } from './types'; import { getProfileKeyData, diff --git a/src/zustand_store/slice/Profile/index.ts b/src/store/slice/Profile/index.ts similarity index 100% rename from src/zustand_store/slice/Profile/index.ts rename to src/store/slice/Profile/index.ts diff --git a/src/zustand_store/slice/Profile/types.ts b/src/store/slice/Profile/types.ts similarity index 100% rename from src/zustand_store/slice/Profile/types.ts rename to src/store/slice/Profile/types.ts diff --git a/src/zustand_store/slice/Projects/Projects.slice.ts b/src/store/slice/Projects/Projects.slice.ts similarity index 95% rename from src/zustand_store/slice/Projects/Projects.slice.ts rename to src/store/slice/Projects/Projects.slice.ts index a6dfab2..9bdc7b4 100644 --- a/src/zustand_store/slice/Projects/Projects.slice.ts +++ b/src/store/slice/Projects/Projects.slice.ts @@ -1,4 +1,4 @@ -import { AppStoreSlice } from '@zustand_store'; +import { AppStoreSlice } from '@store'; import { ProjectDataState, ProjectStateSlice, ProjectData } from './types'; const initialState: ProjectDataState = { diff --git a/src/zustand_store/slice/Projects/index.ts b/src/store/slice/Projects/index.ts similarity index 100% rename from src/zustand_store/slice/Projects/index.ts rename to src/store/slice/Projects/index.ts diff --git a/src/zustand_store/slice/Projects/types.ts b/src/store/slice/Projects/types.ts similarity index 100% rename from src/zustand_store/slice/Projects/types.ts rename to src/store/slice/Projects/types.ts diff --git a/src/zustand_store/slice/Theme/Theme.slice.ts b/src/store/slice/Theme/Theme.slice.ts similarity index 89% rename from src/zustand_store/slice/Theme/Theme.slice.ts rename to src/store/slice/Theme/Theme.slice.ts index feea6af..c913009 100644 --- a/src/zustand_store/slice/Theme/Theme.slice.ts +++ b/src/store/slice/Theme/Theme.slice.ts @@ -1,4 +1,4 @@ -import { AppStoreSlice } from '@zustand_store'; +import { AppStoreSlice } from '@store'; import { Theme, ThemeState, ThemeStateSlice } from './types'; const THEME = 'theme'; diff --git a/src/zustand_store/slice/Theme/index.ts b/src/store/slice/Theme/index.ts similarity index 100% rename from src/zustand_store/slice/Theme/index.ts rename to src/store/slice/Theme/index.ts diff --git a/src/zustand_store/slice/Theme/types.ts b/src/store/slice/Theme/types.ts similarity index 100% rename from src/zustand_store/slice/Theme/types.ts rename to src/store/slice/Theme/types.ts diff --git a/src/zustand_store/slice/index.ts b/src/store/slice/index.ts similarity index 100% rename from src/zustand_store/slice/index.ts rename to src/store/slice/index.ts diff --git a/src/zustand_store/store/appStore.tsx b/src/store/store/appStore.tsx similarity index 95% rename from src/zustand_store/store/appStore.tsx rename to src/store/store/appStore.tsx index 2467552..581e7a4 100644 --- a/src/zustand_store/store/appStore.tsx +++ b/src/store/store/appStore.tsx @@ -9,7 +9,7 @@ import { createProjectsSlice, createImageModalSlice, createNotificationSlice, -} from '@zustand_store/slice'; +} from '@store/slice'; import { AppStoreState } from './types'; import { createProfileSlice } from '../slice/Profile'; diff --git a/src/zustand_store/store/index.ts b/src/store/store/index.ts similarity index 100% rename from src/zustand_store/store/index.ts rename to src/store/store/index.ts diff --git a/src/zustand_store/store/types.ts b/src/store/store/types.ts similarity index 95% rename from src/zustand_store/store/types.ts rename to src/store/store/types.ts index ab1a7e0..7a4edc7 100644 --- a/src/zustand_store/store/types.ts +++ b/src/store/store/types.ts @@ -7,7 +7,7 @@ import { ImageModalStateSlice, NotificationStateSlice, ProfileStateSlice, -} from '@zustand_store/slice'; +} from '@store/slice'; import {} from '../slice/Profile/types'; export interface AppStoreState { diff --git a/tsconfig.path.json b/tsconfig.path.json index 0b2fac7..01c487f 100644 --- a/tsconfig.path.json +++ b/tsconfig.path.json @@ -12,9 +12,9 @@ "@screens/*": ["src/screens/*"], "@service": ["src/service"], "@service/*": ["src/service/*"], - "@zustand_store": ["src/zustand_store/index"], - "@zustand_store/slice": ["src/zustand_store/slice"], - "@selectors": ["src/zustand_store/selectors"] + "@store": ["src/store/index"], + "@store/slice": ["src/store/slice"], + "@selectors": ["src/store/selectors"] } } }