Add note about inline styles

pull/1/head
Daniel Gasienica 7 years ago
parent b0e1cc49a5
commit 246e0ca87b

@ -9,6 +9,7 @@
} }
.iconButton { .iconButton {
// NOTE: Cannot move these to inline styles as hover breaks due to precedence:
background: transparent; background: transparent;
width: 50px; width: 50px;
height: 50px; height: 50px;

@ -39,7 +39,7 @@ const styles = {
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
marginLeft: 10, marginLeft: 10,
} as React.CSSProperties } as React.CSSProperties,
}; };
interface IconButtonProps { interface IconButtonProps {
@ -47,11 +47,7 @@ interface IconButtonProps {
onClick?: () => void; onClick?: () => void;
} }
const IconButton = ({ onClick, type }: IconButtonProps) => ( const IconButton = ({ onClick, type }: IconButtonProps) => (
<a <a href="#" onClick={onClick} className={classNames('iconButton', type)} />
href="#"
onClick={onClick}
className={classNames('iconButton', type)}
/>
); );
export class Lightbox extends React.Component<Props, {}> { export class Lightbox extends React.Component<Props, {}> {
@ -70,7 +66,7 @@ export class Lightbox extends React.Component<Props, {}> {
return ( return (
<div style={styles.container}> <div style={styles.container}>
<div style={styles.objectContainer}> <div style={styles.objectContainer}>
{<img style={styles.image} src={imageURL} />} <img style={styles.image} src={imageURL} />
</div> </div>
<div style={styles.controls}> <div style={styles.controls}>
<IconButton type="close" onClick={this.props.close} /> <IconButton type="close" onClick={this.props.close} />
@ -86,5 +82,5 @@ export class Lightbox extends React.Component<Props, {}> {
} }
this.props.close(); this.props.close();
} };
} }

Loading…
Cancel
Save