Add shouldShowSaveAsButton
option
This commit is contained in:
parent
0d676a65b8
commit
a7ed21a811
1 changed files with 6 additions and 1 deletions
|
@ -13,6 +13,7 @@ interface Props {
|
||||||
onSave: () => void;
|
onSave: () => void;
|
||||||
shouldShowNextButton: boolean;
|
shouldShowNextButton: boolean;
|
||||||
shouldShowPreviousButton: boolean;
|
shouldShowPreviousButton: boolean;
|
||||||
|
shouldShowSaveAsButton: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = {
|
const styles = {
|
||||||
|
@ -61,6 +62,7 @@ export class Lightbox extends React.Component<Props, {}> {
|
||||||
public static defaultProps: Partial<Props> = {
|
public static defaultProps: Partial<Props> = {
|
||||||
shouldShowNextButton: false,
|
shouldShowNextButton: false,
|
||||||
shouldShowPreviousButton: false,
|
shouldShowPreviousButton: false,
|
||||||
|
shouldShowSaveAsButton: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
public componentDidMount() {
|
public componentDidMount() {
|
||||||
|
@ -78,6 +80,7 @@ export class Lightbox extends React.Component<Props, {}> {
|
||||||
imageURL,
|
imageURL,
|
||||||
shouldShowNextButton,
|
shouldShowNextButton,
|
||||||
shouldShowPreviousButton,
|
shouldShowPreviousButton,
|
||||||
|
shouldShowSaveAsButton,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
@ -94,7 +97,9 @@ export class Lightbox extends React.Component<Props, {}> {
|
||||||
</div>
|
</div>
|
||||||
<div style={styles.controls}>
|
<div style={styles.controls}>
|
||||||
<IconButton type="close" onClick={this.onClose} />
|
<IconButton type="close" onClick={this.onClose} />
|
||||||
<IconButton type="save" onClick={this.props.onSave} />
|
{shouldShowSaveAsButton ? (
|
||||||
|
<IconButton type="save" onClick={this.props.onSave} />
|
||||||
|
) : null}
|
||||||
{shouldShowPreviousButton ? (
|
{shouldShowPreviousButton ? (
|
||||||
<IconButton type="previous" onClick={this.props.onPrevious} />
|
<IconButton type="previous" onClick={this.props.onPrevious} />
|
||||||
) : null}
|
) : null}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue