Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(redux): completed ts on messageBox
fixing #109
- Loading branch information
1 parent
4df2145
commit e23a415
Showing
11 changed files
with
158 additions
and
10 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
24 changes: 24 additions & 0 deletions
24
client/src/services/redux/components/messageBox/currentUserMessage/action.ts
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { | ||
CurrentUserMessageAction, | ||
CurrentUserMessageActionTypes, | ||
CurrentUserMessageState, | ||
} from "./types"; | ||
import { Dispatch } from "react"; | ||
|
||
export const currentUserMessageAction = (data: any) => { | ||
return (dispatch: Dispatch<CurrentUserMessageAction>) => { | ||
dispatch({ | ||
type: CurrentUserMessageActionTypes.CURRENT_USER_MESSAGE, | ||
payload: data, | ||
}); | ||
}; | ||
}; | ||
|
||
export const appendOnCurrentInnerUserMessage = (data: any) => { | ||
return (dispatch: Dispatch<CurrentUserMessageAction>) => { | ||
dispatch({ | ||
type: CurrentUserMessageActionTypes.APPEND_ON_CURRENT_INNER_USER_MESSAGE, | ||
payload: data, | ||
}); | ||
}; | ||
}; |
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
25 changes: 25 additions & 0 deletions
25
client/src/services/redux/components/messageBox/currentUserMessage/types.ts
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
export interface CurrentUserMessageState { | ||
messageToId: string; | ||
messageToUserId: string; | ||
receiverPicture: string; | ||
message: []; | ||
fetchedInnerMessage: boolean; | ||
} | ||
|
||
export enum CurrentUserMessageActionTypes { | ||
CURRENT_USER_MESSAGE = "currentUserMessage", | ||
APPEND_ON_CURRENT_INNER_USER_MESSAGE = "appendOnCurrentInnerUserMessage", | ||
} | ||
|
||
export interface CurrentUserMessage { | ||
type: CurrentUserMessageActionTypes.CURRENT_USER_MESSAGE; | ||
payload: any; | ||
} | ||
export interface AppendOnCurrentInnerUserMessage { | ||
type: CurrentUserMessageActionTypes.APPEND_ON_CURRENT_INNER_USER_MESSAGE; | ||
payload: any; | ||
} | ||
|
||
export type CurrentUserMessageAction = | ||
| CurrentUserMessage | ||
| AppendOnCurrentInnerUserMessage; |
17 changes: 17 additions & 0 deletions
17
client/src/services/redux/components/messageBox/mainPageInnerMessageBoxOnOff/action.ts
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { | ||
MainPageInnerMessageBoxOnOffActionTypes, | ||
MainPageInnerMessageBoxOnOffState, | ||
MainPageMessageInnerViewOnOffAction, | ||
} from "./types"; | ||
import { Dispatch } from "react"; | ||
|
||
export const mainPageMessageInnerViewOnOff = ( | ||
data: MainPageInnerMessageBoxOnOffState | ||
) => { | ||
return (dispatch: Dispatch<MainPageMessageInnerViewOnOffAction>) => { | ||
dispatch({ | ||
type: MainPageInnerMessageBoxOnOffActionTypes.MAIN_PAGE_MESSAGE_INNER_VIEW_ON_OFF, | ||
payload: data, | ||
}); | ||
}; | ||
}; |
18 changes: 15 additions & 3 deletions
18
client/src/services/redux/components/messageBox/mainPageInnerMessageBoxOnOff/reducer.ts
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
11 changes: 11 additions & 0 deletions
11
client/src/services/redux/components/messageBox/mainPageInnerMessageBoxOnOff/types.ts
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export type MainPageInnerMessageBoxOnOffState = boolean; | ||
|
||
export enum MainPageInnerMessageBoxOnOffActionTypes { | ||
MAIN_PAGE_MESSAGE_INNER_VIEW_ON_OFF = "mainPageMessageInnerViewOnOff", | ||
} | ||
export interface MainPageMessageInnerViewOnOff { | ||
type: MainPageInnerMessageBoxOnOffActionTypes.MAIN_PAGE_MESSAGE_INNER_VIEW_ON_OFF; | ||
payload: MainPageInnerMessageBoxOnOffState; | ||
} | ||
|
||
export type MainPageMessageInnerViewOnOffAction = MainPageMessageInnerViewOnOff; |
15 changes: 15 additions & 0 deletions
15
client/src/services/redux/components/messageBox/mainPageMessageOnOff/action.ts
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { | ||
MainPageMessageOnOffActionTypes, | ||
MainPageMessageOnOffState, | ||
MainPageMessageViewOnOffAction, | ||
} from "./types"; | ||
import { Dispatch } from "react"; | ||
|
||
export const mainPageMessageViewOnOff = (data: MainPageMessageOnOffState) => { | ||
return (dispatch: Dispatch<MainPageMessageViewOnOffAction>) => { | ||
dispatch({ | ||
type: MainPageMessageOnOffActionTypes.MAIN_PAGE_MESSAGE_VIEW_ON_OFF, | ||
payload: data, | ||
}); | ||
}; | ||
}; |
18 changes: 15 additions & 3 deletions
18
client/src/services/redux/components/messageBox/mainPageMessageOnOff/reducer.ts
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
11 changes: 11 additions & 0 deletions
11
client/src/services/redux/components/messageBox/mainPageMessageOnOff/types.ts
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export type MainPageMessageOnOffState = boolean; | ||
|
||
export enum MainPageMessageOnOffActionTypes { | ||
MAIN_PAGE_MESSAGE_VIEW_ON_OFF = "MainPageMessageViewOnOf", | ||
} | ||
export interface MainPageMessageViewOnOff { | ||
type: MainPageMessageOnOffActionTypes.MAIN_PAGE_MESSAGE_VIEW_ON_OFF; | ||
payload: MainPageMessageOnOffState; | ||
} | ||
|
||
export type MainPageMessageViewOnOffAction = MainPageMessageViewOnOff; |
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