Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
fabroos committed Jun 14, 2024
1 parent 8724961 commit f96f30f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 26 deletions.
6 changes: 1 addition & 5 deletions src/app/_components/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ import { draftMode } from "next/headers";

import { ButtonLink } from "@/common/button";
import { Pump } from "basehub/react-pump";
import {
buttonFragment,
darkLightImageFragment,
optimizedImageFragment,
} from "@/lib/basehub/fragments";
import { buttonFragment } from "@/lib/basehub/fragments";
import { fragmentOn } from "basehub";

import { DesktopMenu, MobileMenu } from "./navigation-menu";
Expand Down
20 changes: 1 addition & 19 deletions src/app/_components/header/navigation-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
NavigationMenuTrigger,
type NavigationMenuLinkProps,
} from "@radix-ui/react-navigation-menu";
import { useSelectedLayoutSegment } from "next/navigation";
import { Button, ButtonLink } from "@/common/button";
import { isPageReferenceComponent } from ".basehub/schema";
import type { HeaderFragment, HeaderLiksFragment } from ".";
Expand Down Expand Up @@ -144,23 +143,6 @@ export function DesktopMenu({ navbar, ctaS }: HeaderFragment) {

export function MobileMenu({ ctaS, navbar }: HeaderFragment) {
const { handleToggle, isOn, handleOff } = useToggleState();
const selectedLayoutSegment = useSelectedLayoutSegment();

const headerLinks = React.useMemo(() => {
return navbar.items.map((link) => ({
...link,
isActive: link.sublinks.items.length
? (segment: string) =>
link.sublinks.items.some((sublink) =>
sublink.link.__typename === "PageReferenceComponent"
? sublink.link.page.pathname.split("/").pop() === segment
: sublink.link.text === segment,
)
: link.href
? link.href.split("/")[1] === selectedLayoutSegment
: undefined,
}));
}, [navbar, selectedLayoutSegment]);

return (
<>
Expand All @@ -175,7 +157,7 @@ export function MobileMenu({ ctaS, navbar }: HeaderFragment) {
<div className="fixed left-0 top-[calc(var(--header-height)+1px)] z-10 h-auto w-full bg-surface-primary dark:bg-dark-surface-primary">
<div className="flex flex-col gap-8 px-6 py-8">
<nav className="flex flex-col gap-4">
{headerLinks.map((link) =>
{navbar.items.map((link) =>
link.sublinks.items.length > 0 ? (
<ItemWithSublinks
key={link._id}
Expand Down
4 changes: 3 additions & 1 deletion src/app/_sections/companies/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ type Companies = fragmentOn.infer<typeof companiesFragment>;
export function Companies(props: Companies) {
return (
<Section container="full">
<h2 className="text-center text-dark-text-tertiary opacity-50">{props.subtitle}</h2>
<h2 className="text-center tracking-tight text-dark-text-tertiary opacity-50">
{props.subtitle}
</h2>
<div className="no-scrollbar flex max-w-full justify-center overflow-auto">
<div className="pointer-events-none absolute left-0 top-0 h-full w-[30vw] bg-transparent bg-gradient-to-r from-surface-primary dark:from-dark-surface-primary xl:hidden" />
<div className="pointer-events-none absolute right-0 top-0 h-full w-[30vw] bg-transparent bg-gradient-to-l from-surface-primary dark:from-dark-surface-primary xl:hidden" />
Expand Down
2 changes: 1 addition & 1 deletion src/app/_sections/testimonials/slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export function VainillaCard({ quote, author }: TestimonialsSlider["quotes"][0])
<div className="min-w-0 max-w-full shrink-0 grow-0 basis-[min(740px,100%)] self-stretch md:pr-10">
<article className="embla__slide flex h-full w-full min-w-0 transform touch-pan-y touch-pinch-zoom select-none flex-col rounded-xl border border-border [backface-visibility:hidden] last:!visible dark:border-dark-border">
<div className="flex flex-1 items-start border-b border-border px-5 py-[18px] dark:border-dark-border md:px-8 md:py-7">
<blockquote className="text-pretty text-xl font-extralight leading-snug text-text-primary dark:text-dark-text-primary sm:text-2xl md:text-4xl">
<blockquote className="text-pretty text-xl font-extralight leading-[135%] text-text-primary dark:text-dark-text-primary sm:text-2xl md:text-4xl">
{quote}
</blockquote>
</div>
Expand Down

0 comments on commit f96f30f

Please sign in to comment.