bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/presentation/slide/component.jsx

44 lines
1.1 KiB
React
Raw Normal View History

import React from 'react';
import PropTypes from 'prop-types';
2018-04-16 23:37:11 +08:00
const Slide = ({ imageUri, svgWidth, svgHeight }) => (
<g>
{imageUri
// some pdfs lose a white background color during the conversion to svg
// their background color is transparent
// that's why we have a white rectangle covering the whole slide area by default
? (
<g>
<rect
x="0"
y="0"
width={svgWidth}
height={svgHeight}
fill="white"
/>
<image
x="0"
y="0"
width={svgWidth}
height={svgHeight}
xlinkHref={imageUri}
strokeWidth="0.8"
style={{ WebkitTapHighlightColor: 'transparent' }}
/>
</g>
)
: null}
</g>
);
2017-07-25 01:50:44 +08:00
Slide.propTypes = {
// Image Uri
imageUri: PropTypes.string.isRequired,
// Width of the slide (Svg coordinate system)
svgWidth: PropTypes.number.isRequired,
// Height of the slide (Svg coordinate system)
svgHeight: PropTypes.number.isRequired,
};
2017-07-25 01:50:44 +08:00
export default Slide;