Skip to content

Commit f06e895

Browse files
committed
Revert "Add DocsPickerDesktop component and integrate into DocsNavigationDesktop; update layout files to include DocsNavigation"
This reverts commit cca7e2a.
1 parent 79781ee commit f06e895

File tree

9 files changed

+156
-133
lines changed

9 files changed

+156
-133
lines changed

src/components/DocsNavigation/DocsNavigationDesktop/DocsNavigationDesktop.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { clsx } from "~/lib/clsx/clsx.ts"
22
import { useNavBar } from "../../Header/useNavBar/useNavBar.ts"
3-
import DocsPickerDesktop from "./DocsPickerDesktop.tsx"
43
import styles from "./docsNavigationDesktop.module.css"
54
import QuickLinksModal from "../../Header/Nav/QuickLinksModal.tsx"
65
import { useState } from "react"
@@ -29,10 +28,7 @@ function DocsNavigationDesktop({
2928
})}
3029
>
3130
<div className={styles.container}>
32-
<div className={styles.left}>
33-
<DocsPickerDesktop pathname={pathname} />
34-
{children}
35-
</div>
31+
<div className={styles.left}>{children}</div>
3632
<div className={styles.links}>
3733
{isCcipPage ? (
3834
/* Custom links for CCIP Directory pages */

src/components/DocsNavigation/DocsNavigationDesktop/DocsPickerDesktop.tsx

Lines changed: 0 additions & 63 deletions
This file was deleted.

src/components/Header/Nav/navBar.module.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@
9696
display: flex;
9797
justify-content: center;
9898
align-items: center;
99-
z-index: 999;
10099
}
101100

102101
.modalContentWrapper {

src/components/LeftSidebar/LeftSidebar.astro

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import RecursiveSidebar from "./RecursiveSidebar.astro"
66
import { LanguageSwitcherDropdown } from "~/components/LanguageSwitcherDropdown"
77
import { ChainTypeSelector } from "~/components/ChainSelector"
88
import { isChainAwareSection } from "~/config/chainTypes"
9-
import { filterContentByChainType } from "~/utils/chainType"
10-
import type { ChainType } from "~/config/types"
119
import styles from "./leftSidebar.module.css"
10+
import DocsHeaderTitle from "../DocsHeaderTitle/DocsHeaderTitle.astro"
11+
import * as CONFIG from "../../config"
1212
1313
type SectionEntryWithParent = SectionEntry & { parentSection?: string }
1414
@@ -83,14 +83,10 @@ const sidebarSections = getSidebarSections(section)
8383
---
8484

8585
<nav aria-labelledby="grid-left" class={styles.nav}>
86-
{
87-
section === "cre" && (
88-
<div class={styles.languageSwitcherTablet}>
89-
<LanguageSwitcherDropdown client:only="react" />
90-
</div>
91-
)
92-
}
93-
{showChainSelector && <ChainTypeSelector client:only="react" />}
86+
<div class={styles.sidebarDropdowns}>
87+
{section === "cre" && <LanguageSwitcherDropdown client:only="react" />}
88+
{showChainSelector && <ChainTypeSelector client:only="react" />}
89+
</div>
9490
<ul class={styles.navGroups} data-sticky>
9591
{
9692
sidebarSections.map((group) => (
@@ -107,6 +103,39 @@ const sidebarSections = getSidebarSections(section)
107103
</li>
108104
))
109105
}
106+
<div class={styles.quickLinks}>
107+
<li class={styles.headerLink}>
108+
<a href="/builders-quick-links" target="_blank" id="quick-links-sidebar-link">
109+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
110+
<path
111+
d="M2.5 9.20055L7.18129 2H12.2965L9.62194 5.59959H13.5L5.97787 14H4.50671L7.18135 9.20055H2.5Z"
112+
fill="#0D5DFF"></path>
113+
</svg>
114+
<p>Quick links</p>
115+
</a>
116+
</li>
117+
<li class={styles.headerLink}>
118+
<a
119+
class={styles.link}
120+
href="https://github.com/smartcontractkit/documentation"
121+
target="_blank"
122+
rel="noopener noreferrer"
123+
>
124+
<img height={16} width={16} src="/assets/icons/github-blue.svg" alt="GitHub repository" />
125+
<span>Github</span>
126+
</a>
127+
</li>
128+
{
129+
CONFIG.COMMUNITY_INVITE_URL && (
130+
<li class={styles.headerLink}>
131+
<a href={CONFIG.COMMUNITY_INVITE_URL} target="_blank" rel="noopener noreferrer">
132+
<img src="/images/discord.svg" loading="lazy" width="16" height="16" alt="Discord" />
133+
<span>Join our community</span>
134+
</a>
135+
</li>
136+
)
137+
}
138+
</div>
110139
</ul>
111140
</nav>
112141

@@ -124,7 +153,7 @@ const sidebarSections = getSidebarSections(section)
124153
</style>
125154

126155
<script>
127-
import { initializeChainType } from "~/stores/chainType"
156+
import { initializeChainType } from "~/stores/chainType.js"
128157

129158
/**
130159
* Initialize chain type selection from URL on page load
@@ -160,7 +189,7 @@ const sidebarSections = getSidebarSections(section)
160189
</script>
161190

162191
<script>
163-
import { selectedChainType } from "~/stores/chainType"
192+
import { selectedChainType } from "~/stores/chainType.js"
164193

165194
/**
166195
* Filters sidebar items based on selected chain type

src/components/LeftSidebar/leftSidebar.module.css

Lines changed: 79 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
.nav {
2-
padding-bottom: calc(2 * var(--doc-padding));
32
width: 100%;
4-
height: calc(100vh - var(--space-16x)); /* Subtract header height */
3+
height: calc(100vh - var(--space-16x));
4+
/* Subtract header height */
55
position: sticky;
6-
top: var(--space-16x); /* Header height */
7-
overflow: hidden; /* Prevent nav overflow */
6+
top: var(--space-16x);
7+
/* Header height */
8+
overflow: hidden;
9+
/* Prevent nav overflow */
10+
display: flex;
11+
flex-direction: column;
12+
}
13+
14+
.sidebarDropdowns {
15+
padding-top: var(--space-3x);
16+
flex-shrink: 0;
817
}
918

1019
.navGroups {
11-
padding: var(--doc-padding) var(--space-8x) var(--doc-padding) 0;
12-
height: 100%;
20+
padding: var(--doc-padding) var(--space-8x) calc(2 * var(--doc-padding)) 0;
21+
flex: 1;
1322
overflow-y: auto;
1423
scrollbar-width: thin;
1524
scrollbar-color: var(--gray-300) transparent;
@@ -47,8 +56,7 @@
4756
.navGroupTitle {
4857
margin-bottom: var(--space-2x);
4958
margin-top: var(--space-1x);
50-
color: var(--gray-900);
51-
font-weight: 600;
59+
color: var(--muted-foreground);
5260
line-height: 24px;
5361
font-size: 15px;
5462
display: flex;
@@ -57,10 +65,9 @@
5765
cursor: pointer;
5866
list-style: none;
5967
position: relative;
60-
padding-left: var(--space-6x);
6168
}
6269

63-
.navGroupTitle::before {
70+
.navGroupTitle::after {
6471
content: "";
6572
width: 6px;
6673
height: 6px;
@@ -71,21 +78,16 @@
7178
transition: transform 0.15s ease;
7279
position: absolute;
7380
top: calc(50% - 4px);
74-
left: var(--space-2x);
81+
right: var(--space-2x);
7582
}
7683

77-
details[open] > .navGroupTitle::before {
84+
details[open] > .navGroupTitle::after {
7885
transform: rotate(45deg);
7986
top: calc(50% - 5px);
8087
}
8188

82-
details:hover .navGroupTitle::before {
83-
border-color: var(--color-text-link);
84-
}
85-
8689
.navGroupEntries {
8790
margin-bottom: 0;
88-
padding-left: var(--space-6x);
8991
}
9092

9193
details {
@@ -113,9 +115,68 @@ details[open] > .navGroupTitle {
113115
color: hsla(var(--color-base-white), 100%, 1);
114116
}
115117

118+
.link {
119+
display: flex;
120+
align-items: center;
121+
padding: var(--space-3x) var(--space-2x);
122+
gap: var(--space-2x);
123+
margin-right: var(--space-2x);
124+
125+
color: var(--gray-900, #141921);
126+
font-weight: 600;
127+
line-height: 24px; /* 150% */
128+
}
129+
130+
.quickLinks {
131+
margin-top: 60px;
132+
display: flex;
133+
flex-direction: column;
134+
gap: var(--space-2x);
135+
}
136+
137+
.headerLink {
138+
font-size: 14px;
139+
color: var(--color-text-link);
140+
padding: var(--space-1x) var(--space-2x);
141+
}
142+
143+
.headerLink * {
144+
margin: 0;
145+
max-width: 100%;
146+
color: inherit;
147+
font: inherit;
148+
}
149+
150+
.headerLink.active,
151+
.headerLink:hover,
152+
.headerLink:focus {
153+
color: var(--theme-accent);
154+
fill: var(--theme-accent);
155+
}
156+
157+
.headerLink:focus-within {
158+
color: var(--theme-text-light);
159+
fill: var(--theme-text-light);
160+
}
161+
162+
.headerLink a {
163+
display: inline-flex;
164+
gap: var(--space-2x);
165+
width: 100%;
166+
padding: 0.15em 0 0.15em 0;
167+
text-decoration: none;
168+
}
169+
170+
.headerLink {
171+
display: flex;
172+
align-items: center;
173+
justify-content: space-between;
174+
gap: 0.25rem;
175+
}
176+
116177
/* Language Switcher for tablet screens (800px-1200px) */
117178
.languageSwitcherTablet {
118-
padding: var(--space-6x) var(--space-6x) 0 var(--space-6x);
179+
padding: var(--space-6x) 0;
119180
display: none;
120181
}
121182

0 commit comments

Comments
 (0)