Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit cef198e

Browse files
replaced deprecated component
1 parent e743f57 commit cef198e

File tree

10 files changed

+22
-22
lines changed

10 files changed

+22
-22
lines changed

Diff for: src/components/AuthorizationProvider.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import React, { ComponentType, ReactNode, StatelessComponent } from 'react';
1+
import React, { ComponentType, FunctionComponent, ReactNode } from 'react';
22
import { AuthorizationProps } from 'types';
33
import getDisplayName from './getDisplayName';
44

55
const { Consumer, Provider } = React.createContext<string | undefined>(
66
undefined,
77
);
88

9-
const AuthorizationProvider: StatelessComponent<
9+
const AuthorizationProvider: FunctionComponent<
1010
AuthorizationProps & {
1111
children: ReactNode;
1212
}

Diff for: src/components/HyperMediaControls/Dialog.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from '@material-ui/core';
1212
import { SlideProps } from '@material-ui/core/Slide';
1313
import RelIcon from 'components/RelIcon';
14-
import React, { FormEvent, PureComponent, StatelessComponent } from 'react';
14+
import React, { FormEvent, FunctionComponent, PureComponent } from 'react';
1515
import { HalLink } from 'types';
1616
import HelpButton from './HelpButton';
1717
import RelButton from './RelButton';
@@ -22,7 +22,7 @@ const styles = (theme: Theme) => ({
2222
},
2323
});
2424

25-
const SlideUp: StatelessComponent<SlideProps> = props => (
25+
const SlideUp: FunctionComponent<SlideProps> = props => (
2626
<Slide direction={'up'} {...props} />
2727
);
2828

Diff for: src/components/HyperMediaControls/RelButton.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { Button } from '@material-ui/core';
22
import { ButtonProps } from '@material-ui/core/Button';
33
import RelIcon from 'components/RelIcon';
4-
import React, { StatelessComponent } from 'react';
4+
import React, { FunctionComponent } from 'react';
55

66
interface RelButtonProps {
77
rel: string;
88
title?: string;
99
}
1010

11-
const RelButton: StatelessComponent<RelButtonProps & ButtonProps> = ({
11+
const RelButton: FunctionComponent<RelButtonProps & ButtonProps> = ({
1212
rel,
1313
onClick,
1414
title,

Diff for: src/components/NavigationLinks.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { IconButton } from '@material-ui/core';
22
import React, {
33
ComponentType,
44
FormEventHandler,
5+
FunctionComponent,
56
PureComponent,
6-
StatelessComponent,
77
} from 'react';
88
import { navigation } from 'stream-store';
99
import { HalLink, HalLinks, NavigatableProps } from 'types';
@@ -45,7 +45,7 @@ interface NavigationLinksProps {
4545
_links: HalLinks;
4646
}
4747

48-
const NavigationLinks: StatelessComponent<NavigationLinksProps> = ({
48+
const NavigationLinks: FunctionComponent<NavigationLinksProps> = ({
4949
_links,
5050
}) => (
5151
<nav>

Diff for: src/components/NavigationProvider.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { ComponentType, ReactNode, StatelessComponent } from 'react';
1+
import React, { ComponentType, FunctionComponent, ReactNode } from 'react';
22
import { NavigatableProps, NavigationHandler } from 'types';
33
import getDisplayName from './getDisplayName';
44

@@ -10,7 +10,7 @@ const { Consumer, Provider } = React.createContext<NavigationHandler>(
1010
defaultNavigationHandler,
1111
);
1212

13-
const NavigationProvider: StatelessComponent<{
13+
const NavigationProvider: FunctionComponent<{
1414
onNavigate: NavigationHandler;
1515
children: ReactNode;
1616
}> = ({ onNavigate, children }) => (

Diff for: src/stream-store/Viewer/HalViewer/Home.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Table } from 'components';
22
import inflector from 'inflector-js';
3-
import React, { ComponentType, StatelessComponent } from 'react';
3+
import React, { ComponentType, FunctionComponent } from 'react';
44
import { connect, createState } from 'reactive';
55
import { Observable as obs } from 'rxjs';
66
import rels from 'stream-store/rels';
@@ -63,7 +63,7 @@ const state$ = createState<IndexState>(
6363
obs.of<IndexState>({ recent: [], info: [] }),
6464
);
6565

66-
const InfoLine: StatelessComponent<InfoLineProps> = ({ id, value }) => (
66+
const InfoLine: FunctionComponent<InfoLineProps> = ({ id, value }) => (
6767
<Table.Row>
6868
<Table.Cell>
6969
<strong>{id}</strong>
@@ -72,7 +72,7 @@ const InfoLine: StatelessComponent<InfoLineProps> = ({ id, value }) => (
7272
</Table.Row>
7373
);
7474

75-
const Info: StatelessComponent<InfoState> = ({ info }) => (
75+
const Info: FunctionComponent<InfoState> = ({ info }) => (
7676
<Table>
7777
<Table.Head>
7878
<Table.Row>

Diff for: src/stream-store/Viewer/HalViewer/Stream.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Table } from 'components';
2-
import React, { ComponentType, StatelessComponent } from 'react';
2+
import React, { ComponentType, FunctionComponent } from 'react';
33
import { connect, createState } from 'reactive';
44
import { Observable as obs } from 'rxjs';
55
import rels from 'stream-store/rels';
@@ -37,7 +37,7 @@ interface MessagesState {
3737
messages: Array<Message & HalResource>;
3838
}
3939

40-
const Messages: StatelessComponent<MessagesState> = ({ messages }) => (
40+
const Messages: FunctionComponent<MessagesState> = ({ messages }) => (
4141
<Table>
4242
<StreamHeader />
4343
<Table.Body>

Diff for: src/stream-store/Viewer/HalViewer/StreamMetadata.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Hyperlink, Table } from 'components';
2-
import React, { CSSProperties, StatelessComponent } from 'react';
2+
import React, { CSSProperties, FunctionComponent } from 'react';
33
import { connect, createState } from 'reactive';
44
import { Observable as obs } from 'rxjs';
55
import rels from 'stream-store/rels';
@@ -49,7 +49,7 @@ interface StreamMetadataDetailsProps {
4949
_links: HalLinks;
5050
}
5151

52-
const StreamMetadataDetails: StatelessComponent<StreamMetadataDetailsProps> = ({
52+
const StreamMetadataDetails: FunctionComponent<StreamMetadataDetailsProps> = ({
5353
streamId,
5454
maxAge,
5555
maxCount,
@@ -68,7 +68,7 @@ const StreamMetadataDetails: StatelessComponent<StreamMetadataDetailsProps> = ({
6868
</Table.Row>
6969
);
7070

71-
const StreamMetadata: StatelessComponent<
71+
const StreamMetadata: FunctionComponent<
7272
StreamMetadataState & HalViewerProps
7373
> = ({ metadata }) => (
7474
<section>

Diff for: src/stream-store/Viewer/HalViewer/components/StreamMessageDetails.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Hyperlink, Table } from 'components';
2-
import React, { CSSProperties, StatelessComponent } from 'react';
2+
import React, { CSSProperties, FunctionComponent } from 'react';
33
import rels from 'stream-store/rels';
44
import { HalResource } from 'types';
55

@@ -14,7 +14,7 @@ interface StreamMessageDetailsProps {
1414
type: string;
1515
}
1616

17-
const StreamMessageDetails: StatelessComponent<
17+
const StreamMessageDetails: FunctionComponent<
1818
StreamMessageDetailsProps & HalResource
1919
> = ({
2020
messageId,

Diff for: src/stream-store/Viewer/HalViewer/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { HyperMediaControls, NavigationLinks } from 'components';
2-
import React, { ComponentType, createElement, StatelessComponent } from 'react';
2+
import React, { ComponentType, createElement, FunctionComponent } from 'react';
33
import actions from 'stream-store/actions';
44
import rels from 'stream-store/rels';
55
import Home from './Home';
@@ -26,7 +26,7 @@ const views: { [rel: string]: ComponentType<HalViewerProps> } = {
2626
_unrecognized: Unrecognized,
2727
};
2828

29-
const HalViewer: StatelessComponent<HalViewerProps> = ({
29+
const HalViewer: FunctionComponent<HalViewerProps> = ({
3030
forms,
3131
_links,
3232
self,

0 commit comments

Comments
 (0)