propose-link.tsx
This file
Path
apps/web/src/features/propose/propose-link.tsx
32 lines · 1.0 KiB · TypeScript
Last changed by
Merge build/comments-web-features into mainoscabrielbefore adoption74bfc72
History of this fileTake it
Merge branch 'build/911-web-propose-and-proposal'oscabrielbefore adoptionbcb4cd9
line 1why, one step back1/**Merge build/comments-web-features into mainoscabrielbefore adoption74bfc72
lines 2–3why, one step back2 * Who is signed in is the browser's to learn, after the first paint, so the3 * server renders no link and the browser adds it.Merge branch 'build/911-web-propose-and-proposal'oscabrielbefore adoptionbcb4cd9
lines 4–15why, one step back4 */5import { useAtomValue } from "@effect/atom-react";6import type { ProjectName } from "@repo/protocol/ids";7import { Option } from "effect";8import { AsyncResult } from "effect/reactivity";9import { MessageSquarePlus } from "lucide-react";1011import { whoAtom } from "../auth/who.ts";12import { proposeFormPath } from "./propose-view.tsx";1314export const ProposeLink = ({ project }: { readonly project: ProjectName }) => (15 <aMerge build/1224-decider-pagesoscabrielbefore adoptiond22b7a2
line 16why, one step back16 className="text-ui decoration-rule flex w-fit items-center gap-2 font-medium underline hover:decoration-current"Merge branch 'build/911-web-propose-and-proposal'oscabrielbefore adoptionbcb4cd9
lines 17–32why, one step back17 data-propose=""18 href={proposeFormPath(project)}19 >20 <MessageSquarePlus aria-hidden="true" className="size-4 shrink-0" />21 Propose an ask22 </a>23);2425export const SignedInProposeLink = ({26 project,27}: {28 readonly project: ProjectName;29}) =>30 Option.isSome(Option.flatten(AsyncResult.value(useAtomValue(whoAtom)))) ? (31 <ProposeLink project={project} />32 ) : null;