1
1
import React from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
3
4
- import { Box , Button , Icon , Typography } from '@material-ui/core' ;
4
+ import { Box , Button , Typography } from '@material-ui/core' ;
5
5
6
- import { SampleContainer } from './styles' ;
6
+ import {
7
+ SampleContainer ,
8
+ ArticleErrorResultIconContainer ,
9
+ ArticleErrorResultIcon ,
10
+ ArticleErrorResultMessageContainer ,
11
+ } from './styles' ;
7
12
8
13
const ErrorResult = ( props ) => {
9
- const { visible} = props ;
14
+ const { visible, message } = props ;
10
15
11
16
return (
12
17
< SampleContainer item xs = { 12 } visible = { visible . toString ( ) } >
@@ -25,20 +30,14 @@ const ErrorResult = (props) => {
25
30
m = { 2 }
26
31
>
27
32
< Box display = "flex" alignItems = "center" flexWrap = "wrap" >
28
- < Box
29
- display = "flex"
30
- justifyContent = "center"
31
- alignItems = "center"
32
- className = "error-icon-area"
33
- >
34
- < Icon color = "primary" className = "error-icon" > healing</ Icon >
35
- </ Box >
36
- < Box display = "flex" justifyContent = "center" alignItems = "center" >
37
- < Typography component = "h2" variant = "h4" >
38
- Ops! ocorreu um erro ao buscar nossos artigos.
39
- Já tentou atualizar a página?
33
+ < ArticleErrorResultIconContainer >
34
+ < ArticleErrorResultIcon color = "primary" > healing</ ArticleErrorResultIcon >
35
+ </ ArticleErrorResultIconContainer >
36
+ < ArticleErrorResultMessageContainer >
37
+ < Typography component = "h2" variant = "h5" >
38
+ { message }
40
39
</ Typography >
41
- </ Box >
40
+ </ ArticleErrorResultMessageContainer >
42
41
</ Box >
43
42
< Box display = "flex" flexDirection = "column" width = "100%" mt = { 3 } >
44
43
< Button
@@ -57,7 +56,7 @@ const ErrorResult = (props) => {
57
56
variant = "contained"
58
57
onClick = { ( ) => window . location . href = '/sobre#contact' }
59
58
>
60
- Reportar bug
59
+ Fale conosco
61
60
</ Button >
62
61
</ Box >
63
62
</ Box >
@@ -68,10 +67,13 @@ const ErrorResult = (props) => {
68
67
69
68
ErrorResult . propTypes = {
70
69
visible : PropTypes . bool ,
70
+ message : PropTypes . string ,
71
71
} ;
72
72
73
- ErrorResult . defaultProp = {
73
+ ErrorResult . defaultProps = {
74
74
visible : false ,
75
+ message : `Ops! ocorreu um erro ao buscar nossos artigos.
76
+ Já tentou atualizar a página?` ,
75
77
} ;
76
78
77
79
export default ErrorResult ;
0 commit comments