fix: width styling of tag missing location dialog recent searches
This commit is contained in:
1 parent
7e48837c95
commit
0d93734183
2 files changed
+8
-7
No files matched your search
@@ -1,6 +1,5 @@
|
|||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { cn } from "@/lib/utils";
|
import { getRecentSearchesByType, RecentSearch, cn } from "@/lib/utils";
|
||||||
import { getRecentSearchesByType, RecentSearch } from "@/lib/utils";
|
|
||||||
import { IPlace } from "@/types/common";
|
import { IPlace } from "@/types/common";
|
||||||
import { Clock, MapPin } from "lucide-react";
|
import { Clock, MapPin } from "lucide-react";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
@@ -9,9 +8,10 @@ interface RecentSearchesProps {
|
|||||||
searchType: RecentSearch['searchType'];
|
searchType: RecentSearch['searchType'];
|
||||||
onSelect: (place: IPlace) => void;
|
onSelect: (place: IPlace) => void;
|
||||||
selectedPlace?: IPlace | null;
|
selectedPlace?: IPlace | null;
|
||||||
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function RecentSearches({ searchType, onSelect, selectedPlace }: RecentSearchesProps) {
|
export default function RecentSearches({ searchType, onSelect, selectedPlace, className }: RecentSearchesProps) {
|
||||||
const recentSearches = getRecentSearchesByType(searchType);
|
const recentSearches = getRecentSearchesByType(searchType);
|
||||||
|
|
||||||
if (recentSearches.length === 0) {
|
if (recentSearches.length === 0) {
|
||||||
@@ -32,7 +32,7 @@ export default function RecentSearches({ searchType, onSelect, selectedPlace }:
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mb-4">
|
<div className={cn("mb-4", className)}>
|
||||||
<div className="flex items-center gap-2 mb-3">
|
<div className="flex items-center gap-2 mb-3">
|
||||||
<Clock className="h-4 w-4 text-muted-foreground" />
|
<Clock className="h-4 w-4 text-muted-foreground" />
|
||||||
<h3 className="text-sm font-medium text-muted-foreground">Recent Searches</h3>
|
<h3 className="text-sm font-medium text-muted-foreground">Recent Searches</h3>
|
||||||
@@ -60,7 +60,7 @@ export default function RecentSearches({ searchType, onSelect, selectedPlace }:
|
|||||||
<div className="flex-1 min-w-0">
|
<div className="flex-1 min-w-0">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<MapPin className="h-3 w-3 text-muted-foreground flex-shrink-0" />
|
<MapPin className="h-3 w-3 text-muted-foreground flex-shrink-0" />
|
||||||
<p className="text-sm truncate">{search.name}</p>
|
<p className="text-sm line-clamp-2">{search.name}</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center justify-between mt-1">
|
<div className="flex items-center justify-between mt-1">
|
||||||
<span className="text-xs text-muted-foreground">
|
<span className="text-xs text-muted-foreground">
|
||||||
|
|||||||
+3
-2
@@ -54,7 +54,7 @@ export default function TagMissingLocationDialog({
|
|||||||
Tagging a location will add the location to the selected {selectedIds.length} asset(s).
|
Tagging a location will add the location to the selected {selectedIds.length} asset(s).
|
||||||
</DialogDescription>
|
</DialogDescription>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
<Tabs defaultValue="searchOsm" className="border rounded-lg">
|
<Tabs defaultValue="searchOsm" className="border rounded-lg min-w-0 max-w-full">
|
||||||
<TabsList className="flex justify-between">
|
<TabsList className="flex justify-between">
|
||||||
<TabsTrigger value="searchOsm" className="w-full">Open Street Map</TabsTrigger>
|
<TabsTrigger value="searchOsm" className="w-full">Open Street Map</TabsTrigger>
|
||||||
<TabsTrigger value="search" className="w-full">Immich Geo</TabsTrigger>
|
<TabsTrigger value="search" className="w-full">Immich Geo</TabsTrigger>
|
||||||
@@ -71,7 +71,7 @@ export default function TagMissingLocationDialog({
|
|||||||
<TagMissingLocationSearchLatLong onSubmit={onSubmit} onOpenChange={setOpen} location={mapPosition} onLocationChange={setMapPosition} />
|
<TagMissingLocationSearchLatLong onSubmit={onSubmit} onOpenChange={setOpen} location={mapPosition} onLocationChange={setMapPosition} />
|
||||||
</TabsContent>
|
</TabsContent>
|
||||||
<TabsContent value="maps">
|
<TabsContent value="maps">
|
||||||
<div className="flex flex-col gap-6 items-center ">
|
<div className="flex flex-col gap-6 items-center min-w-0 max-w-full py-4">
|
||||||
{/* Recent Searches */}
|
{/* Recent Searches */}
|
||||||
<RecentSearches
|
<RecentSearches
|
||||||
searchType="map"
|
searchType="map"
|
||||||
@@ -79,6 +79,7 @@ export default function TagMissingLocationDialog({
|
|||||||
setMapPosition(place);
|
setMapPosition(place);
|
||||||
}}
|
}}
|
||||||
selectedPlace={mapPosition.name ? mapPosition : null}
|
selectedPlace={mapPosition.name ? mapPosition : null}
|
||||||
|
className="w-[500px]" // Matching the width of the map
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<LazyMap location={{
|
<LazyMap location={{
|
||||||
|
|||||||
Reference in new issue
Block a user