-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from eduzz/feature-add-types-in-HyperflowSuppo…
…rtChat chore: Refactor HyperflowSupportChat to use types
- Loading branch information
Showing
6 changed files
with
125 additions
and
51 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
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
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
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,46 @@ | ||
export type CurrentUser = { | ||
tag: string; | ||
belt: string; | ||
isClubeBlack: boolean; | ||
id: number; | ||
name: string; | ||
email: string; | ||
isAccessPolicy: boolean; | ||
} & ( | ||
| { | ||
isAccessPolicy: true; | ||
originalUserId: number; | ||
originalUserName: string; | ||
originalUserEmail: string; | ||
} | ||
| { isAccessPolicy: false } | ||
); | ||
|
||
export type HyperflowConfig = { | ||
chatUnityID: string; | ||
chatBlackID: string; | ||
chatEliteID: string; | ||
flowId: string; | ||
}; | ||
|
||
export type TopbarHyperflowSupportChatProps = { | ||
jwtToHyperflow: string; | ||
currentUser: CurrentUser; | ||
hyperflowConfig: HyperflowConfig; | ||
}; | ||
|
||
export type HyperflowParams = { | ||
id: number; | ||
name: string; | ||
email: string; | ||
original_id?: number; | ||
original_name?: string; | ||
original_email?: string; | ||
sender: string; | ||
}; | ||
|
||
export type SupportChatProps = { | ||
jwtToHyperflow: string; | ||
currentUser: CurrentUser; | ||
hyperflowConfig: HyperflowConfig; | ||
}; |
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 |
---|---|---|
|
@@ -37,7 +37,27 @@ function App() { | |
}} | ||
> | ||
<Topbar.UnitySupportChat /> | ||
<Topbar.HyperflowSupportChat /> | ||
<Topbar.HyperflowSupportChat | ||
currentUser={{ | ||
tag: 'unity', | ||
belt: 'Red Belt', | ||
isClubeBlack: false, | ||
id: 1, | ||
name: 'QA-ORBITA-NAO-ALTERAR-NAO-ALTERAR', | ||
email: '[email protected]', | ||
isAccessPolicy: true, | ||
originalUserId: 1, | ||
originalUserName: 'QA-ORBITA-NAO-ALTERAR-NAO-ALTERAR', | ||
originalUserEmail: '[email protected]' | ||
}} | ||
hyperflowConfig={{ | ||
chatBlackID: 'bla', | ||
chatEliteID: 'bla', | ||
chatUnityID: 'bla', | ||
flowId: 'bla' | ||
}} | ||
jwtToHyperflow='bla' | ||
/> | ||
|
||
<Topbar.Search onEnter={onSearchEnter} /> | ||
<Topbar.ModeSwitcher /> | ||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@eduzz/ui-layout", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"keywords": [ | ||
"eduzz", | ||
"react", | ||
|