diff --git a/client/src/index.tsx b/client/src/index.tsx index 059c8470..d149cf5f 100644 --- a/client/src/index.tsx +++ b/client/src/index.tsx @@ -6,7 +6,6 @@ import "./styles/variables.css"; import "./index.css"; import { BrowserRouter } from "react-router-dom"; import { Provider } from "react-redux"; -// import store from "./services/redux-store/store"; import store from "./services/redux/store"; ReactDOM.render( diff --git a/client/src/services/redux-actions/index.js b/client/src/services/redux-actions/index.js deleted file mode 100644 index 868a08b8..00000000 --- a/client/src/services/redux-actions/index.js +++ /dev/null @@ -1,307 +0,0 @@ -export const mainPageMessageViewOnOff = (data) => { - // this action is for to store the state of message box on and off - return { - type: "MainPageMessageViewOnOf", - payload: data, - }; -}; - -export const mainPageMessageInnerViewOnOff = (data) => { - // this action is for to store the state of inner user message box on and off - return { - type: "mainPageMessageInnerViewOnOff", - payload: data, - }; -}; - -export const messageListAction = (data) => { - return { - type: "messageList", - payload: data, - }; -}; - -export const appendMessageOnMessageListAction = (data) => { - return { - type: "appendMessageOnMessageList", - payload: data, - }; -}; - -export const userPostResponseData = (data) => { - return { - type: "UserPostResponseData", - payload: data, - }; -}; - -export const homePageUserPostFieldDataAction = (data) => { - return { - type: "homePageUserPostFieldData", - payload: data, - }; -}; - -export const userProfileDetailAction = (data) => { - return { - type: "userProfileDetail", - payload: data, - }; -}; - -export const setRootUserPostData = (data) => { - return { - type: "setRootUserPostData", - payload: data, - }; -}; - -export const setRootUserFriends = (data) => { - return { - type: "setRootUserFriends", - payload: data, - }; -}; - -export const changeUserProfilePictureAction = (data) => { - return { - type: "changeUserProfilePicture", - payload: data, - }; -}; - -export const changeRootUserUserIDAction = (data) => { - return { - type: "changeRootUserUserID", - payload: data, - }; -}; - -export const setRootUserProfileDataState = (data) => { - return { - type: "setRootUserProfileDataState", - payload: data, - }; -}; - -export const changeRootUserNameAction = (data) => { - return { - type: "changeRootUserName", - payload: data, - }; -}; - -export const userProfilePostAction = (value) => { - return { - type: "userProfilePost", - payload: value, - }; -}; - -export const incrementPostCommentNumber = (data) => { - return { - type: "incrementPostCommentNumber", - payload: data, - }; -}; - -export const profilePageDataAction = (value) => { - return { - type: "profilePageDataAction", - payload: value, - }; -}; - -export const setProfilePageFriends = (data) => { - return { - type: "setProfilePageFriends", - payload: data, - }; -}; - -export const setProfilePageFollowers = (data) => { - return { - type: "setProfilePageFollowers", - payload: data, - }; -}; - -export const setProfilePageFollowings = (data) => { - return { - type: "setProfilePageFollowings", - payload: data, - }; -}; - -export const setFetchedFriendsOrFollowersOrFollowing = (bool) => { - return { - type: "setFetchedFriendsOrFollowersOrFollowing", - bool, - }; -}; - -export const followedUserPostDataAction = (value) => { - return { - type: "followedUserPostData", - payload: value, - }; -}; - -// this action will have the messge of rootUser message to other people and which is currently fetch -export const currentUserMessageAction = (message) => { - return { - type: "currentUserMessage", - payload: message, - }; -}; - -export const appendOnCurrentInnerUserMessage = (message) => { - return { - type: "appendOnCurrentInnerUserMessage", - payload: message, - }; -}; - -export const userMessageFieldAction = (message) => { - return { - type: "userMessageField", - payload: message, - }; -}; - -export const userSuggestionAction = (data) => { - return { - type: "userSugestion", - payload: data, - }; -}; - -export const isFollowedSuggestedUser = (data) => { - return { - type: "isFollowedSuggestedUser", - payload: data, - }; -}; - -export const followedByUserAction = (data) => { - return { - type: "followedByUser", - payload: data, - }; -}; - -export const isFollowedFollowedByUser = (data) => { - return { - type: "isFollowedFollowedByUser", - payload: data, - }; -}; - -export const commentBoxAction = (data) => { - return { - type: "commentBox", - payload: data, - }; -}; - -export const startProgressBar = () => { - return { - type: "startProgressBar", - }; -}; - -export const stopProgressBar = () => { - return { - type: "stopProgressBar", - }; -}; - -export const hideProgressBar = () => { - return { - type: "hideProgressBar", - }; -}; - -export const changeLikeNo = (data) => { - return { - type: "changeLikeNo", - payload: data, - }; -}; - -// export const setUserStories = (data) => { -// return { -// type: "setUserStories", -// payload: data, -// }; -// }; - -// export const storyIndex = (data) => { -// return { -// type: "storyIndex", -// payload: data, -// }; -// }; - -export const openSideBarDrawer = (data) => { - return { - type: "openSideBarDrawer", - payload: data, - }; -}; - -export const openRightPartDrawer = (bool) => { - return { - type: "openRightPartDrawer", - bool, - }; -}; - -export const setHomePagePostFieldViewValue = (data) => { - return { - type: "setHomePagePostFieldViewValue", - payload: data, - }; -}; - -export const displayUserPostFieldEmojiPicker = (bool) => { - return { - type: "displayUserPostFieldEmojiPicker", - bool, - }; -}; - -export const openNotificationBox = (bool) => { - return { - type: "openNotificationBox", - bool, - }; -}; - -export const setNotificationData = (data) => { - return { - type: "setNotificationData", - payload: data, - }; -}; - -export const openMoreProfileBox = (bool) => { - return { - type: "openMoreProfileBox", - bool, - }; -}; - -export const showLoadingSpinner = (bool) => { - return { - type: "showLoadingSpinner", - bool, - }; -}; - -// export const setVideoPageData = (data) => { -// return { -// type: "setVideoPageData", -// payload: data, -// }; -// }; diff --git a/client/src/services/redux-reducer/components/commentBox.js b/client/src/services/redux-reducer/components/commentBox.js deleted file mode 100644 index 6cce30d7..00000000 --- a/client/src/services/redux-reducer/components/commentBox.js +++ /dev/null @@ -1,19 +0,0 @@ -const initialState = { - openCommentBox: false, - postID: "", - toId: "", - toUserId: "", - commented: false, - newComment: "", - comments: [], -}; - -const commentBoxReducer = (state = initialState, action) => { - if (action.type === "commentBox") { - return action.payload; - } else { - return state; - } -}; - -export default commentBoxReducer; diff --git a/client/src/services/redux-reducer/components/followedByUserReducer.js b/client/src/services/redux-reducer/components/followedByUserReducer.js deleted file mode 100644 index e6e11b20..00000000 --- a/client/src/services/redux-reducer/components/followedByUserReducer.js +++ /dev/null @@ -1,29 +0,0 @@ -const initialState = []; - -const followedByUserReducer = (state = initialState, action) => { - if (action.type === "followedByUser") { - const newList = action.payload.map((element) => { - return { - ...element, - followed: false, - }; - }); - return newList.sort((a, b) => { - if (a.type !== "bot" || b.type !== "bot") { - return; - } else { - return Math.random() - 0.5; - } - }); - } else if (action.type === "isFollowedFollowedByUser") { - return state.map((user) => - user.userID === action.payload.userID - ? { ...user, followed: action.payload.followed } - : user - ); - } else { - return state; - } -}; - -export default followedByUserReducer; diff --git a/client/src/services/redux-reducer/components/messageBox/CurrentUserMessageReducer.js b/client/src/services/redux-reducer/components/messageBox/CurrentUserMessageReducer.js deleted file mode 100644 index 2d34f044..00000000 --- a/client/src/services/redux-reducer/components/messageBox/CurrentUserMessageReducer.js +++ /dev/null @@ -1,26 +0,0 @@ -const initialMessage = { - messageToId: "", - messageToUserId: "", - receiverPicture: "", - message: [], - fetchedInnerMessage: false, -}; - -// this action will Store the messge of rootUser message to other people and which is currently fetch -const setCurrentUserMessageReducer = (state = initialMessage, action) => { - if (action.type === "currentUserMessage") { - return { - ...action.payload, - message: action.payload.message.reverse(), - }; - } else if (action.type === "appendOnCurrentInnerUserMessage") { - return { - ...state, - message: [action.payload, ...state.message], - }; - } else { - return state; - } -}; - -export default setCurrentUserMessageReducer; diff --git a/client/src/services/redux-reducer/components/messageBox/mainPageInnerMessageBoxOnOff.js b/client/src/services/redux-reducer/components/messageBox/mainPageInnerMessageBoxOnOff.js deleted file mode 100644 index 2769c09d..00000000 --- a/client/src/services/redux-reducer/components/messageBox/mainPageInnerMessageBoxOnOff.js +++ /dev/null @@ -1,11 +0,0 @@ -const initialState = false; - -const mainPageInnerMessageBoxOnOff = (state = initialState, action) => { - if (action.type === "mainPageMessageInnerViewOnOff") { - return action.payload; - } else { - return state; - } -}; - -export default mainPageInnerMessageBoxOnOff; diff --git a/client/src/services/redux-reducer/components/messageBox/mainPageMessageOnOff.js b/client/src/services/redux-reducer/components/messageBox/mainPageMessageOnOff.js deleted file mode 100644 index 64a4d451..00000000 --- a/client/src/services/redux-reducer/components/messageBox/mainPageMessageOnOff.js +++ /dev/null @@ -1,11 +0,0 @@ -const initialState = false; - -const changeMainPageMessageView = (state = initialState, action) => { - if (action.type === "MainPageMessageViewOnOf") { - return action.payload; - } else { - return state; - } -}; - -export default changeMainPageMessageView; diff --git a/client/src/services/redux-reducer/components/messageBox/messageListReducer.js b/client/src/services/redux-reducer/components/messageBox/messageListReducer.js deleted file mode 100644 index 82f665f3..00000000 --- a/client/src/services/redux-reducer/components/messageBox/messageListReducer.js +++ /dev/null @@ -1,47 +0,0 @@ -const initialState = []; - -const messageListReducer = (state = initialState, action) => { - if (action.type === "messageList") { - return action.payload.sort((a, b) => { - if (new Date(a.lastMessageOn) < new Date(b.lastMessageOn)) { - return 1; - } else { - return -1; - } - }); - } else if (action.type === "appendMessageOnMessageList") { - let isExistOnList = false; - let appendedMessage = state.map((element) => { - if (element.messageToId === action.payload.id) { - isExistOnList = true; - return { - ...element, - message: [...element.message, action.payload.msgInfo], - }; - } else { - return element; - } - }); - if (isExistOnList === false) { - // if user is sending message for the first time - appendedMessage.unshift({ - lastMessageOn: new Date(), - messageToId: action.payload.id, - messageToUserId: action.payload.messageToUserId, - receiverPicture: action.payload.receiverPicture, - message: [ - { - senderId: action.payload.msgInfo.senderId, - senderUserId: action.payload.msgInfo.senderUserId, - content: action.payload.msgInfo.content, - date: action.payload.msgInfo.date, - }, - ], - }); - } - return appendedMessage; - } else { - return state; - } -}; -export default messageListReducer; diff --git a/client/src/services/redux-reducer/components/moreProfile.js b/client/src/services/redux-reducer/components/moreProfile.js deleted file mode 100644 index 57d2f91e..00000000 --- a/client/src/services/redux-reducer/components/moreProfile.js +++ /dev/null @@ -1,11 +0,0 @@ -const initialState = false; - -const moreProfileBoxReducer = (state = initialState, action) => { - if (action.type === "openMoreProfileBox") { - return action.bool; - } else { - return state; - } -}; - -export default moreProfileBoxReducer; diff --git a/client/src/services/redux-reducer/components/notificationBox.js b/client/src/services/redux-reducer/components/notificationBox.js deleted file mode 100644 index df1f98e8..00000000 --- a/client/src/services/redux-reducer/components/notificationBox.js +++ /dev/null @@ -1,22 +0,0 @@ -const initialState = { - notificationData: [], - open: false, -}; - -const notificationBox = (state = initialState, action) => { - if (action.type === "openNotificationBox") { - return { - ...state, - open: action.bool, - }; - } else if (action.type === "setNotificationData") { - return { - ...state, - notificationData: action.payload, - }; - } else { - return state; - } -}; - -export default notificationBox; diff --git a/client/src/services/redux-reducer/components/progressBar.js b/client/src/services/redux-reducer/components/progressBar.js deleted file mode 100644 index 827ac553..00000000 --- a/client/src/services/redux-reducer/components/progressBar.js +++ /dev/null @@ -1,27 +0,0 @@ -const initialState = { - showProgressBar: false, - isCompleted: false, -}; - -const progressBarReducer = (state = initialState, action) => { - if (action.type === "startProgressBar") { - return { - isCompleted: false, - showProgressBar: true, - }; - } else if (action.type === "stopProgressBar") { - return { - showProgressBar: true, - isCompleted: true, - }; - } else if (action.type === "hideProgressBar") { - return { - showProgressBar: false, - isCompleted: false, - }; - } else { - return state; - } -}; - -export default progressBarReducer; diff --git a/client/src/services/redux-reducer/components/rightPartDrawer.js b/client/src/services/redux-reducer/components/rightPartDrawer.js deleted file mode 100644 index a0085492..00000000 --- a/client/src/services/redux-reducer/components/rightPartDrawer.js +++ /dev/null @@ -1,11 +0,0 @@ -const initialState = false; - -const rightPartDrawerReducer = (state = initialState, action) => { - if (action.type === "openRightPartDrawer") { - return action.bool; - } else { - return state; - } -}; - -export default rightPartDrawerReducer; diff --git a/client/src/services/redux-reducer/components/showLoadingSpinner.js b/client/src/services/redux-reducer/components/showLoadingSpinner.js deleted file mode 100644 index 7600fcfd..00000000 --- a/client/src/services/redux-reducer/components/showLoadingSpinner.js +++ /dev/null @@ -1,8 +0,0 @@ -const initialState = false; - -const showLoadingSpinnerReducer = (state = initialState, action) => { - if (action.type === "showLoadingSpinner") return action.bool; - return state; -}; - -export default showLoadingSpinnerReducer; diff --git a/client/src/services/redux-reducer/components/sideBarDrawer.js b/client/src/services/redux-reducer/components/sideBarDrawer.js deleted file mode 100644 index 87bbb83a..00000000 --- a/client/src/services/redux-reducer/components/sideBarDrawer.js +++ /dev/null @@ -1,11 +0,0 @@ -const initialState = false; - -const sideBarDrawerReducer = (state = initialState, action) => { - if (action.type === "openSideBarDrawer") { - return action.payload; - } else { - return state; - } -}; - -export default sideBarDrawerReducer; diff --git a/client/src/services/redux-reducer/components/userSuggestionReducer.js b/client/src/services/redux-reducer/components/userSuggestionReducer.js deleted file mode 100644 index 8d7aa55b..00000000 --- a/client/src/services/redux-reducer/components/userSuggestionReducer.js +++ /dev/null @@ -1,29 +0,0 @@ -const initialState = []; - -const userSuggestionReducer = (state = initialState, action) => { - if (action.type === "userSugestion") { - const newList = action.payload.map((element) => { - return { - ...element, - followed: false, - }; - }); - return newList.sort((a, b) => { - if (a.type !== "bot" || b.type !== "bot") { - return; - } else { - return Math.random() - 0.5; - } - }); - } else if (action.type === "isFollowedSuggestedUser") { - return state.map((user) => - user.userID === action.payload.userID - ? { ...user, followed: action.payload.followed } - : user - ); - } else { - return state; - } -}; - -export default userSuggestionReducer; diff --git a/client/src/services/redux-reducer/global/UserProfileDetailReducer.js b/client/src/services/redux-reducer/global/UserProfileDetailReducer.js deleted file mode 100644 index 5912ca07..00000000 --- a/client/src/services/redux-reducer/global/UserProfileDetailReducer.js +++ /dev/null @@ -1,39 +0,0 @@ -const initialState = { - fetchedPostData: false, -}; -// this store the detail of user - -const setUserProfileDetailReducer = (state = initialState, action) => { - switch (action.type) { - case "userProfileDetail": - return { - ...state, - ...action.payload, - }; - case "changeUserProfilePicture": - return { - ...state, - picture: action.payload, - }; - case "changeRootUserUserID": - return { - ...state, - userID: action.payload, - }; - case "changeRootUserName": - return { - ...state, - name: action.payload, - }; - case "setRootUserPostData": - return { - ...state, - fetchedPostData: action.payload.fetchedPostData, - posts: action.payload.posts, - }; - default: - return state; - } -}; - -export default setUserProfileDetailReducer; diff --git a/client/src/services/redux-reducer/global/rootUserFriends.js b/client/src/services/redux-reducer/global/rootUserFriends.js deleted file mode 100644 index e2d89787..00000000 --- a/client/src/services/redux-reducer/global/rootUserFriends.js +++ /dev/null @@ -1,17 +0,0 @@ -const initialState = { - fetchedFriends: false, - friends: [], -}; - -const rootUserFriends = (state = initialState, action) => { - if (action.type === "setRootUserFriends") { - return { - fetchedFriends: action.payload.fetchedFriends, - friends: action.payload.friends.sort((a, b) => Math.random() - 0.5), - }; - } else { - return state; - } -}; - -export default rootUserFriends; diff --git a/client/src/services/redux-reducer/index.js b/client/src/services/redux-reducer/index.js deleted file mode 100644 index 6e4a16ee..00000000 --- a/client/src/services/redux-reducer/index.js +++ /dev/null @@ -1,73 +0,0 @@ -import { combineReducers } from "redux"; -// Javascript -// import setUserProfileDetailReducer from "./global/UserProfileDetailReducer"; -import changeMainPageMessageView from "./components/messageBox/mainPageMessageOnOff"; -import setUserPostResponseData from "./page/home/UserPostResponseData"; -import homePageUserPostFieldDataReducer from "./page/home/homePageUserPostFieldData"; -import setUserProfilePostReducer from "./page/profile/UserProfilePostReducer"; -import profilePageDataReducer from "./page/profile/profilePageDataReducer"; -import setFollowedUserPostDataReducer from "./page/home/FollowedUserPostDataReducer"; -import setCurrentUserMessageReducer from "./components/messageBox/CurrentUserMessageReducer"; -import mainPageInnerMessageBoxOnOff from "./components/messageBox/mainPageInnerMessageBoxOnOff"; -import setUserMessageFieldReducer from "./userMessageFieldReducer"; -import userSuggestionReducer from "./components/userSuggestionReducer"; -// import followedByUserReducer from "./components/followedByUserReducer"; -import messageListReducer from "./components/messageBox/messageListReducer"; -import commentBoxReducer from "./components/commentBox"; -import progressBarReducer from "./components/progressBar"; -// import userStoriesReducer from "./page/stories/userStories"; -import sideBarDrawerReducer from "./components/sideBarDrawer"; -import rightPartDrawerReducer from "./components/rightPartDrawer"; -import homePagePostFieldViewValue from "./page/home/homePagePostFieldViewValue"; -import notificationBox from "./components/notificationBox"; -import moreProfileBoxReducer from "./components/moreProfile"; -import showLoadingSpinnerReducer from "./components/showLoadingSpinner"; -// import videoPageDataReducer from "./page/video"; -import rootUserFriends from "./global/rootUserFriends"; -import rootUserProfileDataState from "./page/profile/rootUserProfileDataState"; -import displayEmojiPicker from "./page/home/displayEmojiPicker"; -// Typescript -// import userProfileDetailReducer from "./global/rootUserProfileDetail/reducer"; -// import rootUserFriends from "./global/rootUserFriends/reducer"; -import videoPageDataReducer from "../redux/pages/video/reducer"; -import userStoriesReducer from "../redux/pages/stories/reducer"; -import setUserProfileDetailReducer from "../redux/global/rootUserProfileDetail/reducer"; -import followedByUserReducer from "../redux/components/followedByUser/reducer"; - -const rootReducers = combineReducers({ - // Javascript - // setUserProfileDetailReducer, - rootUserFriends, - changeMainPageMessageView, - setUserPostResponseData, - homePageUserPostFieldDataReducer, - setUserProfilePostReducer, - profilePageDataReducer, - setFollowedUserPostDataReducer, - setCurrentUserMessageReducer, - mainPageInnerMessageBoxOnOff, - setUserMessageFieldReducer, - userSuggestionReducer, - // followedByUserReducer, - messageListReducer, - commentBoxReducer, - progressBarReducer, - // userStoriesReducer, - sideBarDrawerReducer, - rightPartDrawerReducer, - homePagePostFieldViewValue, - notificationBox, - moreProfileBoxReducer, - showLoadingSpinnerReducer, - // videoPageDataReducer, - rootUserProfileDataState, - displayEmojiPicker, - // Typescript - // rootUserFriends, - setUserProfileDetailReducer, - videoPageDataReducer, - userStoriesReducer, - followedByUserReducer, -}); - -export default rootReducers; diff --git a/client/src/services/redux-reducer/page/home/FollowedUserPostDataReducer.js b/client/src/services/redux-reducer/page/home/FollowedUserPostDataReducer.js deleted file mode 100644 index d673a12b..00000000 --- a/client/src/services/redux-reducer/page/home/FollowedUserPostDataReducer.js +++ /dev/null @@ -1,30 +0,0 @@ -const initialState = []; - -const setFollowedUserPostDataReducer = (state = initialState, action) => { - if (action.type === "followedUserPostData") { - return action.payload.sort((a, b) => Math.random() - 0.5); - } else if (action.type === "incrementPostCommentNumber") { - return state.map((user) => - user.userID === action.payload.to - ? { - ...user, - posts: user.posts.map((post) => - post.id === action.payload.postID - ? { - ...post, - comments: { - ...post.comments, - No: post.comments.No + 1, - }, - } - : post - ), - } - : user - ); - } else { - return state; - } -}; - -export default setFollowedUserPostDataReducer; diff --git a/client/src/services/redux-reducer/page/home/UserPostResponseData.js b/client/src/services/redux-reducer/page/home/UserPostResponseData.js deleted file mode 100644 index c9714240..00000000 --- a/client/src/services/redux-reducer/page/home/UserPostResponseData.js +++ /dev/null @@ -1,22 +0,0 @@ -const initialState = [ - // { - // id: "", - // useremail: "", - // username: "", - // userID: "", - // caption: "", - // pictureUrl: - // "https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8dXNlcnxlbnwwfHwwfHw%3D&ixlib=rb-1.2.1&w=1000&q=80", - // like: "", - // date: "", - // }, -]; -const setUserPostResponseData = (state = initialState, action) => { - if (action.type === "UserPostResponseData") { - return [action.payload, ...state]; - } else { - return state; - } -}; - -export default setUserPostResponseData; diff --git a/client/src/services/redux-reducer/page/home/displayEmojiPicker.js b/client/src/services/redux-reducer/page/home/displayEmojiPicker.js deleted file mode 100644 index ba7337bb..00000000 --- a/client/src/services/redux-reducer/page/home/displayEmojiPicker.js +++ /dev/null @@ -1,11 +0,0 @@ -const initialState = false; - -const displayEmojiPicker = (state = initialState, action) => { - if (action.type === "displayUserPostFieldEmojiPicker") { - return action.bool; - } else { - return state; - } -}; - -export default displayEmojiPicker; diff --git a/client/src/services/redux-reducer/page/home/homePagePostFieldViewValue.js b/client/src/services/redux-reducer/page/home/homePagePostFieldViewValue.js deleted file mode 100644 index 024c67c8..00000000 --- a/client/src/services/redux-reducer/page/home/homePagePostFieldViewValue.js +++ /dev/null @@ -1,10 +0,0 @@ -const initialState = "min"; - -const homePagePostFieldViewValue = (state = initialState, action) => { - if (action.type === "setHomePagePostFieldViewValue") { - return action.payload; - } else { - return state; - } -}; -export default homePagePostFieldViewValue; diff --git a/client/src/services/redux-reducer/page/home/homePageUserPostFieldData.js b/client/src/services/redux-reducer/page/home/homePageUserPostFieldData.js deleted file mode 100644 index c55e7593..00000000 --- a/client/src/services/redux-reducer/page/home/homePageUserPostFieldData.js +++ /dev/null @@ -1,19 +0,0 @@ -const initialState = { - content: "", - image: {}, -}; - -const homePageUserPostFieldDataReducer = (state = initialState, action) => { - if (action.type === "homePageUserPostFieldData") { - // console.log(action.payload); - const { content, image } = action.payload; - return { - content, - image, - }; - } else { - return state; - } -}; - -export default homePageUserPostFieldDataReducer; diff --git a/client/src/services/redux-reducer/page/profile/UserProfilePostReducer.js b/client/src/services/redux-reducer/page/profile/UserProfilePostReducer.js deleted file mode 100644 index 638c6eb0..00000000 --- a/client/src/services/redux-reducer/page/profile/UserProfilePostReducer.js +++ /dev/null @@ -1,11 +0,0 @@ -const initialState = []; -// this store the user Post data -const setUserProfilePostReducer = (state = initialState, action) => { - if (action.type === "userProfilePost") { - return action.payload; - } else { - return state; - } -}; - -export default setUserProfilePostReducer; diff --git a/client/src/services/redux-reducer/page/profile/profilePageDataReducer.js b/client/src/services/redux-reducer/page/profile/profilePageDataReducer.js deleted file mode 100644 index c693e25c..00000000 --- a/client/src/services/redux-reducer/page/profile/profilePageDataReducer.js +++ /dev/null @@ -1,32 +0,0 @@ -const initialState = { - userID: "", - post: [], - friends: [], - followings: [], - followers: [], -}; - -const profilePageDataReducer = (state = initialState, action) => { - if (action.type === "profilePageDataAction") { - return action.payload; - } else if (action.type === "setProfilePageFriends") { - return { - ...state, - friends: action.payload, - }; - } else if (action.type === "setProfilePageFollowers") { - return { - ...state, - followers: action.payload, - }; - } else if (action.type === "setProfilePageFollowings") { - return { - ...state, - followings: action.payload, - }; - } else { - return state; - } -}; - -export default profilePageDataReducer; diff --git a/client/src/services/redux-reducer/page/profile/rootUserProfileDataState.js b/client/src/services/redux-reducer/page/profile/rootUserProfileDataState.js deleted file mode 100644 index c074f0b2..00000000 --- a/client/src/services/redux-reducer/page/profile/rootUserProfileDataState.js +++ /dev/null @@ -1,15 +0,0 @@ -const initialState = { - fetchedRootUserProfileData: false, - getRootUserProfileData: false, -}; - -const rootUserProfileDataState = (state = initialState, action) => { - switch (action.type) { - case "setRootUserProfileDataState": - return action.payload; - default: - return state; - } -}; - -export default rootUserProfileDataState; diff --git a/client/src/services/redux-reducer/page/stories/userStories.js b/client/src/services/redux-reducer/page/stories/userStories.js deleted file mode 100644 index 75083806..00000000 --- a/client/src/services/redux-reducer/page/stories/userStories.js +++ /dev/null @@ -1,28 +0,0 @@ -const initialState = { - storyIndex: 0, - data: [], -}; - -const userStoriesReducer = (state = initialState, action) => { - if (action.type === "setUserStories") { - return { - ...state, - data: action.payload.sort((a, b) => { - if (a.type !== "bot" || b.type !== "bot") { - return; - } else { - return Math.random() - 0.5; - } - }), - }; - } else if (action.type === "storyIndex") { - return { - ...state, - storyIndex: action.payload, - }; - } else { - return state; - } -}; - -export default userStoriesReducer; diff --git a/client/src/services/redux-reducer/page/video/index.js b/client/src/services/redux-reducer/page/video/index.js deleted file mode 100644 index 2dc85411..00000000 --- a/client/src/services/redux-reducer/page/video/index.js +++ /dev/null @@ -1,12 +0,0 @@ -// import constant from "../../../../constant/videoPage"; -// const initialState = constant.homePageVideos.sort(() => Math.random() - 0.5); -const initialState = []; - -const videoPageDataReducer = (state = initialState, action) => { - if (action.type === "setVideoPageData") { - return action.payload.sort(() => Math.random() - 0.5); - } - return state; -}; - -export default videoPageDataReducer; diff --git a/client/src/services/redux-reducer/userMessageFieldReducer.js b/client/src/services/redux-reducer/userMessageFieldReducer.js deleted file mode 100644 index e991763c..00000000 --- a/client/src/services/redux-reducer/userMessageFieldReducer.js +++ /dev/null @@ -1,11 +0,0 @@ -const initialMessage = ""; - -const setUserMessageFieldReducer = (state = initialMessage, action) => { - if (action.type === "userMessageField") { - return action.payload; - } else { - return state; - } -}; - -export default setUserMessageFieldReducer; diff --git a/client/src/services/redux-store/store.js b/client/src/services/redux-store/store.js deleted file mode 100644 index 211861b0..00000000 --- a/client/src/services/redux-store/store.js +++ /dev/null @@ -1,7 +0,0 @@ -import { applyMiddleware, createStore } from "redux"; -import rootReducers from "../redux-reducer"; -import thunk from "redux-thunk"; - -const store = createStore(rootReducers, {}, applyMiddleware(thunk)); - -export default store;