-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
718 additions
and
514 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
{ | ||
"hooks": { | ||
"commit-msg": "yarn lint", | ||
"pre-push": "yarn test --no-watch" | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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,5 @@ | ||
.n-crypto-icon{ | ||
display: inline-block; | ||
width: 20px; | ||
height: 20px; | ||
} |
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,3 @@ | ||
export const LoadingNames = { | ||
Wallet: 'Wallet', | ||
}; |
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,4 @@ | ||
export const ModalNames = { | ||
WithdrawSubmit: 'WithdrawSubmit', | ||
WithdrawConfirmation: 'WithdrawConfirmation', | ||
}; |
8 changes: 0 additions & 8 deletions
8
src/containers/ModalWithdrawConfirmation/ModalWithdrawConfirmation.pcss
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,14 @@ | ||
@import "../../style/base.scss"; | ||
|
||
.n-base-dialog { | ||
&__content { | ||
text-align: center; | ||
} | ||
|
||
&__footer { | ||
@include children-row-margin(1em); | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
} | ||
} |
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,78 @@ | ||
import React, { useCallback, useMemo } from 'react'; | ||
import { Button } from 'react-bootstrap'; | ||
import { useDispatch } from 'react-redux'; | ||
import classNames from 'classnames'; | ||
|
||
import './index.scss'; | ||
|
||
import { generalShowDialog } from 'src/modules/general'; | ||
import { Modal } from '../../../components'; | ||
|
||
interface Props { | ||
onOk: () => void; | ||
okText?: string; | ||
cancelText?: string; | ||
hideOk?: boolean; | ||
hideCancel?: boolean; | ||
header?: string; | ||
children: React.ReactNode; | ||
name: string; | ||
} | ||
|
||
export const BaseModal: React.FC<Props> = ({ | ||
header, | ||
children, | ||
onOk, | ||
okText, | ||
cancelText, | ||
hideOk, | ||
hideCancel, | ||
name, | ||
}) => { | ||
const dispatch = useDispatch(); | ||
|
||
const handleCancel = useCallback(() => { | ||
dispatch(generalShowDialog(name, undefined)); | ||
}, [name]); | ||
|
||
const headerContent = useMemo(() => { | ||
return <div className={classNames('pg-exchange-modal-submit-header')}>{header}</div>; | ||
}, [header]); | ||
|
||
const childrenContent = useMemo(() => { | ||
return <div className={classNames('pg-exchange-modal-submit-body', 'n-base-dialog__content')}>{children}</div>; | ||
}, [children]); | ||
|
||
const footerContent = useMemo(() => { | ||
return ( | ||
<div className={classNames('pg-exchange-modal-submit-footer', 'n-base-dialog__footer')}> | ||
{hideCancel !== true ? ( | ||
<div> | ||
<Button | ||
block={true} | ||
className="btn-block mr-1 mt-1 btn-lg" | ||
onClick={handleCancel} | ||
size="lg" | ||
variant="secondary"> | ||
{cancelText} | ||
</Button> | ||
</div> | ||
) : null} | ||
{hideOk !== true ? ( | ||
<div> | ||
<Button | ||
block={true} | ||
className="btn-block mr-1 mt-1 btn-lg" | ||
onClick={onOk} | ||
size="lg" | ||
variant="primary"> | ||
{okText} | ||
</Button> | ||
</div> | ||
) : null} | ||
</div> | ||
); | ||
}, [hideOk, cancelText, hideCancel, okText, onOk]); | ||
|
||
return <Modal show={true} header={headerContent} content={childrenContent} footer={footerContent} />; | ||
}; |
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,2 @@ | ||
export * from './common'; | ||
export * from './wrapper'; |
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,13 @@ | ||
import React from 'react'; | ||
|
||
import { useReduxSelector } from 'src/hooks'; | ||
|
||
interface Props { | ||
name: string; | ||
children: (options: any) => React.ReactElement; | ||
} | ||
|
||
export const ModalWrapper: React.FC<Props> = ({ name, children }) => { | ||
const options = useReduxSelector((x) => x.general.dialog[name]); | ||
return options ? children(options) : null; | ||
}; |
Oops, something went wrong.