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.
Merge branch 'master' into amina/feature/90115/update_jurisdiction
- Loading branch information
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.