forked from binary-com/deriv-app
-
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 #33 from suisin-deriv/suisin/76916/ts_migration_po…
…pup_component Suisin/refactor: ts migration for Popup component
- Loading branch information
Showing
11 changed files
with
109 additions
and
89 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
.../components/src/components/popup/index.js → .../components/src/components/popup/index.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import Popup from './popup.jsx'; | ||
import Popup from './popup'; | ||
import './popup.scss'; | ||
|
||
export default Popup; |
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 was deleted.
Oops, something went wrong.
55 changes: 55 additions & 0 deletions
55
packages/components/src/components/popup/popup-context.tsx
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,55 @@ | ||
import React from 'react'; | ||
|
||
export type TDetail = { | ||
id?: string; | ||
icon?: string; | ||
has_footer_separator: boolean; | ||
renderBody?: React.ElementType; | ||
renderFooter?: React.ElementType; | ||
title?: string; | ||
}; | ||
|
||
export type TPopupContext = { | ||
active_tab_icon_color: string; | ||
balance: number | string; | ||
Component: React.ElementType; | ||
currency: string; | ||
close_icon_color: string; | ||
header_background_color: string; | ||
header_big_text: string; | ||
header_banner_text: string; | ||
header_button_text: string; | ||
header_contents_color?: string; | ||
header_content_color?: string; | ||
header_icon: string; | ||
is_overlay_shown: boolean; | ||
onHeaderButtonClick?: () => void; | ||
overlay_ref?: HTMLDivElement | null; | ||
setIsOverlayShown?: React.Dispatch<React.SetStateAction<boolean>>; | ||
should_show_popup: boolean; | ||
tab_icon_color: string; | ||
tabs_detail: TDetail[]; | ||
title: string; | ||
togglePopupModal?: () => void; | ||
}; | ||
|
||
const PopupContext = React.createContext<TPopupContext>({ | ||
active_tab_icon_color: '', | ||
balance: '', | ||
currency: '', | ||
close_icon_color: '', | ||
header_background_color: '', | ||
header_big_text: '', | ||
header_banner_text: '', | ||
header_button_text: '', | ||
header_content_color: '', | ||
header_icon: '', | ||
is_overlay_shown: false, | ||
should_show_popup: false, | ||
title: '', | ||
tab_icon_color: '', | ||
tabs_detail: [{ has_footer_separator: false }], | ||
Component: 'symbol', | ||
}); | ||
|
||
export default PopupContext; |
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
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