Skip to content

Commit

Permalink
fix: Add icons back and proper spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
devcshort committed Oct 15, 2024
1 parent 605e708 commit f81ce24
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/shared/components/search/location-search-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ export function LocationSearchBar({ className }: LocationSearchBarProps) {
return [
...additionalLocations.map((loc) => ({
value: loc.address,
icon: NavigationIcon,
Icon: NavigationIcon,
})),
...locations.map((loc) => ({
value: loc.address,
icon: NavigationIcon,
Icon: NavigationIcon,
})),
];
}, [locations, additionalLocations]);
Expand Down
10 changes: 7 additions & 3 deletions src/shared/components/ui/autocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,9 @@ export function Autocomplete(props: AutocompleteProps) {
}, []);

return (
<div className={cn('relative flex items-center border-b px-3', className)}>
<div
className={cn('relative flex items-center border-b px-3 py-1', className)}
>
{Icon ? (
<Icon className="mr-2 h-4 w-4 shrink-0 opacity-50" />
) : (
Expand Down Expand Up @@ -482,7 +484,7 @@ export function Autocomplete(props: AutocompleteProps) {
id={`${uniqueId}-option-${option.index}`}
role="option"
className={cn(
'ml-1 mr-1 flex justify-between gap-2 p-1 px-3 py-1 pl-2 pr-2 text-sm',
'flex justify-between gap-2 px-3 py-1',
currentIndex === option.index && 'bg-primary/5',
)}
aria-selected={currentIndex === option.index}
Expand All @@ -491,7 +493,9 @@ export function Autocomplete(props: AutocompleteProps) {
onMouseDown={handleValueSelect(option.value)}
>
<span className="flex items-center gap-2">
{Icon === 'span' ? null : <Icon className="size-4" />}
{Icon === 'span' ? null : (
<Icon className="size-4 shrink-0" />
)}
<p>
{parse(option.value, matches).map((text, idx) =>
text.highlight ? (
Expand Down
18 changes: 9 additions & 9 deletions src/shared/components/ui/input.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react"
import * as React from 'react';

import { cn } from "@/shared/lib/utils"
import { cn } from '@/shared/lib/utils';

export interface InputProps
extends React.InputHTMLAttributes<HTMLInputElement> {}
Expand All @@ -11,15 +11,15 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
<input
type={type}
className={cn(
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
className
'flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
className,
)}
ref={ref}
{...props}
/>
)
}
)
Input.displayName = "Input"
);
},
);
Input.displayName = 'Input';

export { Input }
export { Input };
6 changes: 3 additions & 3 deletions src/shared/components/ui/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const SelectTrigger = React.forwardRef<
<SelectPrimitive.Trigger
ref={ref}
className={cn(
'flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',
'flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',
className,
)}
{...props}
Expand Down Expand Up @@ -110,7 +110,7 @@ const SelectLabel = React.forwardRef<
>(({ className, ...props }, ref) => (
<SelectPrimitive.Label
ref={ref}
className={cn('px-2 py-1.5 text-sm font-semibold', className)}
className={cn('px-2 py-1.5 font-semibold', className)}
{...props}
/>
));
Expand All @@ -123,7 +123,7 @@ const SelectItem = React.forwardRef<
<SelectPrimitive.Item
ref={ref}
className={cn(
'relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
'relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
className,
)}
{...props}
Expand Down

0 comments on commit f81ce24

Please sign in to comment.