1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 12:29:06 +01:00
metamask-extension/ui/components/component-library/banner-tip/banner-tip.js
George Marshall 5d17f86e02
Update Text import paths: component library/ (#19987)
* Updating component-librar import paths

* Updating snapshots

* Updates to AvatarBase story

* Updates to avatar and checkbox

* Updating last of the deprecated import paths

* Updating component-library snapshots from button-base

* Updating snapshots from rest of codebase to do with button-base

* Removing unneeded CSS

* Updating snapshots
2023-07-17 14:00:16 -07:00

77 lines
1.9 KiB
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import {
AlignItems,
BorderColor,
DISPLAY,
} from '../../../helpers/constants/design-system';
import Box from '../../ui/box';
import { BannerBase } from '..';
import { BannerTipLogoType } from './banner-tip.constants';
export const BannerTip = ({
children,
className,
logoType = BannerTipLogoType.Greeting,
logoWrapperProps,
logoProps,
startAccessory,
...props
}) => {
return (
<BannerBase
startAccessory={
startAccessory || (
<Box
display={DISPLAY.FLEX}
alignItems={AlignItems.center}
{...logoWrapperProps}
>
<Box
as="img"
className="mm-banner-tip--logo"
src={`images/fox-${logoType}.png`}
alt={logoType}
{...logoProps}
/>
</Box>
)
}
borderColor={BorderColor.borderDefault}
className={classnames('mm-banner-tip', className)}
{...props}
>
{children}
</BannerBase>
);
};
BannerTip.propTypes = {
/**
* An additional className to apply to the Banner
*/
className: PropTypes.string,
/**
* Use the `logoType` prop with the `BannerTipLogoType` enum from `../../component-library` to change the logo image of `BannerTip`.
* Possible options: `BannerTipLogoType.Greeting`(Default), `BannerTipLogoType.Chat`,
*/
logoType: PropTypes.oneOf(Object.values(BannerTipLogoType)),
/**
* logoProps accepts all the props from Box
*/
logoProps: PropTypes.object,
/**
* logoWrapperProps accepts all the props from Box
*/
logoWrapperProps: PropTypes.object,
/**
* The start(defualt left) content area of BannerBase
*/
startAccessory: PropTypes.node,
/**
* BannerTip accepts all the props from BannerBase
*/
...BannerBase.propTypes,
};