Skip to content

Commit

Permalink
feat(mespapiers): Add ScanResultInfo component
Browse files Browse the repository at this point in the history
This component is used to display a kind of tooltip
with an image and a text.
  • Loading branch information
Merkur39 committed May 30, 2023
1 parent 344b7e2 commit 392e02b
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/cozy-mespapiers-lib/src/assets/icons/Spike.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import cx from 'classnames'
import PropTypes from 'prop-types'
import React from 'react'

import Icon from 'cozy-ui/transpiled/react/Icon'
import { iconPropType } from 'cozy-ui/transpiled/react/Icon'
import Typography from 'cozy-ui/transpiled/react/Typography'

import Spike from '../../assets/icons/Spike.svg'
import CompositeHeaderImage from '../CompositeHeader/CompositeHeaderImage'

const ScanResultInfo = ({ icon, text, className }) => {
return (
<div
className={cx(
'u-flex u-flex-items-center u-flex-justify-center u-p-1 u-bdrs-4',
className
)}
style={{
backgroundColor: 'var(--defaultBackgroundColor)',
gap: '1rem',
position: 'relative'
}}
>
<CompositeHeaderImage icon={icon} iconSize="small" />
<Typography variant="body2">{text}</Typography>
<Icon
icon={Spike}
size={24}
style={{
position: 'absolute',
color: 'var(--defaultBackgroundColor)',
bottom: -17,
left: 0,
right: 0,
marginLeft: 'auto',
marginRight: 'auto'
}}
aria-hidden="true"
/>
</div>
)
}

ScanResultInfo.propTypes = {
icon: iconPropType,
text: PropTypes.string
}

export default ScanResultInfo

0 comments on commit 392e02b

Please sign in to comment.