Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
Misc mobile fixes (#2106)
Browse files Browse the repository at this point in the history
* Fix spelling mistake

* Handle global Notification on mobile

* Decrease balance poll interval

* Run prettier

* Tweak balance poll interval
  • Loading branch information
Tom Linton authored and micahalcorn committed Apr 23, 2019
1 parent ca926c6 commit c8b031a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 30 deletions.
61 changes: 33 additions & 28 deletions dapps/marketplace/src/pages/settings/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class Settings extends Component {
render() {
const input = formInput(this.state, state => this.setState(state))
const { locale, onLocale, currency, onCurrency } = this.props
const notificationsSupported = !!window.Notification

return (
<Mutation
Expand Down Expand Up @@ -130,36 +131,40 @@ class Settings extends Component {
/>
</div>

<div className="form-group">
<label htmlFor="notifications">
<fbt desc="settings.notificationsLabel">
Notifications
</fbt>
</label>
{Notification.permission !== 'granted' ? (
<>
<div className="form-text form-text-muted">
<small>
<fbt desc="settings.notificationsHint">
Enable browser notifications below.
{notificationsSupported && (
<div className="form-group">
<label htmlFor="notifications">
<fbt desc="settings.notificationsLabel">
Browser Notifications
</fbt>
</label>
{Notification.permission !== 'granted' ? (
<>
<div className="form-text form-text-muted">
<small>
<fbt desc="settings.notificationsHint">
Enable browser notifications below.
</fbt>
</small>
</div>
<button
className="btn btn-success"
onClick={() => this.requestNotificationPermission()}
>
<fbt desc="settings.notificationsButton">
Enable
</fbt>
</small>
</button>
</>
) : (
<div>
<fbt desc="settings.notificationsSuccess">
Browser notifications are enabled.
</fbt>
</div>
<button
className="btn btn-success"
onClick={() => this.requestNotificationPermission()}
>
<fbt desc="settings.notificationsButton">Enable</fbt>
</button>
</>
) : (
<div>
<fbt desc="settings.notificationsSuccess">
Browser notifications are enabled.
</fbt>
</div>
)}
</div>
)}
</div>
)}

{/*
<div className="form-group">
Expand Down
2 changes: 1 addition & 1 deletion mobile/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const WALLET_STORE = 'WALLET_STORE'

export const ETH_NOTIFICATION_TYPES = new Enum('APN', 'FCM', 'Email')

export const BALANCE_POLL_INTERVAL = 10000
export const BALANCE_POLL_INTERVAL = 5000

export const NETWORKS = [
{ id: 1, name: 'Mainnet', dappUrl: 'https://dapp.originprotocol.com' },
Expand Down
2 changes: 1 addition & 1 deletion mobile/src/screens/fork.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ForkScreen extends Component {
/>
<Text style={styles.title}>Create Or Import A Wallet</Text>
<Text style={styles.subtitle}>
Create a new wallet and transder funds into it or import an existing
Create a new wallet and transfer funds into it or import an existing
wallet that you already use.
</Text>
</View>
Expand Down

0 comments on commit c8b031a

Please sign in to comment.