Skip to content

Commit

Permalink
Merge branch 'main' into samy/rnd-3104-clicking-on-images-to-expand-w…
Browse files Browse the repository at this point in the history
…ill-not-open-the-original-size-2
  • Loading branch information
SamyPesse committed Mar 24, 2024
2 parents 3681b80 + 2ed5445 commit d6ea331
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 26 deletions.
43 changes: 21 additions & 22 deletions e2e/pages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,6 @@ const testCases: TestsCase[] = [
},
],
},
{
name: 'GitBook Examples',
baseUrl: 'https://examples.gitbook.com',
tests: [
{
name: 'Landing page',
url: '',
run: waitForCookiesDialog,
},
],
},
{
name: 'Snyk',
baseUrl: 'https://docs.snyk.io',
Expand All @@ -99,17 +88,6 @@ const testCases: TestsCase[] = [
},
],
},
{
name: 'Rocket.Chat',
baseUrl: 'https://docs.rocket.chat',
tests: [
{
name: 'Home',
url: '',
run: waitForCookiesDialog,
},
],
},
{
name: 'Versioning',
baseUrl: 'https://gitbook.gitbook.io/test-1-1/',
Expand Down Expand Up @@ -221,6 +199,27 @@ const testCases: TestsCase[] = [
},
],
},
{
name: 'Page options',
baseUrl: 'https://gitbook.gitbook.io/test-1-1/',
tests: [
{
name: 'With cover',
url: 'page-options/page-with-cover',
run: waitForCookiesDialog,
},
{
name: 'With hero cover',
url: 'page-options/page-with-hero-cover',
run: waitForCookiesDialog,
},
{
name: 'With cover and no TOC',
url: 'page-options/page-with-cover-and-no-toc',
run: waitForCookiesDialog,
},
],
},
{
name: 'Customization',
baseUrl: 'https://gitbook.gitbook.io/test-1-1/',
Expand Down
3 changes: 2 additions & 1 deletion src/components/PageAside/PageAside.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ export async function PageAside(props: {
'sticky',
'py-8',
'break-anywhere', // To prevent long words in headings from breaking the layout
withHeaderOffset ? 'lg:h-[calc(100vh_-_4rem)]' : 'lg:h-[100vh]',
'lg:h-full',
withHeaderOffset ? 'lg:max-h-[calc(100vh_-_4rem)]' : 'lg:max-h-[100vh]',
withHeaderOffset ? 'top-16' : 'top-0',
'h-[100vh]',

Expand Down
11 changes: 8 additions & 3 deletions src/components/PageBody/PageCover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,22 @@ export async function PageCover(props: {
cover: RevisionPageDocumentCover;
context: ContentRefContext;
}) {
const { as, cover, context } = props;
const { as, page, cover, context } = props;
const resolved = cover.ref ? await resolveContentRef(cover.ref, context) : null;

return (
<div
className={tcls(
'overflow-hidden',
'-mx-4',
// Negative margin to balance the container padding
'-mx-4',
as === 'full'
? ['sm:-mx-6', 'md:-mx-8', 'lg:ml-0', '-lg:mr-8']
? [
'sm:-mx-6',
'md:-mx-8',
'-lg:mr-8',
page.layout.tableOfContents ? 'lg:ml-0' : null,
]
: ['sm:mx-auto', 'max-w-3xl', 'sm:rounded-md', 'mb-8'],
)}
>
Expand Down

0 comments on commit d6ea331

Please sign in to comment.