Skip to content

Commit f506ee7

Browse files
committed
Add mobile header sidebar trigger
1 parent de425b7 commit f506ee7

File tree

6 files changed

+74
-4
lines changed

6 files changed

+74
-4
lines changed

web-next/src/locales/en-US/messages.po

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,11 +628,16 @@ msgstr "Go to My Drafts"
628628

629629
#: src/components/AppSidebar.tsx:125
630630
#: src/components/AppSidebar.tsx:216
631+
#: src/routes/(root).tsx:82
631632
#: src/routes/(root)/coc.tsx:47
632633
#: src/routes/(root)/markdown.tsx:47
633634
msgid "Hackers' Pub"
634635
msgstr "Hackers' Pub"
635636

637+
#: src/routes/(root).tsx:74
638+
msgid "Hackers' Pub home"
639+
msgstr "Hackers' Pub home"
640+
636641
#: src/components/AboutHackersPub.tsx:232
637642
msgid "Hackers' Pub is a place for software engineers to share their knowledge and experience with each other. It's also an ActivityPub-enabled social network, so you can follow your favorite hackers in the fediverse and get their latest posts in your feed."
638643
msgstr "Hackers' Pub is a place for software engineers to share their knowledge and experience with each other. It's also an ActivityPub-enabled social network, so you can follow your favorite hackers in the fediverse and get their latest posts in your feed."
@@ -1423,6 +1428,10 @@ msgstr "Title cannot be empty"
14231428
msgid "To follow {0}, enter your Fediverse handle."
14241429
msgstr "To follow {0}, enter your Fediverse handle."
14251430

1431+
#: src/routes/(root).tsx:72
1432+
msgid "Toggle sidebar"
1433+
msgstr "Toggle sidebar"
1434+
14261435
#. placeholder {0}: "LANGUAGE"
14271436
#: src/components/ArticleCard.tsx:173
14281437
msgid "Translated from {0}"

web-next/src/locales/ja-JP/messages.po

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,11 +624,16 @@ msgstr "マイ下書きへ"
624624

625625
#: src/components/AppSidebar.tsx:125
626626
#: src/components/AppSidebar.tsx:216
627+
#: src/routes/(root).tsx:82
627628
#: src/routes/(root)/coc.tsx:47
628629
#: src/routes/(root)/markdown.tsx:47
629630
msgid "Hackers' Pub"
630631
msgstr "Hackers' Pub"
631632

633+
#: src/routes/(root).tsx:74
634+
msgid "Hackers' Pub home"
635+
msgstr "Hackers' Pubホーム"
636+
632637
#: src/components/AboutHackersPub.tsx:232
633638
msgid "Hackers' Pub is a place for software engineers to share their knowledge and experience with each other. It's also an ActivityPub-enabled social network, so you can follow your favorite hackers in the fediverse and get their latest posts in your feed."
634639
msgstr "Hackers' Pubは、ソフトウェアエンジニアが知識と経験を共有する場所です。また、ActivityPubに対応したソーシャルネットワークでもあり、フェディバース(fediverse)で気に入ったハッカーをフォローして、最新のコンテンツをフィードで受け取ることができます。"
@@ -1418,6 +1423,10 @@ msgstr "タイトルは空にできません"
14181423
msgid "To follow {0}, enter your Fediverse handle."
14191424
msgstr "{0}さんをフォローするには、フェディバースのハンドルを入力してください。"
14201425

1426+
#: src/routes/(root).tsx:72
1427+
msgid "Toggle sidebar"
1428+
msgstr "サイドバーを切り替える"
1429+
14211430
#. placeholder {0}: "LANGUAGE"
14221431
#: src/components/ArticleCard.tsx:173
14231432
msgid "Translated from {0}"

web-next/src/locales/ko-KR/messages.po

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,11 +624,16 @@ msgstr "내 임시 보관으로"
624624

625625
#: src/components/AppSidebar.tsx:125
626626
#: src/components/AppSidebar.tsx:216
627+
#: src/routes/(root).tsx:82
627628
#: src/routes/(root)/coc.tsx:47
628629
#: src/routes/(root)/markdown.tsx:47
629630
msgid "Hackers' Pub"
630631
msgstr "Hackers' Pub"
631632

633+
#: src/routes/(root).tsx:74
634+
msgid "Hackers' Pub home"
635+
msgstr "Hackers' Pub 홈"
636+
632637
#: src/components/AboutHackersPub.tsx:232
633638
msgid "Hackers' Pub is a place for software engineers to share their knowledge and experience with each other. It's also an ActivityPub-enabled social network, so you can follow your favorite hackers in the fediverse and get their latest posts in your feed."
634639
msgstr "Hackers' Pub은 소프트웨어 프로그래머들이 지식과 경험을 서로 나누는 곳입니다. 또한 ActivityPub을 지원하는 소셜 네트워크이기도 하며, 연합우주(fediverse)에서 즐겨찾는 소프트웨어 프로그래머들을 팔로하고 최신 콘텐츠를 받아 볼 수 있습니다."
@@ -1418,6 +1423,10 @@ msgstr "제목은 비워둘 수 없습니다"
14181423
msgid "To follow {0}, enter your Fediverse handle."
14191424
msgstr "{0}님을 팔로하려면 연합우주 핸들을 입력해 주세요."
14201425

1426+
#: src/routes/(root).tsx:72
1427+
msgid "Toggle sidebar"
1428+
msgstr "사이드바 전환"
1429+
14211430
#. placeholder {0}: "LANGUAGE"
14221431
#: src/components/ArticleCard.tsx:173
14231432
msgid "Translated from {0}"

web-next/src/locales/zh-CN/messages.po

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,11 +624,16 @@ msgstr "前往我的草稿"
624624

625625
#: src/components/AppSidebar.tsx:125
626626
#: src/components/AppSidebar.tsx:216
627+
#: src/routes/(root).tsx:82
627628
#: src/routes/(root)/coc.tsx:47
628629
#: src/routes/(root)/markdown.tsx:47
629630
msgid "Hackers' Pub"
630631
msgstr "Hackers' Pub"
631632

633+
#: src/routes/(root).tsx:74
634+
msgid "Hackers' Pub home"
635+
msgstr "Hackers' Pub 首页"
636+
632637
#: src/components/AboutHackersPub.tsx:232
633638
msgid "Hackers' Pub is a place for software engineers to share their knowledge and experience with each other. It's also an ActivityPub-enabled social network, so you can follow your favorite hackers in the fediverse and get their latest posts in your feed."
634639
msgstr "Hackers' Pub 是个为软件工程师共同分享知识和经验的地方。它也是启用了 ActivityPub 的社交网络,这样你可以在联邦宇宙里关注你喜爱的黑客,并获取最新的帖子。"
@@ -1418,6 +1423,10 @@ msgstr "标题不能为空"
14181423
msgid "To follow {0}, enter your Fediverse handle."
14191424
msgstr "要关注{0},请输入你的联邦宇宙用户名。"
14201425

1426+
#: src/routes/(root).tsx:72
1427+
msgid "Toggle sidebar"
1428+
msgstr "切换侧边栏"
1429+
14211430
#. placeholder {0}: "LANGUAGE"
14221431
#: src/components/ArticleCard.tsx:173
14231432
msgid "Translated from {0}"

web-next/src/locales/zh-TW/messages.po

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,11 +624,16 @@ msgstr "前往我的草稿"
624624

625625
#: src/components/AppSidebar.tsx:125
626626
#: src/components/AppSidebar.tsx:216
627+
#: src/routes/(root).tsx:82
627628
#: src/routes/(root)/coc.tsx:47
628629
#: src/routes/(root)/markdown.tsx:47
629630
msgid "Hackers' Pub"
630631
msgstr "Hackers' Pub"
631632

633+
#: src/routes/(root).tsx:74
634+
msgid "Hackers' Pub home"
635+
msgstr "Hackers' Pub 首頁"
636+
632637
#: src/components/AboutHackersPub.tsx:232
633638
msgid "Hackers' Pub is a place for software engineers to share their knowledge and experience with each other. It's also an ActivityPub-enabled social network, so you can follow your favorite hackers in the fediverse and get their latest posts in your feed."
634639
msgstr "Hackers' Pub 是個為軟體工程師共同分享知識和經驗的地方。它也是啟用了 ActivityPub 的社交網路,這樣你可以在聯邦宇宙裡關注你喜愛的駭客,並獲取最新的貼文。"
@@ -1418,6 +1423,10 @@ msgstr "標題不能為空"
14181423
msgid "To follow {0}, enter your Fediverse handle."
14191424
msgstr "要關注{0},請輸入你的聯邦宇宙使用者名稱。"
14201425

1426+
#: src/routes/(root).tsx:72
1427+
msgid "Toggle sidebar"
1428+
msgstr "切換側邊欄"
1429+
14211430
#. placeholder {0}: "LANGUAGE"
14221431
#: src/components/ArticleCard.tsx:173
14231432
msgid "Translated from {0}"

web-next/src/routes/(root).tsx

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
2+
A,
23
query,
3-
RouteDefinition,
4+
type RouteDefinition,
45
type RouteSectionProps,
56
} from "@solidjs/router";
67
import { graphql } from "relay-runtime";
@@ -12,7 +13,7 @@ import {
1213
import { AppSidebar } from "~/components/AppSidebar.tsx";
1314
import { FloatingComposeButton } from "~/components/FloatingComposeButton.tsx";
1415
import { NoteComposeModal } from "~/components/NoteComposeModal.tsx";
15-
import { SidebarProvider } from "~/components/ui/sidebar.tsx";
16+
import { SidebarProvider, SidebarTrigger } from "~/components/ui/sidebar.tsx";
1617
import { Toaster } from "~/components/ui/toast.tsx";
1718
import { NoteComposeProvider } from "~/contexts/NoteComposeContext.tsx";
1819
import { ViewerProvider } from "~/contexts/ViewerContext.tsx";
@@ -47,7 +48,7 @@ const loadRootLayoutQuery = query(
4748
);
4849

4950
export default function RootLayout(props: RouteSectionProps) {
50-
const { i18n } = useLingui();
51+
const { i18n, t } = useLingui();
5152
const signedAccount = createPreloadedQuery<RootLayoutQuery>(
5253
RootLayoutQuery,
5354
() => loadRootLayoutQuery(),
@@ -64,9 +65,33 @@ export default function RootLayout(props: RouteSectionProps) {
6465
$signedAccount={signedAccount()?.viewer}
6566
signedAccountLoaded={!signedAccount.pending}
6667
/>
68+
<header class="fixed inset-x-0 top-0 z-40 border-b bg-background/80 backdrop-blur md:hidden">
69+
<div class="flex h-14 items-center justify-between px-4">
70+
<SidebarTrigger
71+
class="size-9 rounded-full"
72+
aria-label={t`Toggle sidebar`}
73+
/>
74+
<A href="/" aria-label={t`Hackers' Pub home`}>
75+
<picture>
76+
<source
77+
srcset="/logo-dark.svg"
78+
media="(prefers-color-scheme: dark)"
79+
/>
80+
<img
81+
src="/logo-light.svg"
82+
alt={t`Hackers' Pub`}
83+
width={111}
84+
height={28}
85+
class="h-7 w-auto"
86+
/>
87+
</picture>
88+
</A>
89+
<div class="size-9" aria-hidden="true" />
90+
</div>
91+
</header>
6792
<main
6893
lang={new Intl.Locale(i18n.locale).minimize().baseName}
69-
class="w-full"
94+
class="w-full pt-14 md:pt-0"
7095
classList={{
7196
"bg-[url(/dev-bg-light.svg)]": import.meta.env.DEV,
7297
"dark:bg-[url(/dev-bg-dark.svg)]": import.meta.env.DEV,

0 commit comments

Comments
 (0)