minor fix
This commit is contained in:
parent
c28c73ce18
commit
d906391ae2
|
@ -1,7 +1,5 @@
|
||||||
import React, { Dispatch, SetStateAction } from "react";
|
import React, { Dispatch, SetStateAction } from "react";
|
||||||
import { Sort } from "@/types/global";
|
import { Sort } from "@/types/global";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
||||||
import { faSort } from "@fortawesome/free-solid-svg-icons";
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
sortBy: Sort;
|
sortBy: Sort;
|
||||||
|
|
|
@ -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/LinkCard";
|
|
||||||
import LinkCard from "@/components/LinkViews/LinkComponents/LinkCard";
|
import LinkCard from "@/components/LinkViews/LinkComponents/LinkCard";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import useLinks from "@/hooks/useLinks";
|
import useLinks from "@/hooks/useLinks";
|
||||||
|
@ -95,9 +94,10 @@ export default function Dashboard() {
|
||||||
return (
|
return (
|
||||||
<MainLayout>
|
<MainLayout>
|
||||||
<div style={{ flex: "1 1 auto" }} className="p-5 flex flex-col gap-5">
|
<div style={{ flex: "1 1 auto" }} className="p-5 flex flex-col gap-5">
|
||||||
<PageHeader icon={'bi-house '} title={'Dashboard'} description={"A brief overview of your data"} />
|
<PageHeader icon={'bi-house '} title={'Dashboard'} description={"A brief overview of your data"}/>
|
||||||
<div>
|
<div>
|
||||||
<div className="flex justify-evenly flex-col md:flex-row md:items-center gap-2 md:w-full h-full rounded-2xl p-8 border border-neutral-content bg-base-200">
|
<div
|
||||||
|
className="flex justify-evenly flex-col md:flex-row md:items-center gap-2 md:w-full h-full rounded-2xl p-8 border border-neutral-content bg-base-200">
|
||||||
<DashboardItem
|
<DashboardItem
|
||||||
name={numberOfLinks === 1 ? "Link" : "Links"}
|
name={numberOfLinks === 1 ? "Link" : "Links"}
|
||||||
value={numberOfLinks}
|
value={numberOfLinks}
|
||||||
|
@ -140,13 +140,13 @@ export default function Dashboard() {
|
||||||
style={{ flex: "0 1 auto" }}
|
style={{ flex: "0 1 auto" }}
|
||||||
className="flex flex-col 2xl:flex-row items-start 2xl:gap-2"
|
className="flex flex-col 2xl:flex-row items-start 2xl:gap-2"
|
||||||
>
|
>
|
||||||
{false && links[0] ? (
|
{links[0] ? (
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div
|
<div
|
||||||
className={`grid 2xl:grid-cols-3 xl:grid-cols-2 grid-cols-1 gap-5 w-full`}
|
className={`grid 2xl:grid-cols-3 xl:grid-cols-2 grid-cols-1 gap-5 w-full`}
|
||||||
>
|
>
|
||||||
{links.slice(0, showLinks).map((e, i) => (
|
{links.slice(0, showLinks).map((e, i) => (
|
||||||
<LinkCard key={i} link={e} count={i} />
|
<LinkCard key={i} link={e} count={i}/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -186,7 +186,8 @@ export default function Dashboard() {
|
||||||
<i className="bi-cloud-upload text-xl duration-100"></i>
|
<i className="bi-cloud-upload text-xl duration-100"></i>
|
||||||
<p>Import From</p>
|
<p>Import From</p>
|
||||||
</div>
|
</div>
|
||||||
<ul className="shadow menu dropdown-content z-[1] bg-base-200 border border-neutral-content rounded-box mt-1 w-60">
|
<ul
|
||||||
|
className="shadow menu dropdown-content z-[1] bg-base-200 border border-neutral-content rounded-box mt-1 w-60">
|
||||||
<li>
|
<li>
|
||||||
<label
|
<label
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
|
@ -259,7 +260,7 @@ export default function Dashboard() {
|
||||||
>
|
>
|
||||||
{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} />)
|
.map((e, i) => <LinkCard key={i} link={e} count={i}/>)
|
||||||
.slice(0, showLinks)}
|
.slice(0, showLinks)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -281,7 +282,7 @@ export default function Dashboard() {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{newLinkModal ? (
|
{newLinkModal ? (
|
||||||
<NewLinkModal onClose={() => setNewLinkModal(false)} />
|
<NewLinkModal onClose={() => setNewLinkModal(false)}/>
|
||||||
) : undefined}
|
) : undefined}
|
||||||
</MainLayout>
|
</MainLayout>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,19 +1,13 @@
|
||||||
import LinkCard from "@/components/LinkViews/LinkComponents/LinkCard";
|
|
||||||
import NoLinksFound from "@/components/NoLinksFound";
|
import NoLinksFound from "@/components/NoLinksFound";
|
||||||
import SortDropdown from "@/components/SortDropdown";
|
import SortDropdown from "@/components/SortDropdown";
|
||||||
import useLinks from "@/hooks/useLinks";
|
import useLinks from "@/hooks/useLinks";
|
||||||
import MainLayout from "@/layouts/MainLayout";
|
import MainLayout from "@/layouts/MainLayout";
|
||||||
import useLinkStore from "@/store/links";
|
import useLinkStore from "@/store/links";
|
||||||
import { Sort } from "@/types/global";
|
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import PageHeader from "@/components/PageHeader";
|
import PageHeader from "@/components/PageHeader";
|
||||||
import { Sort, ViewMode } from "@/types/global";
|
import { Sort, ViewMode } from "@/types/global";
|
||||||
import { faLink } from "@fortawesome/free-solid-svg-icons";
|
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
||||||
import { useState } from "react";
|
|
||||||
import ViewDropdown from "@/components/ViewDropdown";
|
import ViewDropdown from "@/components/ViewDropdown";
|
||||||
import DefaultView from "@/components/LinkViews/DefaultView";
|
import DefaultView from "@/components/LinkViews/DefaultView";
|
||||||
import GridView from "@/components/LinkViews/GridView";
|
|
||||||
import ListView from "@/components/LinkViews/ListView";
|
import ListView from "@/components/LinkViews/ListView";
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,17 +38,16 @@ export default function Links() {
|
||||||
title={"All Links"}
|
title={"All Links"}
|
||||||
description={"Links from every Collections"}
|
description={"Links from every Collections"}
|
||||||
/>
|
/>
|
||||||
<div className="flex gap-3 justify-end">
|
|
||||||
<div className="relative mt-2">
|
<div className="mt-2 flex items-center justify-end gap-2">
|
||||||
<SortDropdown sortBy={sortBy} setSort={setSortBy} />
|
<SortDropdown sortBy={sortBy} setSort={setSortBy}/>
|
||||||
<ViewDropdown viewMode={viewMode} setViewMode={setViewMode} />
|
<ViewDropdown viewMode={viewMode} setViewMode={setViewMode}/>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{links[0] ? (
|
{links[0] ? (
|
||||||
<LinkComponent links={links} />
|
<LinkComponent links={links}/>
|
||||||
) : (
|
) : (
|
||||||
<NoLinksFound text="You Haven't Created Any Links Yet" />
|
<NoLinksFound text="You Haven't Created Any Links Yet"/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</MainLayout>
|
</MainLayout>
|
||||||
|
|
|
@ -1,18 +1,12 @@
|
||||||
import LinkCard from "@/components/LinkViews/LinkComponents/LinkCard";
|
|
||||||
import SortDropdown from "@/components/SortDropdown";
|
import SortDropdown from "@/components/SortDropdown";
|
||||||
import useLinks from "@/hooks/useLinks";
|
import useLinks from "@/hooks/useLinks";
|
||||||
import MainLayout from "@/layouts/MainLayout";
|
import MainLayout from "@/layouts/MainLayout";
|
||||||
import useLinkStore from "@/store/links";
|
import useLinkStore from "@/store/links";
|
||||||
import { Sort } from "@/types/global";
|
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import PageHeader from "@/components/PageHeader";
|
import PageHeader from "@/components/PageHeader";
|
||||||
import { Sort, ViewMode } from "@/types/global";
|
import { Sort, ViewMode } from "@/types/global";
|
||||||
import { faThumbTack } from "@fortawesome/free-solid-svg-icons";
|
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
||||||
import { useState } from "react";
|
|
||||||
import ViewDropdown from "@/components/ViewDropdown";
|
import ViewDropdown from "@/components/ViewDropdown";
|
||||||
import DefaultView from "@/components/LinkViews/DefaultView";
|
import DefaultView from "@/components/LinkViews/DefaultView";
|
||||||
import GridView from "@/components/LinkViews/GridView";
|
|
||||||
import ListView from "@/components/LinkViews/ListView";
|
import ListView from "@/components/LinkViews/ListView";
|
||||||
|
|
||||||
export default function PinnedLinks() {
|
export default function PinnedLinks() {
|
||||||
|
@ -44,12 +38,12 @@ export default function PinnedLinks() {
|
||||||
/>
|
/>
|
||||||
<div className="flex gap-3 justify-end">
|
<div className="flex gap-3 justify-end">
|
||||||
<div className="relative mt-2">
|
<div className="relative mt-2">
|
||||||
<SortDropdown sortBy={sortBy} setSort={setSortBy} />
|
<SortDropdown sortBy={sortBy} setSort={setSortBy}/>
|
||||||
<ViewDropdown viewMode={viewMode} setViewMode={setViewMode} />
|
<ViewDropdown viewMode={viewMode} setViewMode={setViewMode}/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{links.some((e) => e.pinnedBy && e.pinnedBy[0]) ? (
|
{links.some((e) => e.pinnedBy && e.pinnedBy[0]) ? (
|
||||||
<LinkComponent links={links} />
|
<LinkComponent links={links}/>
|
||||||
) : (
|
) : (
|
||||||
<div
|
<div
|
||||||
style={{ flex: "1 1 auto" }}
|
style={{ flex: "1 1 auto" }}
|
||||||
|
|
Ŝarĝante…
Reference in New Issue