mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 17:00:55 +00:00
52 lines
1.0 KiB
JavaScript
52 lines
1.0 KiB
JavaScript
![]() |
/**
|
||
|
*
|
||
|
* ImgPreviewHint
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
import React from 'react';
|
||
|
import PropTypes from 'prop-types';
|
||
|
import { FormattedMessage } from 'react-intl';
|
||
|
import cn from 'classnames';
|
||
|
|
||
|
import styles from './styles.scss';
|
||
|
|
||
|
function ImgPreviewHint(props) {
|
||
|
|
||
|
let pStyle;
|
||
|
|
||
|
switch (true) {
|
||
|
case props.showWhiteHint:
|
||
|
pStyle = { zIndex: 999, color: '#fff' };
|
||
|
break;
|
||
|
case props.displayHint:
|
||
|
pStyle = { zIndex: 4 };
|
||
|
break;
|
||
|
default:
|
||
|
pStyle = { display: 'none' };
|
||
|
}
|
||
|
|
||
|
return (
|
||
|
<p className={styles.imgPreviewHint} style={pStyle} onDragEnter={(e) => e.stopPropagation()}>
|
||
|
<FormattedMessage
|
||
|
id="app.components.ImgPreview.hint"
|
||
|
values={{
|
||
|
browse: <FormattedMessage id="app.components.ImgPreview.hint.browse">{(message) => <u>{message}</u>}</FormattedMessage>
|
||
|
}}
|
||
|
/>
|
||
|
</p>
|
||
|
);
|
||
|
}
|
||
|
|
||
|
ImgPreviewHint.defaultProps = {
|
||
|
displayHint: false,
|
||
|
showWhiteHint: false,
|
||
|
};
|
||
|
|
||
|
ImgPreviewHint.propTypes = {
|
||
|
displayHint: PropTypes.bool,
|
||
|
showWhiteHint: PropTypes.bool,
|
||
|
};
|
||
|
|
||
|
export default ImgPreviewHint;
|