Skip to content

Commit

Permalink
feat: add video support
Browse files Browse the repository at this point in the history
  • Loading branch information
danilaplee committed Jan 23, 2025
1 parent 4a7457f commit f727ed2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pexels-grid/src/components/GalleryController.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ import { useQuery } from "@tanstack/react-query";
import { useSearchParams, useRouter } from "next/navigation";
import { Photo, Video } from "pexels";
import { useEffect } from "react";
const getVisibleBuffer = () => (window.innerWidth > 700 ? 7000 : 3000);
const getVisibleBuffer = () => (typeof window !== undefined ? window.innerWidth > 700 ? 7000 : 3000 : 3000);
const getColumnWidth = () => {
if(typeof window === undefined) {
return 640
}
let columnWidth =
window.innerWidth < 1536 ? window.innerWidth * 0.33 : window.innerWidth / 4;
if (window.innerWidth < 1280) columnWidth = window.innerWidth / 2;
Expand Down

0 comments on commit f727ed2

Please sign in to comment.