Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
sphinxrave committed Nov 13, 2024
1 parent fd8b752 commit 3c6a86d
Show file tree
Hide file tree
Showing 8 changed files with 313 additions and 24 deletions.
210 changes: 207 additions & 3 deletions packages/react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
"typescript-plugin-css-modules": "^5.1.0",
"unocss": "^0.61.3",
"unocss-preset-autoprefixer": "^0.0.7",
"unplugin-info": "^1.2.1",
"vite": "^5.3.4"
}
}
14 changes: 14 additions & 0 deletions packages/react/src/components/layout/Frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ import React from "react";
import { useOrgs } from "@/services/orgs.service";
import { useTimeout } from "usehooks-ts";
import { defaultOpenAtom } from "@/store/settings";
//@ts-expect-error commitssincelasttag
import {
abbreviatedSha,
committerDate,
lastTag,
commitsSinceLastTag,
} from "~build/git";
import dayjs from "dayjs";

export function LocationAwareReactivity() {
const location = useLocation();
Expand Down Expand Up @@ -142,6 +150,12 @@ export function Frame() {
<Outlet />
</Suspense>
</ErrorBoundary>
<div className="mt-16 text-center text-sm text-base-7">
© 2020 Holodex v{lastTag}.{commitsSinceLastTag}
<small className="ml-2 opacity-50">
{abbreviatedSha} / {dayjs(new Date(committerDate)).format("lll")}
</small>
</div>
</main>
<SelectionFooter />
{reportedVideo && (
Expand Down
27 changes: 25 additions & 2 deletions packages/react/src/components/sidebar/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import { Button } from "@/shadcn/ui/button";
import { useAtom, useAtomValue, useSetAtom } from "jotai";
import { OrgSelectorCombobox } from "../org/OrgSelectorCombobox";
import { useTranslation } from "react-i18next";
import { Link, useLocation } from "react-router-dom";
import {
Link,
useLocation,
useNavigate,
useParams,
useSearchParams,
} from "react-router-dom";
import {
HTMLAttributes,
type ReactNode,
Expand Down Expand Up @@ -36,6 +42,23 @@ export function Sidebar() {
const isMobile = useAtomValue(isMobileAtom);
const toggle = useSetAtom(toggleSidebarAtom);
const fs = useAtomValue(sidebarShouldBeFullscreenAtom);
const navigate = useNavigate();
const org = useParams().org;
const [params] = useSearchParams();

const setOrg = useCallback(
(org?: Org) => {
navigate({
pathname: `/org/${org?.name}`,
search: ["members", "live", "clips", "archive"].includes(
params.get("tab") || "",
)
? `?tab=${params.get("tab")}`
: "",
});
},
[navigate, params],
);

const handleClickOutside = useCallback(() => {
floating && open && setOpen(false);
Expand All @@ -62,7 +85,7 @@ export function Sidebar() {
</div>
<div className="group/sidebar flex grow flex-col space-y-1 px-3 py-2">
<div className="mb-2">
<OrgSelectorCombobox />
<OrgSelectorCombobox setOrg={setOrg} />
</div>
<div className="space-y-2">
<SidebarItem
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/video/VideoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export function VideoCard({
"line-clamp-2 pr-4 text-sm font-bold md:text-[1rem] md:leading-6",
]),
channelLink:
"line-clamp-1 text-xs text-base-11 hover:text-base-12 @lg:text-sm",
"line-clamp-1 text-xs text-primary-11 hover:text-primary-12 @lg:text-sm",
scheduleText: "text-sm @lg:text-sm text-base-11",
}),
[size, onClick, selectionMode, selectedSet, video.id],
Expand Down
Loading

0 comments on commit 3c6a86d

Please sign in to comment.