2022-09-19 17:00:57 +02:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
2022-10-13 01:07:28 +02:00
|
|
|
import classnames from 'classnames';
|
2022-09-19 17:00:57 +02:00
|
|
|
import Button from '../../ui/button';
|
|
|
|
import Box from '../../ui/box';
|
|
|
|
import Typography from '../../ui/typography';
|
2022-10-13 01:07:28 +02:00
|
|
|
import {
|
|
|
|
ALIGN_ITEMS,
|
|
|
|
DISPLAY,
|
|
|
|
FLEX_WRAP,
|
|
|
|
BLOCK_SIZES,
|
|
|
|
JUSTIFY_CONTENT,
|
|
|
|
} from '../../../helpers/constants/design-system';
|
2022-09-19 17:00:57 +02:00
|
|
|
|
|
|
|
const OnRampItem = ({
|
2022-10-13 01:07:28 +02:00
|
|
|
className,
|
2022-09-19 17:00:57 +02:00
|
|
|
logo,
|
|
|
|
title,
|
|
|
|
text,
|
|
|
|
buttonLabel,
|
|
|
|
onButtonClick,
|
|
|
|
hide = false,
|
|
|
|
}) => {
|
|
|
|
if (hide) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
return (
|
2022-10-13 01:07:28 +02:00
|
|
|
<Box
|
|
|
|
className={classnames('deposit-popover__on-ramp-item', className)}
|
|
|
|
as="li"
|
|
|
|
marginRight={6}
|
|
|
|
marginLeft={6}
|
|
|
|
>
|
2022-09-19 17:00:57 +02:00
|
|
|
<Box
|
|
|
|
paddingTop={6}
|
|
|
|
paddingBottom={6}
|
2022-10-13 01:07:28 +02:00
|
|
|
display={DISPLAY.FLEX}
|
|
|
|
alignItems={ALIGN_ITEMS.CENTER}
|
|
|
|
flexWrap={FLEX_WRAP.WRAP}
|
2022-09-19 17:00:57 +02:00
|
|
|
>
|
2022-10-13 01:07:28 +02:00
|
|
|
<Box
|
|
|
|
width={[BLOCK_SIZES.HALF, BLOCK_SIZES.HALF, BLOCK_SIZES.ONE_FIFTH]}
|
|
|
|
display={DISPLAY.FLEX}
|
|
|
|
justifyContent={[
|
|
|
|
JUSTIFY_CONTENT.FLEX_START,
|
|
|
|
JUSTIFY_CONTENT.FLEX_START,
|
|
|
|
JUSTIFY_CONTENT.CENTER,
|
|
|
|
]}
|
|
|
|
paddingLeft={[0, 0, 4]}
|
|
|
|
paddingRight={[0, 0, 4]}
|
|
|
|
paddingBottom={[2, 0]}
|
2022-09-19 17:00:57 +02:00
|
|
|
>
|
2022-10-13 01:07:28 +02:00
|
|
|
{logo}
|
|
|
|
</Box>
|
|
|
|
<Box
|
|
|
|
width={[BLOCK_SIZES.FULL, BLOCK_SIZES.FULL, BLOCK_SIZES.TWO_FIFTHS]}
|
|
|
|
paddingLeft={[0, 0, 4]}
|
|
|
|
paddingRight={[0, 0, 4]}
|
|
|
|
paddingBottom={[2, 0]}
|
|
|
|
>
|
|
|
|
<Typography variant="h6" fontWeight="bold">
|
|
|
|
{title}
|
|
|
|
</Typography>
|
|
|
|
<Typography>{text}</Typography>
|
|
|
|
</Box>
|
|
|
|
<Box
|
|
|
|
paddingLeft={[0, 0, 4]}
|
|
|
|
paddingRight={[0, 0, 4]}
|
|
|
|
width={[BLOCK_SIZES.FULL, BLOCK_SIZES.FULL, BLOCK_SIZES.TWO_FIFTHS]}
|
|
|
|
paddingBottom={[2, 0]}
|
2022-09-19 17:00:57 +02:00
|
|
|
>
|
|
|
|
<Button type="secondary" onClick={onButtonClick}>
|
|
|
|
{buttonLabel}
|
|
|
|
</Button>
|
|
|
|
</Box>
|
|
|
|
</Box>
|
|
|
|
</Box>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
OnRampItem.propTypes = {
|
2022-10-13 01:07:28 +02:00
|
|
|
className: PropTypes.string,
|
2022-09-19 17:00:57 +02:00
|
|
|
logo: PropTypes.node.isRequired,
|
|
|
|
title: PropTypes.string.isRequired,
|
|
|
|
text: PropTypes.string.isRequired,
|
|
|
|
buttonLabel: PropTypes.string.isRequired,
|
|
|
|
onButtonClick: PropTypes.func.isRequired,
|
|
|
|
hide: PropTypes.bool,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default OnRampItem;
|