better search btn

This commit is contained in:
zmeyer44 2023-10-20 18:26:53 -04:00
parent a4ec0aed01
commit d30e325ec4
4 changed files with 18 additions and 6 deletions

View File

@ -3,16 +3,28 @@
import { Input } from "@/components/ui/input"; import { Input } from "@/components/ui/input";
import { commandDialogAtom } from "./CommandDialog"; import { commandDialogAtom } from "./CommandDialog";
import { useAtom } from "jotai"; import { useAtom } from "jotai";
import { Button } from "@/components/ui/button";
export default function Search() { export default function Search() {
const [open, setOpen] = useAtom(commandDialogAtom); const [open, setOpen] = useAtom(commandDialogAtom);
return ( return (
<div> <div>
<Input {/* <Input
type="search" type="search"
placeholder="Search..." placeholder="Search..."
className="sm:w-[200px] lg:w-[300px]" className="sm:w-[200px] lg:w-[300px]"
onFocus={() => setOpen(true)} onFocus={() => setOpen(true)}
/> /> */}
<Button
onClick={() => setOpen(true)}
variant={"outline"}
className="items-center justify-start rounded-sm text-muted-foreground sm:pr-12 md:w-40 lg:w-64"
>
<span className="hidden lg:inline-flex">Search...</span>
<span className="inline-flex lg:hidden">Search...</span>
<kbd className="pointer-events-none absolute right-1.5 top-1.5 hidden h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 sm:flex">
<span className="text-xs"></span>K
</kbd>
</Button>
</div> </div>
); );
} }

View File

@ -9,7 +9,7 @@ export default function EventMention({ mention }: EventMentionProps) {
// const { user } = useProfile(mention); // const { user } = useProfile(mention);
return ( return (
<Link href={`/${mention}`}> <Link href={`/${mention}`}>
<span className="text-primary-foreground hover:underline">{`*\$${mention}`}</span> <span className="text-primary hover:underline">{`*\$${mention}`}</span>
</Link> </Link>
); );
} }

View File

@ -27,7 +27,7 @@ export default function ProfileMention({ mention }: ProfileMentionProps) {
const profile = getProfile(mention); const profile = getProfile(mention);
return ( return (
<Link href={`/${mention}`}> <Link href={`/${mention}`}>
<span className="text-primary-foreground hover:underline">{`@${ <span className="text-primary hover:underline">{`@${
profile?.name ?? mention profile?.name ?? mention
}`}</span> }`}</span>
</Link> </Link>

View File

@ -30,7 +30,7 @@ const RenderText = ({ text }: { text?: string }) => {
if (specialValuesArray[index]?.match(urlRegex)) { if (specialValuesArray[index]?.match(urlRegex)) {
specialElement = ( specialElement = (
<a <a
className="text-primary-foreground hover:underline" className="text-primary hover:underline"
href={cleanUrl(specialValuesArray[index])} href={cleanUrl(specialValuesArray[index])}
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
@ -43,7 +43,7 @@ const RenderText = ({ text }: { text?: string }) => {
} else if (specialValuesArray[index]?.match(hashtagRegex)) { } else if (specialValuesArray[index]?.match(hashtagRegex)) {
specialElement = ( specialElement = (
<Link href={`/?t=${specialValuesArray[index]?.substring(1)}`}> <Link href={`/?t=${specialValuesArray[index]?.substring(1)}`}>
<span className="break-words text-primary-foreground hover:underline"> <span className="break-words text-primary hover:underline">
{specialValuesArray[index]} {specialValuesArray[index]}
</span> </span>
</Link> </Link>