1- import React , { PureComponent , ReactNode } from 'react' ;
21import {
32 Button ,
43 Drawer ,
54 Typography ,
65 WithStyles ,
76 withStyles ,
87} from '@material-ui/core' ;
8+ import React , { PureComponent , ReactNode } from 'react' ;
99import Remarkable from 'react-remarkable' ;
1010import uriTemplate from 'uri-template' ;
11- import { Help } from '../Icons' ;
12- import { withAuthorization } from '../AuthorizationProvider' ;
13- import { http } from '../../utils' ;
1411import { HalLink } from '../../types' ;
12+ import { http } from '../../utils' ;
13+ import { withAuthorization } from '../AuthorizationProvider' ;
14+ import { Help } from '../Icons' ;
1515
1616const getCurie = ( rel : string , curies : HalLink [ ] ) : HalLink => {
1717 const [ prefix , rest ] = rel . split ( ':' , 2 ) ;
@@ -80,15 +80,6 @@ interface HelpButtonState extends HalLink {
8080}
8181
8282class HelpButton extends PureComponent < HelpButtonProps , HelpButtonState > {
83- state = {
84- open : false ,
85- href : '' ,
86- type : '' ,
87- disabled : true ,
88- documentation : '' ,
89- curies : [ ] ,
90- } ;
91-
9283 static getDerivedStateFromProps = (
9384 { rel, curies } : HelpButtonProps ,
9485 state : HelpButtonState ,
@@ -97,6 +88,14 @@ class HelpButton extends PureComponent<HelpButtonProps, HelpButtonState> {
9788 disabled : false ,
9889 ...getCurie ( rel , curies ) ,
9990 } ) ;
91+ state = {
92+ open : false ,
93+ href : '' ,
94+ type : '' ,
95+ disabled : true ,
96+ documentation : '' ,
97+ curies : [ ] ,
98+ } ;
10099
101100 _handleOnClick = async ( ) => {
102101 const { authorization } = this . props ;
0 commit comments