This repository has been archived by the owner on Jul 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: failed fetch data state and logic
- Loading branch information
1 parent
89e8671
commit ffbe973
Showing
9 changed files
with
105 additions
and
14 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
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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
import RobustWebSocket from 'robust-websocket'; | ||
import {CONNECTION_TIMEOUT} from 'v2/constants'; | ||
|
||
import * as EndpointConfig from '../../EndpointConfig'; | ||
|
||
export const initSocket = () => { | ||
return new RobustWebSocket(EndpointConfig.getApiWebsocketUrl()); | ||
return new RobustWebSocket(EndpointConfig.getApiWebsocketUrl(), null, { | ||
timeout: CONNECTION_TIMEOUT, | ||
}); | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import {Typography} from '@material-ui/core'; | ||
import React from 'react'; | ||
import {ReactComponent as WarnIcon} from 'v2/assets/icons/warn.svg'; | ||
|
||
import useStyles from './styles'; | ||
|
||
const FailedPanel = () => { | ||
const classes = useStyles(); | ||
return ( | ||
<div className={classes.root}> | ||
<div className={classes.body}> | ||
<WarnIcon fill="#f71ef4" /> | ||
<Typography className={classes.text}> | ||
Data currently unavailable. Report issues on{' '} | ||
<a | ||
href="https://github.com/solana-labs/networkexplorer/issues" | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
> | ||
Github | ||
</a> | ||
</Typography> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default FailedPanel; |
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,26 @@ | ||
import {makeStyles} from '@material-ui/core'; | ||
import getColor from 'v2/utils/getColor'; | ||
|
||
export default makeStyles(theme => ({ | ||
root: { | ||
paddingTop: 50, | ||
marginBottom: 'auto', | ||
}, | ||
body: { | ||
backgroundColor: getColor('grey')(theme), | ||
padding: 15, | ||
textTransform: 'uppercase', | ||
display: 'flex', | ||
alignItems: 'center', | ||
color: getColor('pink')(theme), | ||
'& svg': { | ||
marginRight: 15, | ||
}, | ||
}, | ||
text: { | ||
fontWeight: 'bold', | ||
'& a': { | ||
color: getColor('main')(theme), | ||
}, | ||
}, | ||
})); |
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