Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nofurtherinformation committed May 29, 2024
1 parent 08af1b5 commit 73a7fdd
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions components/Select/Select.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
import { ChevronDownIcon, ChevronUpIcon } from "@radix-ui/react-icons"
import * as Select from "@radix-ui/react-select"
import React from "react"
import "./styles.css"

type SelectProps = {
title: string
value: string
children: React.ReactNode,
children: React.ReactNode
onValueChange: (e: any) => void
}
export const SelectMenu: React.FC<SelectProps> = ({ title, value, children, onValueChange }) => (
<Select.Root onValueChange={onValueChange}>
<Select.Trigger className="SelectTrigger" aria-label="Food">
<Select.Trigger
className="inline-flex
h-[35px] items-center justify-center gap-[5px]
z-0 mb-[-1px] mr-[-1px] max-w-full border-[1px] border-solid border-neutral-300 p-1 text-sm
focus:border-b-4 focus:shadow-[0_0_-5px_5px] focus:shadow-blackA5 focus:outline-none
bg-white px-[15px] text-[13px] leading-none text-neutral-700 shadow-[0_2px_10px] shadow-black/10 outline-none hover:bg-mauve3 data-[placeholder]:text-violet9"
aria-label="Food"
>
<Select.Value placeholder={value || title} />
<Select.Icon className="SelectIcon">
<Select.Icon className="size-4">
<ChevronDownIcon />
</Select.Icon>
</Select.Trigger>
<Select.Portal>
<Select.Content className="SelectContent">
<Select.ScrollUpButton className="SelectScrollButton">
<Select.Content className="
overflow-hidden rounded-md bg-white border-2 border-neutral-300 shadow-[0px_10px_38px_-10px_rgba(22,_23,_24,_0.35),0px_10px_20px_-15px_rgba(22,_23,_24,_0.2)]
">
<Select.ScrollUpButton className="flex h-[25px] cursor-default items-center justify-center bg-white text-violet11">
<ChevronUpIcon />
</Select.ScrollUpButton>
<Select.Viewport className="SelectViewport">{children}</Select.Viewport>
<Select.ScrollDownButton className="SelectScrollButton">
<Select.Viewport className="p-[5px]">{children}</Select.Viewport>
<Select.ScrollDownButton className="flex h-[25px] cursor-default items-center justify-center bg-white text-violet11">
<ChevronDownIcon />
</Select.ScrollDownButton>
</Select.Content>
Expand Down

0 comments on commit 73a7fdd

Please sign in to comment.