fix: responsiveness (mobile)

This commit is contained in:
rizaldy 2024-01-31 02:44:12 +07:00
parent bf05a8488e
commit 9868e42f31
3 changed files with 18 additions and 15 deletions

View File

@ -3,11 +3,15 @@ import Link from "next/link";
import { YEAR_TO_BUMP } from "../constants"; import { YEAR_TO_BUMP } from "../constants";
const Footer = ({ license, links, repo, commitID }) => ( const Footer = ({ license, links, repo, commitID }) => (
<footer className="flex items-center justify-between flex-wrap py-4 text-center mt-10"> <footer className="flex py-4 text-center md:mt-10 mt-5">
<div className="w-10/12 md:w-7/12 mx-auto font-semibold"> <div className="md:w-7/12 mx-auto font-semibold">
<div className="text-sm mb-10"> <div className="md:text-sm mb-10">
{links.map(({ url, label }) => ( {links.map(({ url, label }) => (
<Link key={url + label} href={url} className="mx-4"> <Link
key={url + label}
href={url}
className="md:mx-4 mb-1 md:inline block"
>
{label} {label}
</Link> </Link>
))} ))}

View File

@ -12,8 +12,7 @@ const OverlayContent = ({ overlayContent }) => {
} else if (overlayContent?.type === MEDIA_TYPE.VIDEOS) { } else if (overlayContent?.type === MEDIA_TYPE.VIDEOS) {
return ( return (
<iframe <iframe
width="50%" className="md:w-6/12 w-full h-1/2"
height="50%"
allow="fullscreen" allow="fullscreen"
sandbox="allow-same-origin allow-scripts allow-popups" sandbox="allow-same-origin allow-scripts allow-popups"
src={overlayContent?.url} src={overlayContent?.url}
@ -30,14 +29,14 @@ const Overlay = ({ overlayContent, closeOverlay }) => {
onClick={closeOverlay} onClick={closeOverlay}
className={`${ className={`${
isOverlayOpen isOverlayOpen
? "bg-neutral-800/95 fixed w-screen h-screen left-0 top-0 cursor-pointer" ? "bg-neutral-800/95 fixed w-full h-full left-0 top-0 cursor-pointer"
: "" : ""
}`} }`}
> >
{isOverlayOpen ? ( {isOverlayOpen ? (
<p <p
onClick={closeOverlay} onClick={closeOverlay}
className="fixed right-0 bottom-0 m-5 text-white rounded text-sm" className="fixed right-0 bottom-0 md:mx-5 my-5 text-white rounded text-sm text-center md:text-right w-full"
> >
Click anywhere or press "Escape" to close Click anywhere or press "Escape" to close
</p> </p>
@ -45,7 +44,7 @@ const Overlay = ({ overlayContent, closeOverlay }) => {
<div <div
className={`flex justify-center items-center ${ className={`flex justify-center items-center ${
isOverlayOpen ? "h-screen w-screen" : "h-0 w-0" isOverlayOpen ? "h-full w-full" : "h-0 w-0"
}`} }`}
> >
<OverlayContent overlayContent={overlayContent} /> <OverlayContent overlayContent={overlayContent} />

View File

@ -1,18 +1,18 @@
const Profile = ({ profile, totalPosts }) => ( const Profile = ({ profile, totalPosts }) => (
<div className="flex flex-warp"> <div className="flex flex-warp">
<div className="lg:w-4/12 w-3/12 md:py-10 lg:px-20 md:px-10"> <div className="lg:w-4/12 w-3/12 md:py-10 ml-3 md:ml-0 lg:px-20 md:px-10">
<img <img
alt={profile.display_name} alt={profile.display_name}
src={profile.avatar} src={profile.avatar}
className="w-100 rounded-full mx-auto border border-gray-200 p-1" className="w-100 rounded-full mx-auto border border-gray-200 p-1"
/> />
</div> </div>
<div className="lg:w-9/12 md:w-10/12 px-10 mb-5 md:p-5"> <div className="lg:w-9/12 md:w-10/12 mb-5 md:p-5 ml-5">
<div className="flex items-center"> <div className="md:flex items-center">
<h2 className="text-2xl font-semibold">{profile.username}</h2> <h2 className="text-2xl font-semibold">{profile.username}</h2>
<div className="ml-4"> <div className="md:ml-4 my-4">
<a <a
className="rounded-md bg-gray-100 px-5 font-semibold py-2 ml-2 text-sm leading-relaxed" className="rounded-md bg-gray-100 px-5 font-semibold py-2 md:ml-2 text-sm leading-relaxed"
href={profile.follow_url} href={profile.follow_url}
> >
Follow Follow
@ -25,7 +25,7 @@ const Profile = ({ profile, totalPosts }) => (
</a> </a>
</div> </div>
</div> </div>
<div className="my-5 font-bold text-sm"> <div className="md:my-5 my-3 font-bold text-sm">
<p>{totalPosts} posts</p> <p>{totalPosts} posts</p>
</div> </div>
<p className="font-bold mb-1">{profile.display_name}</p> <p className="font-bold mb-1">{profile.display_name}</p>