Skip to content

Commit

Permalink
🔀 Merge WC request loading hint
Browse files Browse the repository at this point in the history
  • Loading branch information
nwingt committed Sep 27, 2022
2 parents e2f3ab8 + 8e99e27 commit dfc532a
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/i18n/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@
"walletConnectRequestView_label_description_sessionRequest": "%{name} wants to connect",
"walletConnectRequestView_label_description_sign": "%{name} wants to sign a transaction",
"walletConnectRequestView_label_description_unknown": "%{name} wants to get approval",
"walletConnectRequestView_loading_hint": "If the request is not responding, please return to the browser and come back again.",
"Week": [
"Sun",
"Mon",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/translations/zh-Hans-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@
"walletConnectRequestView_label_description_sessionRequest": "%{name} 向 Liker Land App 发出了连接请求",
"walletConnectRequestView_label_description_sign": "%{name} 向 Liker Land App 发出了签名请求",
"walletConnectRequestView_label_description_unknown": "%{name} 向 Liker Land App 发出了请求",
"walletConnectRequestView_loading_hint": "若沒有彈出確認請求,請返回瀏覽器再回來",
"walletDashboardScreen": {
"availableBalanceLabel": "可用",
"allDelegatorRewardsLabel": "未领取收益",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/translations/zh-Hant-HK.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@
"walletConnectRequestView_label_description_sessionRequest": "%{name} 向 Liker Land App 發出了連接請求",
"walletConnectRequestView_label_description_sign": "%{name} 向 Liker Land App 發出了簽名請求",
"walletConnectRequestView_label_description_unknown": "%{name} 向 Liker Land App 發出了請求",
"walletConnectRequestView_loading_hint": "若沒有彈出確認請求,請返回瀏覽器再回來",
"walletDashboardScreen": {
"availableBalanceLabel": "可用",
"allDelegatorRewardsLabel": "未領取收益",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/translations/zh-Hant-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@
"walletConnectRequestView_label_description_sessionRequest": "%{name} 向 Liker Land App 發出了連接請求",
"walletConnectRequestView_label_description_sign": "%{name} 向 Liker Land App 發出了簽名請求",
"walletConnectRequestView_label_description_unknown": "%{name} 向 Liker Land App 發出了請求",
"walletConnectRequestView_loading_hint": "若沒有彈出確認請求,請返回瀏覽器再回來",
"walletDashboardScreen": {
"availableBalanceLabel": "可用",
"allDelegatorRewardsLabel": "未領取收益",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ const HeaderText = styled(Text)`
text-align: center;
`

const LoadingHintText = styled(Text)`
margin-top: ${({ theme }) => theme.spacing.lg};
color: ${({ theme }) => theme.color.palette.offWhite};
text-align: center;
`

export interface WalletConnectRequestScreenProps extends NavigationStackScreenProps<{
peerId: string,
peerMeta: any;
Expand All @@ -48,6 +54,23 @@ export interface WalletConnectRequestScreenProps extends NavigationStackScreenPr
@inject("walletConnectStore")
@observer
export class WalletConnectRequestScreen extends React.Component<WalletConnectRequestScreenProps, {}> {

patientTimer?: number

state = {
shouldShowLoadingHint: false,
}

componentDidMount() {
this.patientTimer = setTimeout(() => {
this.setState({ shouldShowLoadingHint: true })
}, 5000)
}

componentWillUnmount() {
clearTimeout(this.patientTimer)
}

get payload() {
return this.props.navigation.getParam("payload")
}
Expand Down Expand Up @@ -81,6 +104,9 @@ export class WalletConnectRequestScreen extends React.Component<WalletConnectReq
<LoadingView>
<LoadingLikeCoinWrapper>
<LoadingLikeCoin />
{this.state.shouldShowLoadingHint && (
<LoadingHintText tx="walletConnectRequestView_loading_hint" />
)}
</LoadingLikeCoinWrapper>
<Button
preset="outlined"
Expand Down

0 comments on commit dfc532a

Please sign in to comment.