Consolidate styles

pull/1/head
Daniel Gasienica 7 years ago
parent 90329a2764
commit bfe7eb7d5e

@ -45,14 +45,7 @@ const styles = {
display: 'inline-flex', display: 'inline-flex',
justifyContent: 'center', justifyContent: 'center',
} as React.CSSProperties, } as React.CSSProperties,
image: { object: {
flexGrow: 1,
flexShrink: 0,
maxWidth: '100%',
maxHeight: '100%',
objectFit: 'contain',
} as React.CSSProperties,
video: {
flexGrow: 1, flexGrow: 1,
flexShrink: 0, flexShrink: 0,
maxWidth: '100%', maxWidth: '100%',
@ -130,7 +123,7 @@ const Icon = ({
}) => ( }) => (
<div <div
style={{ style={{
...styles.image, ...styles.object,
...colorSVG(url, Colors.ICON_SECONDARY), ...colorSVG(url, Colors.ICON_SECONDARY),
maxWidth: 200, maxWidth: 200,
}} }}
@ -204,7 +197,7 @@ export class Lightbox extends React.Component<Props, {}> {
if (isImageTypeSupported) { if (isImageTypeSupported) {
return ( return (
<img <img
style={styles.image} style={styles.object}
src={objectURL} src={objectURL}
onClick={this.onObjectClick} onClick={this.onObjectClick}
/> />
@ -214,7 +207,7 @@ export class Lightbox extends React.Component<Props, {}> {
const isVideoTypeSupported = GoogleChrome.isVideoTypeSupported(contentType); const isVideoTypeSupported = GoogleChrome.isVideoTypeSupported(contentType);
if (isVideoTypeSupported) { if (isVideoTypeSupported) {
return ( return (
<video controls={true} style={styles.video}> <video controls={true} style={styles.object}>
<source src={objectURL} /> <source src={objectURL} />
</video> </video>
); );

Loading…
Cancel
Save