Skip to content

Commit

Permalink
Uppercase PDF acronym following style guideline
Browse files Browse the repository at this point in the history
  • Loading branch information
aldo-expensify committed Dec 8, 2022
1 parent 83890cb commit 46f8297
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/components/PDFView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class PDFView extends Component {
};
this.onDocumentLoadSuccess = this.onDocumentLoadSuccess.bind(this);
this.initiatePasswordChallenge = this.initiatePasswordChallenge.bind(this);
this.attemptPdfLoad = this.attemptPdfLoad.bind(this);
this.attemptPDFLoad = this.attemptPDFLoad.bind(this);
this.toggleKeyboardOnSmallScreens = this.toggleKeyboardOnSmallScreens.bind(this);
}

Expand Down Expand Up @@ -84,7 +84,7 @@ class PDFView extends Component {
*
* @param {String} password Password to send via callback to react-pdf
*/
attemptPdfLoad(password) {
attemptPDFLoad(password) {
this.onPasswordCallback(password);
}

Expand Down Expand Up @@ -150,7 +150,7 @@ class PDFView extends Component {
</View>
{this.state.shouldRequestPassword && (
<PDFPasswordForm
onSubmit={this.attemptPdfLoad}
onSubmit={this.attemptPDFLoad}
onPasswordUpdated={() => this.setState({isPasswordInvalid: false})}
isPasswordInvalid={this.state.isPasswordInvalid}
shouldAutofocusPasswordField={!this.props.isSmallScreenWidth}
Expand Down
22 changes: 11 additions & 11 deletions src/components/PDFView/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ class PDFView extends Component {
super(props);
this.state = {
shouldRequestPassword: false,
shouldAttemptPdfLoad: true,
shouldAttemptPDFLoad: true,
shouldShowLoadingIndicator: true,
isPasswordInvalid: false,
failedToLoadPDF: false,
password: '',
};
this.initiatePasswordChallenge = this.initiatePasswordChallenge.bind(this);
this.attemptPdfLoadWithPassword = this.attemptPdfLoadWithPassword.bind(this);
this.finishPdfLoad = this.finishPdfLoad.bind(this);
this.attemptPDFLoadWithPassword = this.attemptPDFLoadWithPassword.bind(this);
this.finishPDFLoad = this.finishPDFLoad.bind(this);
this.handleFailureToLoadPDF = this.handleFailureToLoadPDF.bind(this);
}

Expand All @@ -56,7 +56,7 @@ class PDFView extends Component {

this.setState({
failedToLoadPDF: true,
shouldAttemptPdfLoad: false,
shouldAttemptPDFLoad: false,
});
}

Expand All @@ -74,7 +74,7 @@ class PDFView extends Component {
// Render password form, and don't render PDF and loading indicator.
this.setState({
shouldRequestPassword: true,
shouldAttemptPdfLoad: false,
shouldAttemptPDFLoad: false,
});

// The message provided by react-native-pdf doesn't indicate whether this
Expand All @@ -92,13 +92,13 @@ class PDFView extends Component {
*
* @param {String} password Password submitted via PDFPasswordForm
*/
attemptPdfLoadWithPassword(password) {
attemptPDFLoadWithPassword(password) {
// Render react-native-pdf/PDF so that it can validate the password.
// Note that at this point in the password challenge, shouldRequestPassword is true.
// Thus react-native-pdf/PDF will be rendered - but not visible.
this.setState({
password,
shouldAttemptPdfLoad: true,
shouldAttemptPDFLoad: true,
shouldShowLoadingIndicator: true,
});
}
Expand All @@ -107,7 +107,7 @@ class PDFView extends Component {
* After the PDF is successfully loaded hide PDFPasswordForm and the loading
* indicator.
*/
finishPdfLoad() {
finishPDFLoad() {
this.setState({
shouldRequestPassword: false,
shouldShowLoadingIndicator: false,
Expand Down Expand Up @@ -146,7 +146,7 @@ class PDFView extends Component {
</Text>
</View>
)}
{this.state.shouldAttemptPdfLoad && (
{this.state.shouldAttemptPDFLoad && (
<TouchableWithoutFeedback style={touchableStyles}>
<PDF
trustAllCerts={false}
Expand All @@ -155,14 +155,14 @@ class PDFView extends Component {
style={pdfStyles}
onError={this.handleFailureToLoadPDF}
password={this.state.password}
onLoadComplete={this.finishPdfLoad}
onLoadComplete={this.finishPDFLoad}
/>
</TouchableWithoutFeedback>
)}
{this.state.shouldRequestPassword && (
<KeyboardAvoidingView style={styles.flex1}>
<PDFPasswordForm
onSubmit={this.attemptPdfLoadWithPassword}
onSubmit={this.attemptPDFLoadWithPassword}
onPasswordUpdated={() => this.setState({isPasswordInvalid: false})}
isPasswordInvalid={this.state.isPasswordInvalid}
shouldShowLoadingIndicator={this.state.shouldShowLoadingIndicator}
Expand Down

0 comments on commit 46f8297

Please sign in to comment.