-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(solana): error popup shows whenever an error occurs to prevent i…
…nfinite loading (#3062)
- Loading branch information
1 parent
458b256
commit 47465d3
Showing
12 changed files
with
172 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<div class="error-network-container"> | ||
<div class="modal-body"> | ||
<div class="custom-modal-content"> | ||
<img src="~/assets/svg/mascot/sad_curious.svg" class="mascot" /> | ||
<TypographyTitle :text="$t('popups.error_network.title')" class="title" /> | ||
<TypographyText | ||
:text="$t('popups.error_network.subtitle')" | ||
:size="6" | ||
class="subtitle" | ||
/> | ||
<InteractablesButton type="primary" class="action" :action="tryAgain"> | ||
<refresh-cw-icon size="1.5x" /> | ||
<TypographyText | ||
:text="$t('popups.error_network.action')" | ||
:size="6" | ||
class="text" | ||
/> | ||
</InteractablesButton> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
.error-network-container { | ||
&:extend(.modal-gradient); | ||
padding: 1rem; | ||
|
||
.modal-body { | ||
.custom-modal-content { | ||
padding: 0 1rem; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
|
||
.title { | ||
font-size: 1.9rem; | ||
color: @secondary-text; | ||
margin-top: 2rem; | ||
text-align: center; | ||
} | ||
|
||
.subtitle { | ||
color: @secondary-text; | ||
margin-top: 0.5rem; | ||
} | ||
|
||
.mascot { | ||
width: 15rem; | ||
height: 15rem; | ||
} | ||
|
||
.action { | ||
width: 100%; | ||
|
||
.text { | ||
margin: 0 0.5rem; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
@media only screen and (min-width: @mobile-breakpoint) { | ||
.error-network-container { | ||
max-width: 550px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<template src="./ErrorNetwork.html" /> | ||
|
||
<script> | ||
import Vue from 'vue' | ||
import { mapState } from 'vuex' | ||
import { throttle } from 'lodash' | ||
import { RefreshCwIcon } from 'satellite-lucide-icons' | ||
import { Config } from '~/config' | ||
/** | ||
* @component Error | ||
* @description Component that takes an error message to display including source and extra details. | ||
* setTimeout prop is a bool that if true will auto close the modal after 5 seconds | ||
* @example | ||
*/ | ||
export default Vue.extend({ | ||
name: 'ErrorNetwork', | ||
components: { | ||
RefreshCwIcon, | ||
}, | ||
watch: { | ||
$route(to, from) { | ||
if (to !== from) { | ||
this.closeNetworkErrorPopup() | ||
} | ||
}, | ||
}, | ||
methods: { | ||
/** | ||
* @method toggleNetworkErrorPopup | ||
* @description | ||
* @example | ||
*/ | ||
closeNetworkErrorPopup() { | ||
this.$store.commit('ui/toggleErrorNetworkModal', { | ||
state: false, | ||
action: null, | ||
}) | ||
}, | ||
/** | ||
* @method tryAgain | ||
* @description | ||
* @example | ||
*/ | ||
tryAgain: throttle(function () { | ||
this.$store.state.ui.modals.errorNetwork.action() | ||
this.closeNetworkErrorPopup() | ||
}, Config.modal.errorNetworkActionThrottle), | ||
}, | ||
}) | ||
</script> | ||
|
||
<!-- Add "scoped" attribute to limit CSS to this component only --> | ||
<style scoped lang="less" src="./ErrorNetwork.less"></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters