cleanup: defaultProps -> JS default params on our function components
React 19 drops defaultProps on function components. Converted the 9 of
ours that used it (App, Navigation, ReSendEmail, Reconnect, OAuthLoginButton,
PageHeader, Page, EditDocument, EditSubscription) to destructured default
params; App defaults userId/emailAddress in its withTracker instead (it
spreads {...props} widely). Class components keep defaultProps (still
supported). The only defaultProps warnings left are from the react-share
npm package (CreatedButton/Icon), not our code. REST smoke byte-identical.
This commit is contained in:
parent
5661e129fb
commit
4ddaa0d8ec
9 changed files with 17 additions and 51 deletions
|
|
@ -15,7 +15,7 @@ import './Navigation.scss';
|
|||
|
||||
// removed class: fixed-top
|
||||
// md instead of lg: no menu in medium
|
||||
const Navigation = props => (
|
||||
const Navigation = ({ name = '', ...props }) => (
|
||||
<nav className="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||
<div style={{ overflow: 'hidden' } /* for ribbon */} className="container">
|
||||
{/* <BetaRibbon /> */}
|
||||
|
|
@ -47,17 +47,13 @@ const Navigation = props => (
|
|||
</LinkContainer>
|
||||
|
||||
</ul>
|
||||
{!props.authenticated ? <PublicNavigation /> : <AuthenticatedNavigation {...props} />}
|
||||
{!props.authenticated ? <PublicNavigation /> : <AuthenticatedNavigation name={name} {...props} />}
|
||||
{/* </Navbar.Collapse> */}
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
);
|
||||
|
||||
Navigation.defaultProps = {
|
||||
name: ''
|
||||
};
|
||||
|
||||
Navigation.propTypes = {
|
||||
t: PropTypes.func.isRequired,
|
||||
authenticated: PropTypes.bool.isRequired
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue