import React from 'react'; import { withTranslation } from 'react-i18next'; import dateFnsFormat from 'date-fns/format'; import { withUnstatedContainers } 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: '', customExpirationDate: dateFnsFormat(new Date(), 'yyyy-MM-dd'), customExpirationTime: dateFnsFormat(new Date(), 'hh: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 customExpirationDate * @param {date} customExpirationDate */ handleChangeCustomExpirationDate(customExpirationDate) { this.setState({ customExpirationDate }); } /** * change customExpirationTime * @param {date} customExpirationTime */ handleChangeCustomExpirationTime(customExpirationTime) { this.setState({ customExpirationTime }); } handleIssueShareLink() { // use these options console.log(this.state); console.log('ηΊθ‘γγ!'); } renderExpirationTypeOptions() { const { expirationType } = this.state; return (