1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-07-18 17:22:05 +00:00
seahub/frontend/src/components/shared-link.js
杨顺强 ccab6f1552
Update react version 3 (#7453)
* update react version

* update reactstrap

* optimize code

* update react-select version

* update react-responsive

* update react-chartjs version

* update qrocde version

* update seafile-editor version

* update tldraw editor version

* fix code bug
2025-02-14 14:04:25 +08:00

35 lines
1011 B
JavaScript

import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { Button, Input, InputGroup } 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} />
<Button color="primary" onClick={copyLink} className="border-0">{gettext('Copy')}</Button>
</InputGroup>
<ButtonQR link={link} />
</div>
{linkExpired && <p className="err-message mt-1">({gettext('Expired')})</p>}
</Fragment>
);
}
}
SharedLink.propTypes = propTypes;
export default SharedLink;