UriIndicator: props cleanup, no functional change

- Marked optional props properly.
- Re-ordered to make it easier to differentiate "props used in jsx" vs. "from redux".

Separated the commit to make the upcoming diffs easier to read.
This commit is contained in:
infinite-persistence 2022-02-16 11:47:36 +08:00
parent c2c44f7334
commit a636d7d8c9
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -4,27 +4,22 @@ import React from 'react';
import classnames from 'classnames'; import classnames from 'classnames';
import Button from 'component/button'; import Button from 'component/button';
type ChannelInfo = { type ChannelInfo = { uri: string, name: string };
uri: string,
name: string,
};
type Props = { type Props = {
isResolvingUri: boolean,
link: ?boolean,
claim: ?Claim,
hideAnonymous: boolean,
// Lint thinks we aren't using these, even though we are.
// Possibly because the resolve function is an arrow function that is passed in props?
resolveUri: (string) => void,
uri: string, uri: string,
channelInfo: ?ChannelInfo, // Direct channel info to use, bypassing the need to resolve 'uri'. channelInfo: ?ChannelInfo, // Direct channel info to use, bypassing the need to resolve 'uri'.
// to allow for other elements to be nested within the UriIndicator link: ?boolean,
children: ?Node,
inline: boolean,
external?: boolean, external?: boolean,
focusable?: boolean, // Defaults to 'true' if not provided.
hideAnonymous?: boolean,
inline?: boolean,
className?: string, className?: string,
focusable: boolean, children: ?Node, // to allow for other elements to be nested within the UriIndicator (commit: 1e82586f).
// --- redux ---
claim: ?Claim,
isResolvingUri: boolean,
resolveUri: (string) => void,
}; };
class UriIndicator extends React.PureComponent<Props> { class UriIndicator extends React.PureComponent<Props> {