Skip to content

Commit a347b0e

Browse files
committed
feat: improved UX with a reset button
1 parent 1abc0dd commit a347b0e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Components/Results.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { FaCompass, FaBriefcase, FaUsers, FaUserFriends, FaUser } from 'react-ic
99
import Card from './Card'
1010
import Loading from './Loading'
1111
import Tooltip from './Tooltip'
12+
import { Fragment } from 'react/cjs/react.production.min'
1213

1314
function ProfileList ({ profile }){
1415
return(
@@ -79,14 +80,23 @@ export default class Results extends React.Component {
7980

8081
render() {
8182
const { winner, loser, error, loading } = this.state
83+
const { onReset } = this.props
8284

8385
if(loading === true){
8486
return <Loading text='Battling' />
8587
}
8688

8789
if(error){
8890
return (
89-
<p className='center-text error'>{error}</p>
91+
<Fragment>
92+
<p className='center-text error'>{error}</p>
93+
<Link
94+
className='btn light-btn btn-space'
95+
to='/battle'
96+
>
97+
Reset
98+
</Link>
99+
</Fragment>
90100
)
91101
}
92102

0 commit comments

Comments
 (0)