Skip to content

Commit d778a12

Browse files
committed
feat: header facelift
1 parent 79c063b commit d778a12

File tree

12 files changed

+357
-128
lines changed

12 files changed

+357
-128
lines changed

apify-docs-theme/src/config.js

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -137,20 +137,6 @@ const themeConfig = {
137137
},
138138
],
139139
},
140-
{
141-
href: 'https://github.com/apify',
142-
label: 'GitHub',
143-
title: 'Apify on GitHub',
144-
position: 'right',
145-
className: 'icon',
146-
},
147-
{
148-
href: 'https://discord.com/invite/jyEM2PRvMU',
149-
label: 'Discord',
150-
title: 'Chat on Discord',
151-
position: 'right',
152-
className: 'icon',
153-
},
154140
],
155141
},
156142
colorMode: {
@@ -256,6 +242,10 @@ const themeConfig = {
256242
label: 'GitHub',
257243
href: 'https://github.com/apify',
258244
},
245+
{
246+
href: 'https://discord.com/invite/jyEM2PRvMU',
247+
label: 'Discord',
248+
},
259249
{
260250
label: 'Trust Center',
261251
href: 'https://trust.apify.com',

apify-docs-theme/src/theme/Footer/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function Footer() {
2828
const { links, style } = footer;
2929
return (
3030
<footer className={clsx(styles.footer, style)}>
31-
<div className="container padding-horiz--lg">
31+
<div className={styles.container}>
3232
<div className="row" style={{ justifyContent: 'space-between' }}>
3333
{ links.map((column, i) => (
3434
<div key={i} className={`col col--2`}>

apify-docs-theme/src/theme/Footer/index.module.css

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
.footer {
2-
padding-top: 64px;
2+
padding: 4rem 1.6rem 0;
3+
border-top: 1px solid var(--color-neutral-separator-subtle);
4+
}
5+
6+
.container {
7+
max-width: var(--max-layout-width);
8+
margin: 0 auto;
9+
width: 100%;
10+
}
11+
12+
:global(.row) {
13+
margin: unset;
14+
}
15+
16+
:global(.col) {
17+
padding: unset;
318
}
419

520
.builtBy {
@@ -34,15 +49,9 @@
3449
}
3550

3651
.footerTitle {
37-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI',
38-
'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans',
39-
'Helvetica Neue', sans-serif;
40-
font-weight: 600;
41-
font-size: 16px;
42-
line-height: 20px;
43-
letter-spacing: 0.1em;
44-
text-transform: uppercase;
45-
color: #8d92af;
52+
font-size: 1.6rem;
53+
font-weight: 700;
54+
line-height: 2.4rem;
4655
margin-bottom: 20px;
4756
}
4857

apify-docs-theme/src/theme/Layout/index.jsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@ import { useLocation } from '@docusaurus/router';
22
// cannot use any of the theme aliases here as it causes a circular dependency :( ideas welcome
33
import Layout from '@docusaurus/theme-classic/lib/theme/Layout/index';
44
import useBaseUrl from '@docusaurus/useBaseUrl';
5-
import { usePluginData } from '@docusaurus/useGlobalData';
65
import React from 'react';
76

87
export default function LayoutWrapper(props) {
9-
const { options: { subNavbar } } = usePluginData('@apify/docs-theme');
108
const baseUrl = useBaseUrl('/');
119
const currentPath = useLocation().pathname.replace(new RegExp(`^${baseUrl}`), '');
1210

1311
return (
1412
<div style={{
15-
'--ifm-navbar-height': subNavbar && !currentPath.startsWith('api/v2') ? '123px' : '68px',
1613
margin: 0,
1714
padding: 0,
1815
boxSizing: 'border-box',
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import styles from '../CTA/styles.module.css';
2+
3+
export default function NavbarCTA() {
4+
return (
5+
<a href="https://console.apify.com" className={styles.getStarted}>Get started</a>
6+
);
7+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
.getStarted {
2+
all: unset;
3+
height: 4rem;
4+
padding: 0.8rem 1.6rem !important;
5+
background-color: var(--color-primary-black-action);
6+
border-radius: 2rem;
7+
color: var(--color-neutral-text-on-primary);
8+
font-size: 1.6rem;
9+
font-weight: 500;
10+
line-height: 2.4rem;
11+
box-sizing: border-box;
12+
cursor: pointer;
13+
display: block;
14+
position: relative;
15+
text-align: center;
16+
transition: all var(--ifm-transition-fast) var(--ifm-transition-timing-default);
17+
18+
&::before {
19+
content: '';
20+
position: absolute;
21+
top: 0;
22+
right: 0;
23+
bottom: 0;
24+
left: 0;
25+
background: var(--button-gradient);
26+
opacity: 0.4;
27+
border-radius: inherit;
28+
transition: all var(--ifm-transition-fast) var(--ifm-transition-timing-default);
29+
}
30+
31+
&:hover {
32+
background-color: var(--color-primary-black-action-hover);
33+
color: var(--color-neutral-text-on-primary);
34+
35+
&::before {
36+
opacity: 1;
37+
}
38+
}
39+
}
40+
41+
@media (max-width: 768px) {
42+
.getStarted {
43+
width: 100%;
44+
}
45+
46+
:global(.navbar__inner) .getStarted {
47+
display: none;
48+
}
49+
}

apify-docs-theme/src/theme/Navbar/Content/index.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ import {
44
splitNavbarItems,
55
} from '@docusaurus/theme-common/internal';
66
import { usePluginData } from '@docusaurus/useGlobalData';
7-
import NavbarColorModeToggle from '@theme/Navbar/ColorModeToggle';
87
import NavbarLogo from '@theme/Navbar/Logo';
98
import NavbarMobileSidebarToggle from '@theme/Navbar/MobileSidebar/Toggle';
109
import NavbarSearch from '@theme/Navbar/Search';
1110
import NavbarItem from '@theme/NavbarItem';
1211
import React from 'react';
1312

1413
import SearchBar from '../../SearchBar';
15-
import styles from './styles.module.css';
14+
import NavbarCTA from '../CTA';
1615

1716
function NavbarItems({ items }) {
1817
return (
@@ -72,6 +71,7 @@ export default function NavbarContent() {
7271
const { navbar: { items } } = useThemeConfig();
7372
const [leftItems, rightItems] = splitNavbarItems(items);
7473
const searchBarItem = items.find((item) => item.type === 'search');
74+
7575
return (
7676
<div
7777
style={{
@@ -85,20 +85,20 @@ export default function NavbarContent() {
8585
<NavbarContentLayout
8686
left={
8787
<>
88-
<NavbarMobileSidebarToggle />
8988
<NavbarLogo />
9089
<NavbarItems items={leftItems} />
9190
</>
9291
}
9392
right={
9493
<>
95-
<NavbarColorModeToggle className={styles.colorModeToggle} />
9694
<NavbarItems items={rightItems} />
9795
{!searchBarItem && (
9896
<NavbarSearch>
9997
<SearchBar />
10098
</NavbarSearch>
10199
)}
100+
<NavbarCTA />
101+
<NavbarMobileSidebarToggle />
102102
</>
103103
}
104104
/>

apify-docs-theme/src/theme/Navbar/Content/styles.module.css

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { useNavbarMobileSidebar, useThemeConfig } from '@docusaurus/theme-common/internal';
2+
3+
import IconClose from '@theme/Icon/Close';
4+
import NavbarLogo from '@theme/Navbar/Logo';
5+
import NavbarSearch from '@theme/Navbar/Search';
6+
import React from 'react';
7+
8+
import SearchBar from '../../../SearchBar';
9+
import NavbarCTA from '../../CTA';
10+
11+
export default function NavbarMobileSidebarHeader() {
12+
const mobileSidebar = useNavbarMobileSidebar();
13+
14+
const { navbar: { items } } = useThemeConfig();
15+
const searchBarItem = items.find((item) => item.type === 'search');
16+
17+
return (
18+
<>
19+
<div className="navbar-sidebar__brand">
20+
<NavbarLogo />
21+
<button
22+
type="button"
23+
className="clean-btn navbar-sidebar__close"
24+
onClick={() => mobileSidebar.toggle()}
25+
aria-label="Close navigation bar"
26+
>
27+
<IconClose />
28+
</button>
29+
</div>
30+
<div className="navbar-sidebar__actions">
31+
<div className="navbar-sidebar__actions__container">
32+
<NavbarCTA />
33+
{!searchBarItem && (
34+
<NavbarSearch>
35+
<SearchBar />
36+
</NavbarSearch>
37+
)}
38+
</div>
39+
</div>
40+
</>
41+
);
42+
}

apify-docs-theme/src/theme/SearchBar/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
55
import React, { useCallback } from 'react';
66

77
import { ApifySearch } from '@apify/docs-search-modal';
8+
import './styles.css';
89

910
/**
1011
* Tests whether the given href is pointing to the current docusaurus instance (so we can use the router link).

0 commit comments

Comments
 (0)