diff --git a/.changeset/swift-feet-heal.md b/.changeset/swift-feet-heal.md new file mode 100644 index 00000000000..be6edb697ce --- /dev/null +++ b/.changeset/swift-feet-heal.md @@ -0,0 +1,5 @@ +--- +'@keystone-next/keystone': minor +--- + +Updated Navigation component to show docs and playground links irrespective of authentication. diff --git a/packages/keystone/src/admin-ui/components/Navigation.tsx b/packages/keystone/src/admin-ui/components/Navigation.tsx index 8c53ed333e2..800e9d24621 100644 --- a/packages/keystone/src/admin-ui/components/Navigation.tsx +++ b/packages/keystone/src/admin-ui/components/Navigation.tsx @@ -8,7 +8,7 @@ import { Button } from '@keystone-ui/button'; import { Popover } from '@keystone-ui/popover'; import { MoreHorizontalIcon } from '@keystone-ui/icons/icons/MoreHorizontalIcon'; import { ChevronRightIcon } from '@keystone-ui/icons/icons/ChevronRightIcon'; -import { NavigationProps, ListMeta } from '../../types'; +import { NavigationProps, ListMeta, AuthenticatedItem } from '../../types'; import { useKeystone } from '../context'; import { Link } from '../router'; @@ -60,7 +60,7 @@ export const NavItem = ({ href, children, isSelected: _isSelected }: NavItemProp ); }; -const AuthenticatedItem = ({ item }: { item: { id: string; label: string } }) => { +const AuthenticatedItemDialog = ({ item }: { item: AuthenticatedItem | undefined }) => { const { spacing, typography } = useTheme(); return (
marginBottom: 0, }} > -
- Signed in as {item.label} -
+ {item && item.state === 'authenticated' ? ( +
+ Signed in as {item.label} +
+ ) : ( +
Graqhql Playground and Docs
+ )} + ( @@ -100,7 +105,7 @@ const AuthenticatedItem = ({ item }: { item: { id: string; label: string } }) => Keystone Documentation - + {item && item.state === 'authenticated' && }
@@ -138,11 +143,10 @@ export const NavigationContainer = ({ authenticatedItem, children }: NavigationC display: 'flex', flexDirection: 'column', justifyContent: 'center', + position: 'relative', }} > - {authenticatedItem?.state === 'authenticated' && ( - - )} +