@@ -26,7 +26,11 @@ interface IStateProps {
2626interface IDispatchProps { }
2727interface IOwnProps { }
2828
29- interface IProps extends IStateProps , IDispatchProps , IOwnProps , RouteComponentProps < any > { }
29+ interface IProps
30+ extends IStateProps ,
31+ IDispatchProps ,
32+ IOwnProps ,
33+ RouteComponentProps < any > { }
3034
3135class App extends React . Component < IProps > {
3236private renderContent ( ) {
@@ -35,28 +39,24 @@ class App extends React.Component<IProps> {
3539}
3640
3741switch ( this . props . lastApiHttpCode ) {
38- case 403 :
39- const isNotAuthorizedCode = this . props . lastApiErrorCode === "NOT_AUTHORIZED" ;
40- if ( this . props . currentUser && isNotAuthorizedCode ) {
41- return this . renderRevokedAccessTokenError ( ) ;
42- }
43-
44- if ( isNotAuthorizedCode ) {
45- return this . renderNotAuthorizedError ( ) ;
46- }
42+ case 403 :
43+ const isNotAuthorizedCode =
44+ this . props . lastApiErrorCode === "NOT_AUTHORIZED" ;
45+ if ( this . props . currentUser && isNotAuthorizedCode ) {
46+ return this . renderRevokedAccessTokenError ( ) ;
47+ }
48+
49+ if ( isNotAuthorizedCode ) {
50+ return this . renderNotAuthorizedError ( ) ;
51+ }
4752}
4853
4954return this . props . children ;
5055}
5156
5257private renderCustomAlert ( header :string , description :string ) :JSX . Element {
5358return (
54- < Alert
55- message = { header }
56- description = { description }
57- type = "error"
58- showIcon
59- />
59+ < Alert message = { header } description = { description } type = "error" showIcon />
6060) ;
6161}
6262
@@ -110,42 +110,56 @@ class App extends React.Component<IProps> {
110110
111111public render ( ) {
112112return (
113- < >
114- < Helmet >
115- < meta property = "og:locale" content = "en_US" />
116- < meta property = "og:site_name" content = "golangci.com" />
117- < meta
118- property = "og:url"
119- content = { `${ HOST } ${ this . props . location . pathname } ${ this . props . location . search } ` }
120- />
121- < meta charSet = "utf-8" />
122- < meta http-equiv = "X-UA-Compatible" content = "IE=edge" />
123- < meta name = "viewport" content = "width=device-width, initial-scale=1.0" />
124- </ Helmet >
125-
126- < Layout className = "layout" >
127- < Header />
128- < Layout . Content className = "content" >
129- < Alert
130- message = { `We are closing` }
131- description = { < > The service will stop working on 15-th of April, 2020. See< a href = "https://medium.com/golangci/golangci-com-is-closing-d1fc1bd30e0e" > the blog post</ a > .</ > }
132- type = "warning"
133- showIcon
113+ < >
114+ < Helmet >
115+ < meta property = "og:locale" content = "en_US" />
116+ < meta property = "og:site_name" content = "golangci.com" />
117+ < meta
118+ property = "og:url"
119+ content = { `${ HOST } ${ this . props . location . pathname } ${
120+ this . props . location . search
121+ } `}
122+ />
123+ < meta charSet = "utf-8" />
124+ < meta http-equiv = "X-UA-Compatible" content = "IE=edge" />
125+ < meta
126+ name = "viewport"
127+ content = "width=device-width, initial-scale=1.0"
134128/>
135- { this . renderContent ( ) }
136- </ Layout . Content >
137- < Footer />
138- </ Layout >
139-
140- < ReduxToastr
141- timeOut = { 4000 }
142- newestOnTop = { false }
143- preventDuplicates
144- position = "top-right"
145- transitionIn = "fadeIn"
146- transitionOut = "fadeOut"
147- progressBar />
148- </ >
129+ </ Helmet >
130+
131+ < Layout className = "layout" >
132+ < Header />
133+ < Layout . Content className = "content" >
134+ < Alert
135+ message = { `We are closing` }
136+ description = {
137+ < >
138+ We're sorry. The service{ " " }
139+ < a href = "https://medium.com/golangci/golangci-com-is-closing-d1fc1bd30e0e" >
140+ has stopped working
141+ </ a >
142+ .
143+ </ >
144+ }
145+ type = "warning"
146+ showIcon
147+ />
148+ { this . renderContent ( ) }
149+ </ Layout . Content >
150+ < Footer />
151+ </ Layout >
152+
153+ < ReduxToastr
154+ timeOut = { 4000 }
155+ newestOnTop = { false }
156+ preventDuplicates
157+ position = "top-right"
158+ transitionIn = "fadeIn"
159+ transitionOut = "fadeOut"
160+ progressBar
161+ />
162+ </ >
149163) ;
150164}
151165}
@@ -154,10 +168,12 @@ const mapStateToProps = (state: IAppStore): any => ({
154168lastApiHttpCode :state . result ?state . result . lastApiResultHttpCode :null ,
155169lastApiErrorCode :state . result ?state . result . lastApiResultErrorCode :null ,
156170lastApiErrorMessage :state . result ?state . result . lastApiResultMessage :null ,
157- currentUser :state . auth . currentUser ,
171+ currentUser :state . auth . currentUser
158172} ) ;
159173
160- let app = withRouter ( connect < IStateProps , IDispatchProps , IOwnProps > ( mapStateToProps ) ( App ) ) ;
174+ let app = withRouter (
175+ connect < IStateProps , IDispatchProps , IOwnProps > ( mapStateToProps ) ( App )
176+ ) ;
161177
162178if ( __DEV__ ) {
163179app = hot ( app ) ;