1
0
mirror of https://github.com/uetchy/namae.git synced 2025-03-17 04:30:31 +09:00

feat: error tooltip

This commit is contained in:
uetchy 2019-08-01 13:21:34 +09:00
parent 8584881f7e
commit 536e65e10e
2 changed files with 19 additions and 1 deletions

View File

@ -17,6 +17,7 @@
"react-icons": "^3.7.0",
"react-scripts": "3.0.1",
"react-spinners": "^0.5.13",
"react-tippy": "^1.2.3",
"styled-components": "^4.3.2"
},
"browserslist": {

View File

@ -2,6 +2,9 @@ import React, { Suspense } from 'react'
import styled from 'styled-components'
import useFetch from 'fetch-suspense'
import { BarLoader } from 'react-spinners'
import { GoInfo } from 'react-icons/go'
import { Tooltip } from 'react-tippy'
import 'react-tippy/dist/tippy.css'
import { ExternalLink } from './Links'
@ -19,7 +22,21 @@ class ErrorBoundary extends React.Component {
render() {
if (this.state.hasError) {
return <h4>{this.state.message}</h4>
return (
<Tooltip
title={this.state.message}
position="bottom"
arrow={true}
animation="shift"
duration="200">
<Container>
<Cell>
<GoInfo />
<Name>Error</Name>
</Cell>
</Container>
</Tooltip>
)
}
return this.props.children
}