@apify/docs-theme 1.0.11 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apify/docs-theme",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "files": [
@@ -0,0 +1,56 @@
1
+ import React from 'react';
2
+ import { useThemeConfig } from '@docusaurus/theme-common';
3
+ import useBaseUrl from '@docusaurus/useBaseUrl';
4
+ import { usePluginData } from '@docusaurus/useGlobalData';
5
+ import NavbarItem from '@theme/NavbarItem';
6
+
7
+ function useNavbarItems() {
8
+ // TODO temporary casting until ThemeConfig type is improved
9
+ return useThemeConfig().navbar.items;
10
+ }
11
+ // The primary menu displays the navbar items
12
+ export default function NavbarMobilePrimaryMenu() {
13
+ // const mobileSidebar = useNavbarMobileSidebar();
14
+ // TODO how can the order be defined for mobile?
15
+ // Should we allow providing a different list of items?
16
+ const items = useNavbarItems();
17
+ const baseUrl = useBaseUrl('.');
18
+ const { options: { subNavbar } } = usePluginData('@apify/docs-theme');
19
+ return (
20
+ <>
21
+ {
22
+ subNavbar ? <>
23
+ <NavbarItem
24
+ key={'title'}
25
+ mobile
26
+ href={baseUrl}
27
+ label={subNavbar.title}
28
+ />
29
+ <ul className="menu__list" style={{ paddingLeft: '1rem', marginBottom: '1rem', borderBottom: '1px solid #e0e0e0', paddingBottom: '1rem' }}>
30
+ {subNavbar.items.map((item, i) => (
31
+ <NavbarItem
32
+ key={i}
33
+ mobile
34
+ {...item}
35
+ />
36
+ ))}
37
+ </ul>
38
+ </> : null
39
+ }
40
+ <NavbarItem
41
+ key={'title2'}
42
+ mobile
43
+ label='Apify documentation'
44
+ />
45
+ <ul className="menu__list" style={{ paddingLeft: '1rem' }}>
46
+ {items.map((item, i) => (
47
+ <NavbarItem
48
+ mobile
49
+ {...item}
50
+ key={i}
51
+ />
52
+ ))}
53
+ </ul>
54
+ </>
55
+ );
56
+ }
@@ -297,7 +297,7 @@ article .card h2 {
297
297
  .menu__link,
298
298
  .table-of-contents__link {
299
299
  text-overflow: ellipsis;
300
- display: inline-block;
300
+ display: inline-block !important;
301
301
  width: 100%;
302
302
  overflow: hidden;
303
303
  white-space: nowrap;
@@ -488,7 +488,7 @@ div[class*="searchBox"] {
488
488
  display: flex;
489
489
  }
490
490
 
491
- @media (min-width: 480px) {
491
+ @media (min-width: 480px) {
492
492
  .navbar__logo {
493
493
  display: initial;
494
494
  }
@@ -556,7 +556,6 @@ html .table-of-contents ul {
556
556
  display: inline-flex;
557
557
  -webkit-box-align: center;
558
558
  align-items: center;
559
-
560
559
  }
561
560
 
562
561
  .actionLink:hover {
@@ -586,4 +585,4 @@ html[data-theme='dark'] .actionLink:hover::after {
586
585
  .actionLink:hover::after {
587
586
  background-image: url('/img/arrow-right-primary.svg');
588
587
  margin-left: 8px;
589
- }
588
+ }