1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-07 01:41:39 +00:00

[share dialog] added QR code for share/upload links (#4798)

This commit is contained in:
llj
2021-01-22 18:18:13 +08:00
committed by GitHub
parent 1ef0ca804a
commit 45afd8c323
13 changed files with 125 additions and 23 deletions

View File

@@ -0,0 +1,36 @@
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { Button, Input, InputGroup, InputGroupAddon } from 'reactstrap';
import { gettext } from '../utils/constants';
import ButtonQR from './btn-qr-code';
const propTypes = {
link: PropTypes.string.isRequired,
linkExpired: PropTypes.bool.isRequired,
copyLink: PropTypes.func.isRequired
};
// for 'share link' & 'upload link'
class SharedLink extends React.Component {
render() {
const { link, linkExpired, copyLink } = this.props;
return (
<Fragment>
<div className="d-flex">
<InputGroup>
<Input type="text" readOnly={true} value={link} />
<InputGroupAddon addonType="append">
<Button color="primary" onClick={copyLink} className="border-0">{gettext('Copy')}</Button>
</InputGroupAddon>
</InputGroup>
<ButtonQR link={link} />
</div>
{linkExpired && <p className="err-message mt-1">({gettext('Expired')})</p>}
</Fragment>
);
}
}
SharedLink.propTypes = propTypes;
export default SharedLink;