forked from binary-com/deriv-app
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Aum/wall 228/crypto cashier changes for third party processor coinspa…
…id (binary-com#8343) * feat: Tooltip for crypto transactions processed by third-party payement processors * feat: Added popup note for mobile view for third-party payment tooltip * feat: added alert banner component in cashier package * feat: added IcAlertWarningDark icon * chore: working on test cases 1 * chore: reseting testcase to upstream/master * chore: added test case for tooltip in desktop mode * feat: AlertBanner for cryptoc with minimum deposit using third-party processor (CoinsPaid) * feat: changed styles for crypto-deposit.tsx * chore: added data-testid for tooltip in mobile view * chore: added test cases for crypto-deposit.tsx * chore: added test cases for crypto-deposit.tsx * fix: fixed the test cases for crypto-deposit.tsx * chore: made changes based on comments in PR * chore: fixing changes suggested by @heorhi-deriv * chore: updated alert-banner.tsx * refactor: changed the way localization is handled by alert-banner.tsx * chore: minor fixes * chore: removed unused classnames * chore: add test cases and made changes suggested by @nijil-deriv * chore: made changes for the comments in PR * Update packages/cashier/src/components/alert-banner/__tests__/alert-banner.spec.tsx Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com> --------- Co-authored-by: Farzin Mirzaie <72082844+farzin-deriv@users.noreply.github.com>
- Loading branch information
1 parent
385f36d
commit 28ad069
Showing
12 changed files
with
291 additions
and
38 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
packages/cashier/src/components/alert-banner/__tests__/alert-banner.spec.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,16 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import AlertBanner from '../alert-banner'; | ||
|
||
describe('<AlertBanner />', () => { | ||
it('should render the icon and message props passed for the banner', () => { | ||
const props: React.ComponentProps<typeof AlertBanner> = { | ||
icon: 'IcAlertWarningDark', | ||
message: 'Alert banner test message.', | ||
}; | ||
render(<AlertBanner {...props} />); | ||
const dt_alert_banner_icon = screen.getByTestId('dt_alert_banner_icon'); | ||
expect(dt_alert_banner_icon).toBeInTheDocument(); | ||
expect(screen.getByText(props.message)).toBeInTheDocument(); | ||
}); | ||
}); |
13 changes: 13 additions & 0 deletions
13
packages/cashier/src/components/alert-banner/alert-banner.scss
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 @@ | ||
.alert-banner { | ||
display: grid; | ||
grid-template-columns: auto auto; | ||
width: auto; | ||
padding: 0.8rem; | ||
margin: 2.4rem 0; | ||
border-radius: $BORDER_RADIUS; | ||
background-color: $alpha-color-yellow-1; | ||
|
||
svg { | ||
margin: 0.3rem 0.3rem 0 0; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
packages/cashier/src/components/alert-banner/alert-banner.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,23 @@ | ||
import React from 'react'; | ||
import classNames from 'classnames'; | ||
import { Icon, Text } from '@deriv/components'; | ||
import './alert-banner.scss'; | ||
|
||
type TAlertBanner = { | ||
className?: string; | ||
icon: string; | ||
message: string; | ||
}; | ||
|
||
const AlertBanner = ({ className, icon, message }: TAlertBanner) => { | ||
return ( | ||
<div className={classNames('alert-banner', className)}> | ||
<Icon size={16} icon={icon} data_testid='dt_alert_banner_icon' /> | ||
<Text as='p' align='center' size='xs'> | ||
{message} | ||
</Text> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AlertBanner; |
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
Oops, something went wrong.