Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace header link API type #2603

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/gitbook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"clean": "rm -rf ./.next && rm -rf ./public/~gitbook/static"
},
"dependencies": {
"@gitbook/api": "^0.78.0",
"@gitbook/api": "^0.80.0",
"@gitbook/cache-do": "workspace:*",
"@gitbook/emoji-codepoints": "workspace:*",
"@gitbook/icons": "workspace:*",
Expand Down
9 changes: 2 additions & 7 deletions packages/gitbook/src/components/Header/HeaderLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@ import {
CustomizationSettings,
CustomizationHeaderPreset,
SiteCustomizationSettings,
CustomizationHeaderLink,
CustomizationHeaderItem,
} from '@gitbook/api';
import assertNever from 'assert-never';

import { ContentRefContext, resolveContentRef } from '@/lib/references';
import { tcls } from '@/lib/tailwind';

// @TODO replace by api.CustomizationHeaderItem when available
type CustomizationHeaderItem = Omit<CustomizationHeaderLink, 'to'> & {
to: CustomizationHeaderLink['to'] | null;
};

import {
Dropdown,
DropdownButtonProps,
Expand Down Expand Up @@ -85,7 +80,7 @@ export async function HeaderLink(props: {
}

export type HeaderLinkNavItemProps = {
linkStyle: NonNullable<CustomizationHeaderLink['style']>;
linkStyle: NonNullable<CustomizationHeaderItem['style']>;
headerPreset: CustomizationHeaderPreset;
title: string;
href: string;
Expand Down
6 changes: 1 addition & 5 deletions packages/gitbook/src/components/Header/HeaderLinkMore.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
CustomizationHeaderLink,
CustomizationHeaderItem,
CustomizationHeaderPreset,
CustomizationSettings,
SiteCustomizationSettings,
Expand All @@ -13,10 +13,6 @@ import { tcls } from '@/lib/tailwind';
import { Dropdown, DropdownMenu, DropdownMenuItem } from './Dropdown';
import styles from './headerLinks.module.css';

// @TODO replace by api.CustomizationHeaderItem when available
type CustomizationHeaderItem = Omit<CustomizationHeaderLink, 'to'> & {
to: CustomizationHeaderLink['to'] | null;
};

/**
* Dropdown menu for header links hidden at small screen size.
Expand Down
Loading