File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -30,3 +30,9 @@ export const LoggedOut: Story = {
30
30
user : { loginHref : '#' }
31
31
}
32
32
} ;
33
+
34
+ export const NoUser : Story = {
35
+ args : {
36
+ links : ExampleLinks
37
+ }
38
+ } ;
Original file line number Diff line number Diff line change
1
+ import type { JSXElement } from '~/src/types/jsxElement' ;
1
2
import CFPBLogo from '../../assets/images/cfpb-logo.png' ;
2
3
import Link from '../Link/Link' ;
3
4
import './navbar.less' ;
@@ -35,11 +36,13 @@ interface UserActionsProperties {
35
36
user ?: User ;
36
37
}
37
38
38
- const UserActions = ( { user } : UserActionsProperties ) : JSX . Element => {
39
- if ( ! user ?. name )
39
+ const UserActions = ( { user } : UserActionsProperties ) : JSXElement => {
40
+ if ( ! user ) return null ;
41
+
42
+ if ( ! user . name )
40
43
return (
41
44
< div className = 'user-actions' >
42
- < Link href = { user ? .loginHref } className = 'nav-item login' >
45
+ < Link href = { user . loginHref } className = 'nav-item login' >
43
46
LOGIN
44
47
</ Link >
45
48
</ div >
You can’t perform that action at this time.
0 commit comments