From b91a2155dbf961bc42adc46b0fe4288baad44adb Mon Sep 17 00:00:00 2001 From: David Frenkiel Date: Thu, 19 May 2022 08:19:07 -1000 Subject: [PATCH 001/101] feat: added pdf password form for web --- src/components/PDFView/PDFPasswordForm.js | 68 ++++++++++++++++ src/components/PDFView/index.js | 95 +++++++++++++++++------ src/languages/en.js | 1 + src/languages/es.js | 1 + src/styles/styles.js | 6 ++ 5 files changed, 147 insertions(+), 24 deletions(-) create mode 100644 src/components/PDFView/PDFPasswordForm.js diff --git a/src/components/PDFView/PDFPasswordForm.js b/src/components/PDFView/PDFPasswordForm.js new file mode 100644 index 000000000000..d1185ec18370 --- /dev/null +++ b/src/components/PDFView/PDFPasswordForm.js @@ -0,0 +1,68 @@ +import React, {PureComponent, memo} from 'react'; +import {View} from 'react-native'; +import Button from '../Button'; +import Text from '../Text'; +import TextInput from '../TextInput'; +import styles from '../../styles/styles'; +import withLocalize, {withLocalizePropTypes} from '../withLocalize'; +import compose from '../../libs/compose'; + +const propTypes = { + ...withLocalizePropTypes, +}; + +class PDFPasswordForm extends PureComponent { + constructor(props) { + super(props); + this.state = { + password: null, + }; + } + + onSubmit = () => { + // console.debug("on submit - password is", this.state.password) + this.props.onSubmit(this.state.password); + } + + render() { + return ( + + + + {this.props.translate('attachmentView.pdfPasswordRequired')} + + + this.setState({password})} + returnKeyType="done" + onSubmitEditing={this.onSubmit} + secureTextEntry + autoFocus + /> + +