Skip to content

Commit

Permalink
fix(client): some small changes
Browse files Browse the repository at this point in the history
fixing #109
  • Loading branch information
roman-ojha committed Jun 24, 2022
1 parent d2b6fce commit a6b76b1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions client/src/components/FollowedBy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import User_Profile_Icon from "../assets/svg/User_profile_Icon.svg";
import GlobalApi from "../services/api/global";
import constant from "../constant/constant";
import { useMediaQuery } from "react-responsive";
import { RootState, actionCreators } from "../services/redux";

const FollowedBy = () => {
const history = useHistory();
Expand Down
10 changes: 4 additions & 6 deletions client/src/pages/Index.js → client/src/pages/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
userProfilePostAction,
followedUserPostDataAction,
userSuggestionAction,
followedByUserAction,
// followedByUserAction,
// setUserStories,
appendOnCurrentInnerUserMessage,
appendMessageOnMessageListAction,
Expand All @@ -25,10 +25,8 @@ const Index = () => {
const dispatch = useDispatch();
const history = useHistory();
const [renderMainPage, setRenderMainPage] = useState(false);
const { setUserStories, setRootUserProfileDetail } = bindActionCreators(
actionCreators,
dispatch
);
const { setUserStories, setRootUserProfileDetail, setFollowedByUser } =
bindActionCreators(actionCreators, dispatch);
useEffect(() => {
const getUserData = async () => {
try {
Expand All @@ -46,7 +44,7 @@ const Index = () => {
followedUserPostDataAction(userData.data.followedUserPost)
);
dispatch(userSuggestionAction(userData.data.userSuggestion));
dispatch(followedByUserAction(userData.data.followedBy));
setFollowedByUser(userData.data.followedBy);
setUserStories(userData.data.userStories);
setRenderMainPage(true);
}
Expand Down
6 changes: 4 additions & 2 deletions client/src/services/redux-reducer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import setCurrentUserMessageReducer from "./components/messageBox/CurrentUserMes
import mainPageInnerMessageBoxOnOff from "./components/messageBox/mainPageInnerMessageBoxOnOff";
import setUserMessageFieldReducer from "./userMessageFieldReducer";
import userSuggestionReducer from "./components/userSuggestionReducer";
import followedByUserReducer from "./components/followedByUserReducer";
// import followedByUserReducer from "./components/followedByUserReducer";
import messageListReducer from "./components/messageBox/messageListReducer";
import commentBoxReducer from "./components/commentBox";
import progressBarReducer from "./components/progressBar";
Expand All @@ -32,6 +32,7 @@ import displayEmojiPicker from "./page/home/displayEmojiPicker";
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
Expand All @@ -47,7 +48,7 @@ const rootReducers = combineReducers({
mainPageInnerMessageBoxOnOff,
setUserMessageFieldReducer,
userSuggestionReducer,
followedByUserReducer,
// followedByUserReducer,
messageListReducer,
commentBoxReducer,
progressBarReducer,
Expand All @@ -66,6 +67,7 @@ const rootReducers = combineReducers({
setUserProfileDetailReducer,
videoPageDataReducer,
userStoriesReducer,
followedByUserReducer,
});

export default rootReducers;
1 change: 1 addition & 0 deletions client/src/services/redux/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ export * from "./global/rootUserFriends/action";
export * from "./global/rootUserProfileDetail/action";
export * from "./components/commentBox/action";
export * from "./components/notificationBox/action";
export * from "./components/followedByUser/action";
export * from "./pages/video/action";
export * from "./pages/stories/action";
2 changes: 2 additions & 0 deletions client/src/services/redux/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { combineReducers } from "redux";
import setUserProfileDetailReducer from "./global/rootUserProfileDetail/reducer";
import rootUserFriendsReducer from "./global/rootUserFriends/reducer";
import commentBoxReducer from "./components/commentBox/reducer";
import followedByUserReducer from "./components/followedByUser/reducer";
import notificationBoxReducer from "./components/notificationBox/reducer";
import videoPageDataReducer from "./pages/video/reducer";
import userStoriesReducer from "./pages/stories/reducer";
Expand All @@ -13,6 +14,7 @@ const reducer = combineReducers({
notificationBoxReducer,
videoPageDataReducer,
userStoriesReducer,
followedByUserReducer,
});

export default reducer;

0 comments on commit a6b76b1

Please sign in to comment.