improved responsiveness

This commit is contained in:
daniel31x13 2024-01-15 03:39:53 -05:00
parent ee3dca92cd
commit 23f4142414
4 changed files with 14 additions and 24 deletions

View File

@ -11,6 +11,7 @@ import LinkDate from "@/components/LinkViews/LinkComponents/LinkDate";
import LinkCollection from "@/components/LinkViews/LinkComponents/LinkCollection"; import LinkCollection from "@/components/LinkViews/LinkComponents/LinkCollection";
import LinkIcon from "@/components/LinkViews/LinkComponents/LinkIcon"; import LinkIcon from "@/components/LinkViews/LinkComponents/LinkIcon";
import Link from "next/link"; import Link from "next/link";
import { isPWA } from "@/lib/client/utils";
type Props = { type Props = {
link: LinkIncludingShortenedCollectionAndTags; link: LinkIncludingShortenedCollectionAndTags;
@ -52,16 +53,16 @@ export default function LinkCardCompact({ link, count, className }: Props) {
<> <>
<div <div
className={`border-neutral-content relative ${ className={`border-neutral-content relative ${
!showInfo ? "hover:bg-base-300" : "" !showInfo && !isPWA() ? "hover:bg-base-300 p-3" : "py-3"
} duration-200 rounded-lg`} } duration-200 rounded-lg`}
> >
<Link <Link
href={link.url || ""} href={link.url || ""}
target="_blank" target="_blank"
className="flex items-center cursor-pointer py-3 px-3" className="flex items-start cursor-pointer"
> >
<div className="shrink-0"> <div className="shrink-0">
<LinkIcon link={link} width="sm:w-12 w-8" /> <LinkIcon link={link} width="sm:w-12 w-8 mt-1 sm:mt-0" />
</div> </div>
<div className="w-[calc(100%-56px)] ml-2"> <div className="w-[calc(100%-56px)] ml-2">
@ -70,16 +71,13 @@ export default function LinkCardCompact({ link, count, className }: Props) {
</p> </p>
<div className="mt-1 flex flex-col sm:flex-row sm:items-center gap-2 text-xs text-neutral"> <div className="mt-1 flex flex-col sm:flex-row sm:items-center gap-2 text-xs text-neutral">
<div className="flex items-center gap-2"> <div className="flex items-center gap-x-3 w-fit text-neutral flex-wrap">
{collection ? ( {collection ? (
<> <LinkCollection link={link} collection={collection} />
<LinkCollection link={link} collection={collection} />
&middot;
</>
) : undefined} ) : undefined}
{link.url ? ( {link.url ? (
<div className="flex items-center gap-1 max-w-full w-fit text-neutral"> <div className="flex items-center gap-1 w-fit text-neutral truncate">
<i className="bi-link-45deg text-base" /> <i className="bi-link-45deg text-lg" />
<p className="truncate w-full">{shortendURL}</p> <p className="truncate w-full">{shortendURL}</p>
</div> </div>
) : ( ) : (
@ -87,9 +85,8 @@ export default function LinkCardCompact({ link, count, className }: Props) {
{link.type} {link.type}
</div> </div>
)} )}
<LinkDate link={link} />
</div> </div>
<span className="hidden sm:block">&middot;</span>
<LinkDate link={link} />
</div> </div>
</div> </div>
</Link> </Link>

View File

@ -217,10 +217,7 @@ export default function PreservedFormatsModal({ onClose, activeLink }: Props) {
<i className="bi-box-arrow-up-right" /> <i className="bi-box-arrow-up-right" />
</Link> </Link>
{link?.collection.ownerId === session.data?.user.id ? ( {link?.collection.ownerId === session.data?.user.id ? (
<div <div className={`btn btn-outline`} onClick={() => updateArchive()}>
className={`btn w-1/2 btn-outline`}
onClick={() => updateArchive()}
>
<div> <div>
<p>Refresh Preserved Formats</p> <p>Refresh Preserved Formats</p>
<p className="text-xs"> <p className="text-xs">

View File

@ -46,7 +46,7 @@ export default function MainLayout({ children }: Props) {
</div> </div>
<div <div
className={`w-full flex flex-col min-h-${ className={`w-full pb-40 flex flex-col min-h-${
showAnnouncement ? "full" : "screen" showAnnouncement ? "full" : "screen"
} lg:ml-80 ${showAnnouncement ? "mt-10" : ""}`} } lg:ml-80 ${showAnnouncement ? "mt-10" : ""}`}
> >

View File

@ -2,7 +2,6 @@ import useLinkStore from "@/store/links";
import useCollectionStore from "@/store/collections"; import useCollectionStore from "@/store/collections";
import useTagStore from "@/store/tags"; import useTagStore from "@/store/tags";
import MainLayout from "@/layouts/MainLayout"; import MainLayout from "@/layouts/MainLayout";
import LinkCard from "@/components/LinkViews/LinkCard";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import useLinks from "@/hooks/useLinks"; import useLinks from "@/hooks/useLinks";
import Link from "next/link"; import Link from "next/link";
@ -279,14 +278,11 @@ export default function Dashboard() {
> >
{links.some((e) => e.pinnedBy && e.pinnedBy[0]) ? ( {links.some((e) => e.pinnedBy && e.pinnedBy[0]) ? (
<div className="w-full"> <div className="w-full">
<div <LinkComponent
className={`grid min-[1900px]:grid-cols-4 xl:grid-cols-3 sm:grid-cols-2 grid-cols-1 gap-5 w-full`} links={links
>
{links
.filter((e) => e.pinnedBy && e.pinnedBy[0]) .filter((e) => e.pinnedBy && e.pinnedBy[0])
.map((e, i) => <LinkCard key={i} link={e} count={i} />)
.slice(0, showLinks)} .slice(0, showLinks)}
</div> />
</div> </div>
) : ( ) : (
<div <div