feat: minimum assets filter in potential albums list
Signed-off-by: Varun Raj <varun@skcript.com>
This commit is contained in:
1 parent
0715257048
commit
f17356252d
10 files changed
+187
-145
No files matched your search
@@ -20,6 +20,15 @@ export default function AssetGrid({ assets, isInternal = true, selectable = fals
|
||||
const [selectedIds, setSelectedIds] = useState<string[]>([]);
|
||||
const [lastSelectedIndex, setLastSelectedIndex] = useState(-1);
|
||||
|
||||
|
||||
const handleClick = (index: number, asset: IAsset, event: React.MouseEvent<HTMLElement>) => {
|
||||
if (selectedIds.length > 0) {
|
||||
handleSelect(index, asset, event);
|
||||
} else {
|
||||
setIndex(index);
|
||||
}
|
||||
}
|
||||
|
||||
const handleSelect = (_idx: number, asset: IAsset, event: React.MouseEvent<HTMLElement>) => {
|
||||
|
||||
event.stopPropagation();
|
||||
@@ -55,13 +64,13 @@ export default function AssetGrid({ assets, isInternal = true, selectable = fals
|
||||
type: (asset.type === "VIDEO" ? "video" : "image") as any,
|
||||
sources:
|
||||
asset.type === "VIDEO"
|
||||
? [
|
||||
{
|
||||
src: asset.downloadUrl as string,
|
||||
type: "video/mp4",
|
||||
},
|
||||
]
|
||||
: undefined,
|
||||
? [
|
||||
{
|
||||
src: asset.downloadUrl as string,
|
||||
type: "video/mp4",
|
||||
},
|
||||
]
|
||||
: undefined,
|
||||
height: asset.exifImageHeight as number,
|
||||
width: asset.exifImageWidth as number,
|
||||
downloadUrl: asset.downloadUrl as string,
|
||||
@@ -104,7 +113,7 @@ export default function AssetGrid({ assets, isInternal = true, selectable = fals
|
||||
/>
|
||||
<Gallery
|
||||
images={images}
|
||||
onClick={setIndex}
|
||||
onClick={handleClick}
|
||||
enableImageSelection={selectable}
|
||||
thumbnailImageComponent={LazyGridImage}
|
||||
onSelect={handleSelect}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { useConfig } from "@/contexts/ConfigContext";
|
||||
import { logoutUser } from "@/handlers/api/user.handler"
|
||||
import { useCurrentUser } from "@/contexts/CurrentUserContext";
|
||||
import { useToast } from "../ui/use-toast";
|
||||
import { HandshakeIcon } from "lucide-react";
|
||||
|
||||
export default function ProfileInfo() {
|
||||
const { updateContext, ...user } = useCurrentUser()
|
||||
@@ -36,11 +37,19 @@ export default function ProfileInfo() {
|
||||
{user && (
|
||||
<>
|
||||
<p className="text-sm">{user?.name}</p>
|
||||
{!user.isUsingAPIKey && (
|
||||
<Button variant="destructive" className="mx-4 h-6 text-xs" onClick={handleLogout}>
|
||||
Log Out
|
||||
</Button>
|
||||
)}
|
||||
<div className="flex items-center justify-between gap-2 px-2">
|
||||
{!user.isUsingAPIKey && (
|
||||
<Button variant="destructive" className="h-6 flex-1 text-xs" onClick={handleLogout}>
|
||||
Log Out
|
||||
</Button>
|
||||
)}
|
||||
<Button asChild variant="secondary" className="h-6 flex-1 text-xs flex items-center justify-center gap-2" onClick={handleLogout}>
|
||||
<Link href="https://buymeacoffee.com/varunraj" target="_blank">
|
||||
<HandshakeIcon className="w-4 h-4" />
|
||||
Support
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user