Skip to content

Commit

Permalink
Bugfix/example app fixes (FormidableLabs#251)
Browse files Browse the repository at this point in the history
* Use tenary in the render

* Get Latest ios package from master
  • Loading branch information
kadikraman authored Feb 18, 2019
1 parent 11581a6 commit 58c97e8
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 42 deletions.
12 changes: 8 additions & 4 deletions Example/AndroidExample/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,15 @@ export default class App extends Component<{}, State> {
)}

<ButtonContainer>
{!state.accessToken && (
{!state.accessToken ? (
<Button onPress={this.authorize} text="Authorize" color="#DA2536" />
)}
{!!state.refreshToken && <Button onPress={this.refresh} text="Refresh" color="#24C2CB" />}
{!!state.accessToken && <Button onPress={this.revoke} text="Revoke" color="#EF525B" />}
) : null}
{!!state.refreshToken ? (
<Button onPress={this.refresh} text="Refresh" color="#24C2CB" />
) : null}
{!!state.accessToken ? (
<Button onPress={this.revoke} text="Revoke" color="#EF525B" />
) : null}
</ButtonContainer>
</Page>
);
Expand Down
12 changes: 8 additions & 4 deletions Example/Latest/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,15 @@ export default class App extends Component<{}, State> {
)}

<ButtonContainer>
{!state.accessToken && (
{!state.accessToken ? (
<Button onPress={this.authorize} text="Authorize" color="#DA2536" />
)}
{!!state.refreshToken && <Button onPress={this.refresh} text="Refresh" color="#24C2CB" />}
{!!state.accessToken && <Button onPress={this.revoke} text="Revoke" color="#EF525B" />}
) : null}
{!!state.refreshToken ? (
<Button onPress={this.refresh} text="Refresh" color="#24C2CB" />
) : null}
{!!state.accessToken ? (
<Button onPress={this.revoke} text="Revoke" color="#EF525B" />
) : null}
</ButtonContainer>
</Page>
);
Expand Down
46 changes: 23 additions & 23 deletions Example/Latest/package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"name": "AppAuthExample",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.5.0",
"react-native": "0.57.0",
"react-native-app-auth": "FormidableLabs/react-native-app-auth",
"styled-components": "^3.4.9"
},
"devDependencies": {
"babel-jest": "23.6.0",
"eslint-plugin-react": "6.0.0",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.45.5",
"react-test-renderer": "16.5.0"
},
"jest": {
"preset": "react-native"
}
"name": "AppAuthExample",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.5.0",
"react-native": "0.57.0",
"react-native-app-auth": "FormidableLabs/react-native-app-auth#master",
"styled-components": "^3.4.9"
},
"devDependencies": {
"babel-jest": "23.6.0",
"eslint-plugin-react": "6.0.0",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.45.5",
"react-test-renderer": "16.5.0"
},
"jest": {
"preset": "react-native"
}
}
6 changes: 3 additions & 3 deletions Example/Latest/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4694,9 +4694,9 @@ react-is@^16.3.1, react-is@^16.5.0:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.5.2.tgz#e2a7b7c3f5d48062eb769fcb123505eb928722e3"
integrity sha512-hSl7E6l25GTjNEZATqZIuWOgSnpXb3kD0DVCujmg46K5zLxsbiKaaT6VO9slkSBDPZfYs30lwfJwbOFOnoEnKQ==

react-native-app-auth@FormidableLabs/react-native-app-auth:
version "3.1.0"
resolved "https://codeload.github.com/FormidableLabs/react-native-app-auth/tar.gz/9747213b00b0ac46449ff19fa5c720a45720e1cd"
react-native-app-auth@FormidableLabs/react-native-app-auth#master:
version "4.0.0"
resolved "https://codeload.github.com/FormidableLabs/react-native-app-auth/tar.gz/11581a6474b4a4f5b72cfbc77baf68f1a67002bd"

[email protected]:
version "0.57.0"
Expand Down
12 changes: 8 additions & 4 deletions Example/iOSCarthageExample/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,15 @@ export default class App extends Component<{}, State> {
)}

<ButtonContainer>
{!state.accessToken && (
{!state.accessToken ? (
<Button onPress={this.authorize} text="Authorize" color="#DA2536" />
)}
{!!state.refreshToken && <Button onPress={this.refresh} text="Refresh" color="#24C2CB" />}
{!!state.accessToken && <Button onPress={this.revoke} text="Revoke" color="#EF525B" />}
) : null}
{!!state.refreshToken ? (
<Button onPress={this.refresh} text="Refresh" color="#24C2CB" />
) : null}
{!!state.accessToken ? (
<Button onPress={this.revoke} text="Revoke" color="#EF525B" />
) : null}
</ButtonContainer>
</Page>
);
Expand Down
12 changes: 8 additions & 4 deletions Example/iOSPodsExample/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,15 @@ export default class App extends Component<{}, State> {
)}

<ButtonContainer>
{!state.accessToken && (
{!state.accessToken ? (
<Button onPress={this.authorize} text="Authorize" color="#DA2536" />
)}
{!!state.refreshToken && <Button onPress={this.refresh} text="Refresh" color="#24C2CB" />}
{!!state.accessToken && <Button onPress={this.revoke} text="Revoke" color="#EF525B" />}
) : null}
{!!state.refreshToken ? (
<Button onPress={this.refresh} text="Refresh" color="#24C2CB" />
) : null}
{!!state.accessToken ? (
<Button onPress={this.revoke} text="Revoke" color="#EF525B" />
) : null}
</ButtonContainer>
</Page>
);
Expand Down

0 comments on commit 58c97e8

Please sign in to comment.