import React from 'react'; import { withTranslation } from 'react-i18next'; import dateFnsFormat from 'date-fns/format'; import { createSubscribedElement } from './UnstatedUtils'; import AppContainer from '../services/AppContainer'; import PageContainer from '../services/PageContainer'; class ShareLinkForm extends React.Component { constructor(props) { super(props); this.state = { expirationType: 'unlimited', numberOfDays: 7, description: '', customExpiration: dateFnsFormat(new Date(), 'yyyy-MM-ddThh:mm:s'), }; this.handleChangeExpirationType = this.handleChangeExpirationType.bind(this); this.handleChangeNumberOfDays = this.handleChangeNumberOfDays.bind(this); this.handleChangeDescription = this.handleChangeDescription.bind(this); this.handleIssueShareLink = this.handleIssueShareLink.bind(this); } /** * change expirationType * @param {string} expirationType */ handleChangeExpirationType(expirationType) { this.setState({ expirationType }); } /** * change numberOfDays * @param {number} numberOfDays */ handleChangeNumberOfDays(numberOfDays) { this.setState({ numberOfDays }); } /** * change description * @param {string} description */ handleChangeDescription(description) { this.setState({ description }); } /** * change customExpiration * @param {date} customExpiration */ handleChangeCustomExpiration(customExpiration) { this.setState({ customExpiration }); } handleIssueShareLink() { // use these options console.log(this.state); console.log('ηΊθ‘γγ!'); } renderExpirationTypeOptions() { const { expirationType } = this.state; return (