Skip to content

Commit

Permalink
fix responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
thaian1234 committed Dec 15, 2024
1 parent 6484f66 commit 5c74d93
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/(main)/search/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export default function SearchPage() {

return (
<section className="relative">
<div className="fixed right-10 flex min-w-72 items-center justify-center rounded-lg border border-slate-500 bg-black-1 p-3">
<div className="fixed right-10 z-50 flex min-w-72 items-center justify-center rounded-lg border border-slate-500 bg-black-1 p-3">
<CategoryFilter />
</div>
<Tabs defaultValue="All" className="w-full space-y-12 px-20">
Expand Down
15 changes: 13 additions & 2 deletions lib/components/profile/search/user-preview-card.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Users } from "lucide-react";
import { useRouter } from "next/navigation";
import { useMediaQuery, useScreen } from "usehooks-ts";

import { ROUTES } from "@/lib/configs/routes.config";
import { FollowButton } from "@/lib/features/follow/components/follow-button";
import { useAuth } from "@/lib/providers/auth-provider";

import { Badge } from "@/components/ui/badge";
import { Card, CardContent } from "@/components/ui/card";
Expand All @@ -26,6 +26,7 @@ export function UserPreviewCard({
isFollow,
}: UserPreviewCardProps) {
const router = useRouter();
const desktopScreen = useMediaQuery("(min-width: 1280px)");

const handleNavigateLive = () => {
router.push(ROUTES.STREAM_PAGE(username));
Expand Down Expand Up @@ -54,9 +55,19 @@ export function UserPreviewCard({
<Users className="mr-1 h-4 w-4" />
<span>{followers} Followers</span>
</div>
{!desktopScreen && (
<div className="mt-2">
<FollowButton
followingId={id}
isFollowed={isFollow}
/>
</div>
)}
</div>
</div>
<FollowButton followingId={id} isFollowed={isFollow} />
{desktopScreen && (
<FollowButton followingId={id} isFollowed={isFollow} />
)}
</div>
</CardContent>
</Card>
Expand Down

0 comments on commit 5c74d93

Please sign in to comment.