Skip to content

Commit

Permalink
fix: mobile responsiveness for add to list dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
OgDev-01 committed Oct 11, 2023
1 parent 705cfa9 commit fda8d3a
Showing 1 changed file with 33 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Image from "next/image";

import { TfiMoreAlt } from "react-icons/tfi";
import { HiUserAdd } from "react-icons/hi";
import { SlUserFollowing } from "react-icons/sl";
import { SignInWithOAuthCredentials, User } from "@supabase/supabase-js";
import { usePostHog } from "posthog-js/react";
import { clsx } from "clsx";
Expand Down Expand Up @@ -166,18 +167,38 @@ const ContributorProfileHeader = ({
!isOwner && (
<>
{isFollowing ? (
<Button
onClick={handleFollowClick}
variant="primary"
className="group w-[6.25rem] justify-center items-center"
>
<span className="hidden text-center sm:block group-hover:hidden">Following</span>
<span className="block text-center sm:hidden group-hover:block">Unfollow</span>
</Button>
<>
<Button
onClick={handleFollowClick}
variant="primary"
className="group w-[6.25rem] justify-center items-center hidden md:flex"
>
<span className="hidden text-center sm:block group-hover:hidden">Following</span>
<span className="block text-center sm:hidden group-hover:block">Unfollow</span>
</Button>
<button
className="p-2 text-white rounded-lg md:hidden bg-sauced-orange"
onClick={handleFollowClick}
>
<SlUserFollowing className="text-xl" />
</button>
</>
) : (
<Button variant="primary" className="w-[6.25rem] text-center" onClick={handleFollowClick}>
<HiUserAdd fontSize={20} className="mr-1" /> Follow
</Button>
<>
<Button
variant="primary"
className="w-[6.25rem] text-center hidden md:flex"
onClick={handleFollowClick}
>
<HiUserAdd fontSize={20} className="mr-1" /> Follow
</Button>
<button
onClick={handleFollowClick}
className="p-2 text-white rounded-lg md:hidden bg-sauced-orange"
>
<HiUserAdd className="text-xl font-bold" />
</button>
</>
)}
</>
)
Expand Down Expand Up @@ -269,8 +290,6 @@ const ContributorProfileHeader = ({
</DropdownMenuContent>
</DropdownMenu>
</div>

{/* Mobile dropdown menu */}
</div>
)}
</div>
Expand Down Expand Up @@ -393,7 +412,7 @@ const AddToListDropdown = ({ username }: { username: string }) => {
</Link>
</div>
}
className="w-10 px-4"
className="w-10 md:px-4 max-sm:text-sm"
placeholder="Add to list"
options={listOptions}
selected={selectedList}
Expand Down

0 comments on commit fda8d3a

Please sign in to comment.