Skip to content

Commit e9bf4d2

Browse files
authored
chore: add links to sourcecraft repo (#116)
1 parent 5c3ad99 commit e9bf4d2

7 files changed

Lines changed: 88 additions & 15 deletions

File tree

docusaurus.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,15 @@ const config: Config = {
113113
{
114114
href: "https://github.com/gemini-testing/testplane",
115115
label: "GitHub",
116+
className: "header-github-link",
117+
"aria-label": "GitHub repository",
118+
position: "right",
119+
},
120+
{
121+
href: "https://sourcecraft.dev/testplane/testplane",
122+
label: "SourceCraft",
123+
className: "header-sourcecraft-link",
124+
"aria-label": "SourceCraft repository",
116125
position: "right",
117126
},
118127
],

src/scss/custom.scss

Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,6 @@ html[data-theme-override="light"] {
117117
--ifm-navbar-background-color: #fff;
118118
}
119119

120-
.docs-wrapper .navbar__items {
121-
// @apply bg-white dark:bg-neutral-950;
122-
}
123-
124120
.docs-wrapper .main-wrapper,
125121
.blog-wrapper .main-wrapper {
126122
max-width: var(--max-width);
@@ -143,6 +139,11 @@ html[data-theme-override="light"] {
143139
will-change: transform;
144140
@apply justify-center px-0 text-neutral-600 shadow-none dark:fill-white dark:text-neutral-400;
145141

142+
.navbar__items {
143+
position: relative;
144+
--ifm-navbar-padding-horizontal: 1.5rem;
145+
}
146+
146147
.navbar__inner {
147148
max-width: var(--max-width);
148149
padding: 0 2rem;
@@ -200,11 +201,20 @@ html[data-theme-override="light"] {
200201
}
201202

202203
.DocSearch-Button {
203-
@apply mr-6 h-8 w-40 scale-110 rounded-lg bg-transparent font-normal text-neutral-500 hover:bg-neutral-200 hover:text-neutral-500 hover:shadow-none md:scale-100 md:bg-neutral-100 md:text-neutral-500 lg:mr-0 xl:w-80 dark:bg-transparent dark:text-neutral-400 dark:hover:bg-neutral-800/80 dark:md:bg-neutral-800/50;
204+
@apply mr-3 flex h-8 w-8 items-center justify-center rounded-lg bg-transparent p-0 text-neutral-500 hover:bg-neutral-100 hover:text-neutral-900 hover:shadow-none md:mr-6 md:w-40 md:justify-start md:bg-neutral-100 md:px-3 md:font-normal md:text-neutral-500 md:hover:bg-neutral-200 lg:mr-0 xl:w-80 dark:text-neutral-400 dark:hover:bg-neutral-200/10 dark:hover:text-neutral-300 dark:md:bg-neutral-800/50 dark:md:hover:bg-neutral-800/80;
204205
font-family: Jost;
205206

206-
svg {
207-
@apply w-4 text-current;
207+
.DocSearch-Button-Container {
208+
@apply flex h-full w-full items-center justify-center md:justify-start;
209+
}
210+
211+
.DocSearch-Search-Icon {
212+
@apply m-0 h-4 w-4 shrink-0 text-current;
213+
}
214+
215+
.DocSearch-Button-Placeholder,
216+
.DocSearch-Button-Keys {
217+
@apply hidden md:flex;
208218
}
209219

210220
.DocSearch-Button-Key {
@@ -239,6 +249,52 @@ html[data-theme-override="light"] {
239249
}
240250
}
241251

252+
.header-github-link svg,
253+
.header-sourcecraft-link svg {
254+
display: none !important;
255+
}
256+
257+
.header-github-link,
258+
.header-sourcecraft-link,
259+
.color-mode-toggle {
260+
@apply mx-0.5 items-center gap-[5px] rounded-lg lg:flex lg:h-8 lg:w-8 lg:justify-center lg:gap-0 lg:p-0 lg:text-[0px];
261+
}
262+
263+
/*.header-github-link,
264+
.header-sourcecraft-link {
265+
font-size: 0;
266+
}*/
267+
268+
.color-mode-toggle .clean-btn {
269+
@apply flex h-full w-full items-center justify-center rounded-lg p-0;
270+
}
271+
272+
.color-mode-toggle:hover,
273+
.color-mode-toggle .clean-btn:hover {
274+
@apply bg-neutral-100 dark:bg-neutral-200/10;
275+
}
276+
277+
.header-github-link::before,
278+
.header-sourcecraft-link::before {
279+
content: "";
280+
display: block;
281+
width: 1rem;
282+
height: 1rem;
283+
background-color: currentColor;
284+
background-repeat: no-repeat;
285+
background-position: center;
286+
background-size: contain;
287+
}
288+
289+
.header-github-link::before {
290+
mask: url("../../static/icons/github.svg") no-repeat center / contain;
291+
}
292+
293+
.header-sourcecraft-link::before {
294+
mask: url("../../static/icons/sourcecraft-light-theme.svg") no-repeat center / contain;
295+
transform: scale(1.5);
296+
}
297+
242298
.navbar__brand {
243299
@apply px-2 font-mono;
244300
}

src/theme/ColorModeToggle/styles.module.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
.toggle {
44
@apply flex justify-center rounded-lg;
5-
height: 21px;
6-
width: 21px;
75
}
86

97
.toggleButton {

src/theme/Footer/Layout/index.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { useRef } from "react";
22
import type { Props } from "@theme/Footer/Layout";
33
import GithubIcon from "@site/static/icons/github.svg";
4+
import SourceCraftIcon from "@site/static/icons/sourcecraft-light-theme.svg";
45
import TestplaneLogo from "@site/static/img/logo.svg";
56
import TestplaneLogoDark from "@site/static/img/logo-dark.svg";
67
import { LogoStackOverflow, LogoTelegram } from "@gravity-ui/icons";
@@ -10,15 +11,19 @@ export default function FooterLayout({ links, copyright }: Props): JSX.Element {
1011

1112
const SOCIAL_LINKS = [
1213
{
13-
icon: GithubIcon,
14+
icon: <GithubIcon className="h-full w-full" />,
1415
href: "https://github.com/gemini-testing/testplane",
1516
},
1617
{
17-
icon: LogoStackOverflow,
18+
icon: <SourceCraftIcon className="h-full w-full scale-150" />,
19+
href: "https://sourcecraft.dev/testplane/testplane",
20+
},
21+
{
22+
icon: <LogoStackOverflow className="h-full w-full" />,
1823
href: "https://stackoverflow.com/questions/tagged/testplane",
1924
},
2025
{
21-
icon: LogoTelegram,
26+
icon: <LogoTelegram className="h-full w-full" />,
2227
href: "https://t.me/testplane",
2328
},
2429
];
@@ -34,15 +39,15 @@ export default function FooterLayout({ links, copyright }: Props): JSX.Element {
3439
<div className="mt-4 flex items-center">
3540
<div className="">{copyright}</div>
3641
<div className="ml-1 flex items-center">
37-
{SOCIAL_LINKS.map(({ icon: Icon, href }, index) => (
42+
{SOCIAL_LINKS.map(({ icon, href }, index) => (
3843
<a
3944
className="flex h-8 w-8 items-center rounded-lg p-2 text-neutral-500 hover:bg-neutral-100 hover:text-neutral-900 dark:text-neutral-400 dark:hover:bg-neutral-200/10 dark:hover:text-neutral-200"
4045
href={href}
4146
target="_blank"
4247
rel="noreferrer"
4348
key={index}
4449
>
45-
<Icon className="h-full w-full" />
50+
{icon}
4651
</a>
4752
))}
4853
</div>

src/theme/Navbar/MobileSidebar/Toggle/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default function MobileSidebarToggle(): JSX.Element {
1414
description: "The ARIA label for hamburger menu button of mobile navigation",
1515
})}
1616
aria-expanded={shown}
17-
className="navbar__toggle clean-btn absolute right-2 z-999"
17+
className="navbar__toggle clean-btn absolute right-0 z-999 flex h-8 w-8 items-center justify-center lg:hidden"
1818
type="button"
1919
>
2020
<EllipsisVertical />
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)