mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: cleanup less files
This commit is contained in:
@ -4,7 +4,6 @@ import { getDateString } from "@/helpers/datetime";
|
|||||||
import { useFilterStore } from "@/store/module";
|
import { useFilterStore } from "@/store/module";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
import "@/less/memo-filter.less";
|
|
||||||
|
|
||||||
const MemoFilter = () => {
|
const MemoFilter = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
@ -19,34 +18,44 @@ const MemoFilter = () => {
|
|||||||
}, [location]);
|
}, [location]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`filter-query-container ${showFilter ? "" : "!hidden"}`}>
|
<div
|
||||||
|
className={`flex flex-row justify-start items-start w-full flex-wrap px-2 pb-2 text-sm font-mono leading-7 dark:text-gray-300 ${
|
||||||
|
showFilter ? "" : "!hidden"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
<span className="mx-2 text-gray-400">{t("common.filter")}:</span>
|
<span className="mx-2 text-gray-400">{t("common.filter")}:</span>
|
||||||
<div
|
<div
|
||||||
className={"filter-item-container " + (tagQuery ? "" : "!hidden")}
|
className={
|
||||||
|
"max-w-xs flex flex-row justify-start items-center px-2 mr-2 cursor-pointer dark:text-gray-300 bg-gray-200 dark:bg-zinc-700 rounded whitespace-nowrap truncate hover:line-through " +
|
||||||
|
(tagQuery ? "" : "!hidden")
|
||||||
|
}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
filterStore.setTagFilter(undefined);
|
filterStore.setTagFilter(undefined);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Icon.Tag className="icon-text" /> {tagQuery}
|
<Icon.Tag className="w-4 h-auto mr-1 text-gray-500 dark:text-gray-400" /> {tagQuery}
|
||||||
<Icon.X className="w-4 h-auto ml-1 opacity-40" />
|
<Icon.X className="w-4 h-auto ml-1 opacity-40" />
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className={"filter-item-container " + (visibility ? "" : "!hidden")}
|
className={
|
||||||
|
"max-w-xs flex flex-row justify-start items-center px-2 mr-2 cursor-pointer dark:text-gray-300 bg-gray-200 dark:bg-zinc-700 rounded whitespace-nowrap truncate hover:line-through " +
|
||||||
|
(visibility ? "" : "!hidden")
|
||||||
|
}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
filterStore.setMemoVisibilityFilter(undefined);
|
filterStore.setMemoVisibilityFilter(undefined);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Icon.Eye className="icon-text" /> {visibility}
|
<Icon.Eye className="w-4 h-auto mr-1 text-gray-500 dark:text-gray-400" /> {visibility}
|
||||||
<Icon.X className="w-4 h-auto ml-1 opacity-40" />
|
<Icon.X className="w-4 h-auto ml-1 opacity-40" />
|
||||||
</div>
|
</div>
|
||||||
{duration && duration.from < duration.to ? (
|
{duration && duration.from < duration.to ? (
|
||||||
<div
|
<div
|
||||||
className="filter-item-container"
|
className="max-w-xs flex flex-row justify-start items-center px-2 mr-2 cursor-pointer dark:text-gray-300 bg-gray-200 dark:bg-zinc-700 rounded whitespace-nowrap truncate hover:line-through"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
filterStore.setFromAndToFilter();
|
filterStore.setFromAndToFilter();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Icon.Calendar className="icon-text" />
|
<Icon.Calendar className="w-4 h-auto mr-1 text-gray-500 dark:text-gray-400" />
|
||||||
{t("common.filter-period", {
|
{t("common.filter-period", {
|
||||||
from: getDateString(duration.from),
|
from: getDateString(duration.from),
|
||||||
to: getDateString(duration.to),
|
to: getDateString(duration.to),
|
||||||
@ -56,12 +65,15 @@ const MemoFilter = () => {
|
|||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
<div
|
<div
|
||||||
className={"filter-item-container " + (textQuery ? "" : "!hidden")}
|
className={
|
||||||
|
"max-w-xs flex flex-row justify-start items-center px-2 mr-2 cursor-pointer dark:text-gray-300 bg-gray-200 dark:bg-zinc-700 rounded whitespace-nowrap truncate hover:line-through " +
|
||||||
|
(textQuery ? "" : "!hidden")
|
||||||
|
}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
filterStore.setTextFilter(undefined);
|
filterStore.setTextFilter(undefined);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Icon.Search className="icon-text" /> {textQuery}
|
<Icon.Search className="w-4 h-auto mr-1 text-gray-500 dark:text-gray-400" /> {textQuery}
|
||||||
<Icon.X className="w-4 h-auto ml-1 opacity-40" />
|
<Icon.X className="w-4 h-auto ml-1 opacity-40" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -9,7 +9,6 @@ import { useFilterStore, useMemoStore } from "@/store/module";
|
|||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import Empty from "./Empty";
|
import Empty from "./Empty";
|
||||||
import Memo from "./Memo";
|
import Memo from "./Memo";
|
||||||
import "@/less/memo-list.less";
|
|
||||||
|
|
||||||
const MemoList: React.FC = () => {
|
const MemoList: React.FC = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
@ -131,17 +130,17 @@ const MemoList: React.FC = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="memo-list-container">
|
<div className="flex flex-col justify-start items-start w-full max-w-full overflow-y-scroll pb-28 hide-scrollbar">
|
||||||
{sortedMemos.map((memo) => (
|
{sortedMemos.map((memo) => (
|
||||||
<Memo key={`${memo.id}-${memo.displayTs}`} memo={memo} lazyRendering showVisibility />
|
<Memo key={`${memo.id}-${memo.displayTs}`} memo={memo} lazyRendering showVisibility />
|
||||||
))}
|
))}
|
||||||
{isFetching ? (
|
{isFetching ? (
|
||||||
<div className="status-text-container fetching-tip">
|
<div className="flex flex-col justify-start items-center w-full mt-2 mb-1">
|
||||||
<p className="status-text">{t("memo.fetching-data")}</p>
|
<p className="text-sm text-gray-400 italic">{t("memo.fetching-data")}</p>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="status-text-container">
|
<div className="flex flex-col justify-start items-center w-full my-6">
|
||||||
<div className="status-text">
|
<div className="text-sm text-gray-400 italic">
|
||||||
{isComplete ? (
|
{isComplete ? (
|
||||||
sortedMemos.length === 0 && (
|
sortedMemos.length === 0 && (
|
||||||
<div className="w-full mt-12 mb-8 flex flex-col justify-center items-center italic">
|
<div className="w-full mt-12 mb-8 flex flex-col justify-center items-center italic">
|
||||||
|
@ -5,7 +5,6 @@ import { getResourceType, getResourceUrl } from "@/utils/resource";
|
|||||||
import MemoResource from "./MemoResource";
|
import MemoResource from "./MemoResource";
|
||||||
import showPreviewImageDialog from "./PreviewImageDialog";
|
import showPreviewImageDialog from "./PreviewImageDialog";
|
||||||
import SquareDiv from "./kit/SquareDiv";
|
import SquareDiv from "./kit/SquareDiv";
|
||||||
import "@/less/memo-resources.less";
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
resourceList: Resource[];
|
resourceList: Resource[];
|
||||||
@ -77,14 +76,20 @@ const MemoResourceListView: React.FC<Props> = (props: Props) => {
|
|||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
<div className={`resource-wrapper ${className || ""}`}>
|
<div className={`w-full flex flex-col justify-start items-start ${className || ""}`}>
|
||||||
{videoResourceList.length > 0 && (
|
{videoResourceList.length > 0 && (
|
||||||
<div className="images-wrapper">
|
<div className="w-full grid grid-cols-2 sm:grid-cols-3 gap-2 mt-2wrapper">
|
||||||
{videoResourceList.map((resource) => {
|
{videoResourceList.map((resource) => {
|
||||||
const url = getResourceUrl(resource);
|
const url = getResourceUrl(resource);
|
||||||
return (
|
return (
|
||||||
<SquareDiv key={resource.id} className="memo-resource">
|
<SquareDiv key={resource.id} className="shadow rounded overflow-hidden hide-scrollbar">
|
||||||
<video preload="metadata" crossOrigin="anonymous" src={absolutifyLink(url)} controls></video>
|
<video
|
||||||
|
className="cursor-pointer w-full h-full object-contain bg-zinc-100 dark:bg-zinc-800"
|
||||||
|
preload="metadata"
|
||||||
|
crossOrigin="anonymous"
|
||||||
|
src={absolutifyLink(url)}
|
||||||
|
controls
|
||||||
|
></video>
|
||||||
</SquareDiv>
|
</SquareDiv>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
.archived-memo-page {
|
|
||||||
@apply w-full max-w-3xl min-h-full flex flex-col justify-start items-center pb-8 bg-zinc-100 dark:bg-zinc-800;
|
|
||||||
|
|
||||||
> .tip-text-container {
|
|
||||||
@apply w-full h-32 flex flex-col justify-center items-center;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .archived-memos-container {
|
|
||||||
@apply w-full flex flex-col justify-start items-start;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
.change-resource-filename-dialog {
|
|
||||||
> .dialog-container {
|
|
||||||
@apply w-72;
|
|
||||||
|
|
||||||
> .dialog-content-container {
|
|
||||||
@apply flex flex-col justify-start items-start;
|
|
||||||
|
|
||||||
> .btns-container {
|
|
||||||
@apply flex flex-row justify-end items-center mt-2 w-full;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
.image-container {
|
|
||||||
@apply hide-scrollbar;
|
|
||||||
-webkit-tap-highlight-color: transparent;
|
|
||||||
|
|
||||||
> img {
|
|
||||||
@apply w-full h-auto;
|
|
||||||
}
|
|
||||||
}
|
|
@ -105,27 +105,4 @@
|
|||||||
@apply my-1 dark:border-zinc-600;
|
@apply my-1 dark:border-zinc-600;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> .expand-btn-container {
|
|
||||||
@apply w-full relative flex flex-row justify-start items-center z-1;
|
|
||||||
> .btn {
|
|
||||||
@apply flex flex-row justify-start items-center pl-2 pr-1 py-1 my-2 text-xs rounded-lg border bg-gray-100 dark:bg-zinc-600 border-gray-200 dark:border-zinc-600 shadow hover:opacity-90 cursor-pointer;
|
|
||||||
|
|
||||||
&.expand-btn {
|
|
||||||
> .icon-img {
|
|
||||||
@apply rotate-90;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.fold-btn {
|
|
||||||
> .icon-img {
|
|
||||||
@apply -rotate-90;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
> .icon-img {
|
|
||||||
@apply w-4 h-auto ml-1 transition-all;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
.filter-query-container {
|
|
||||||
@apply flex flex-row justify-start items-start w-full flex-wrap px-2 pb-2 text-sm font-mono leading-7 dark:text-gray-300;
|
|
||||||
|
|
||||||
> .filter-item-container {
|
|
||||||
@apply flex flex-row justify-start items-center px-2 mr-2 cursor-pointer dark:text-gray-300 bg-gray-200 dark:bg-zinc-700 rounded whitespace-nowrap truncate hover:line-through;
|
|
||||||
max-width: 256px;
|
|
||||||
|
|
||||||
> .icon-text {
|
|
||||||
@apply w-4 h-auto mr-1 text-gray-500 dark:text-gray-400;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
.memo-list-container {
|
|
||||||
@apply flex flex-col justify-start items-start w-full max-w-full overflow-y-scroll pb-28 hide-scrollbar;
|
|
||||||
|
|
||||||
> .status-text-container {
|
|
||||||
@apply flex flex-col justify-start items-center w-full my-6;
|
|
||||||
|
|
||||||
&.fetching-tip {
|
|
||||||
@apply mt-2 mb-1;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .status-text {
|
|
||||||
@apply text-sm text-gray-400 italic;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
.resource-wrapper {
|
|
||||||
@apply w-full flex flex-col justify-start items-start;
|
|
||||||
|
|
||||||
> .images-wrapper {
|
|
||||||
@apply w-full grid grid-cols-2 sm:grid-cols-3 gap-2 mt-2;
|
|
||||||
|
|
||||||
> .memo-resource {
|
|
||||||
@apply shadow rounded overflow-hidden hide-scrollbar;
|
|
||||||
|
|
||||||
> img {
|
|
||||||
@apply cursor-pointer min-h-full w-auto min-w-full object-cover;
|
|
||||||
}
|
|
||||||
|
|
||||||
> video {
|
|
||||||
@apply cursor-pointer w-full h-full object-contain bg-zinc-100 dark:bg-zinc-800;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,51 +0,0 @@
|
|||||||
.resources-selector-dialog {
|
|
||||||
@apply px-4;
|
|
||||||
|
|
||||||
> .dialog-container {
|
|
||||||
@apply w-112 max-w-full mb-8;
|
|
||||||
|
|
||||||
> .dialog-content-container {
|
|
||||||
@apply flex flex-col justify-start items-start w-full;
|
|
||||||
|
|
||||||
> .loading-text-container {
|
|
||||||
@apply flex flex-col justify-center items-center w-full h-32;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .resource-table-container {
|
|
||||||
@apply flex flex-col justify-start items-start w-full;
|
|
||||||
|
|
||||||
> .fields-container {
|
|
||||||
@apply px-2 py-2 w-full grid grid-cols-7 border-b dark:border-b-gray-500;
|
|
||||||
|
|
||||||
> .field-text {
|
|
||||||
@apply font-mono text-gray-400;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
> .tip-text {
|
|
||||||
@apply w-full text-center text-base my-6 mt-8;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .resource-container {
|
|
||||||
@apply px-2 py-2 w-full grid grid-cols-7 dark:bg-zinc-700;
|
|
||||||
|
|
||||||
> .buttons-container {
|
|
||||||
@apply w-full flex flex-row justify-end items-center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.field-text {
|
|
||||||
@apply w-full truncate text-base pr-2 last:pr-0;
|
|
||||||
|
|
||||||
&.name-text {
|
|
||||||
@apply col-span-4;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.type-text {
|
|
||||||
@apply col-span-2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -7,7 +7,6 @@ import MobileHeader from "@/components/MobileHeader";
|
|||||||
import useLoading from "@/hooks/useLoading";
|
import useLoading from "@/hooks/useLoading";
|
||||||
import { useFilterStore, useMemoStore } from "@/store/module";
|
import { useFilterStore, useMemoStore } from "@/store/module";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import "@/less/archived.less";
|
|
||||||
|
|
||||||
const Archived = () => {
|
const Archived = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
@ -38,25 +37,23 @@ const Archived = () => {
|
|||||||
return (
|
return (
|
||||||
<section className="w-full max-w-3xl min-h-full flex flex-col justify-start items-start px-4 sm:px-2 sm:pt-4 pb-8 bg-zinc-100 dark:bg-zinc-800">
|
<section className="w-full max-w-3xl min-h-full flex flex-col justify-start items-start px-4 sm:px-2 sm:pt-4 pb-8 bg-zinc-100 dark:bg-zinc-800">
|
||||||
<MobileHeader showSearch={false} />
|
<MobileHeader showSearch={false} />
|
||||||
<div className="archived-memo-page">
|
<MemoFilter />
|
||||||
<MemoFilter />
|
{loadingState.isLoading ? (
|
||||||
{loadingState.isLoading ? (
|
<div className="w-full h-32 flex flex-col justify-center items-center">
|
||||||
<div className="tip-text-container">
|
<p className="opacity-70">{t("memo.fetching-data")}</p>
|
||||||
<p className="tip-text">{t("memo.fetching-data")}</p>
|
</div>
|
||||||
</div>
|
) : archivedMemos.length === 0 ? (
|
||||||
) : archivedMemos.length === 0 ? (
|
<div className="w-full mt-16 mb-8 flex flex-col justify-center items-center italic">
|
||||||
<div className="w-full mt-16 mb-8 flex flex-col justify-center items-center italic">
|
<Empty />
|
||||||
<Empty />
|
<p className="mt-4 text-gray-600 dark:text-gray-400">{t("message.no-data")}</p>
|
||||||
<p className="mt-4 text-gray-600 dark:text-gray-400">{t("message.no-data")}</p>
|
</div>
|
||||||
</div>
|
) : (
|
||||||
) : (
|
<div className="w-full flex flex-col justify-start items-start">
|
||||||
<div className="archived-memos-container">
|
{archivedMemos.map((memo) => (
|
||||||
{archivedMemos.map((memo) => (
|
<ArchivedMemo key={`${memo.id}-${memo.updatedTs}`} memo={memo} />
|
||||||
<ArchivedMemo key={`${memo.id}-${memo.updatedTs}`} memo={memo} />
|
))}
|
||||||
))}
|
</div>
|
||||||
</div>
|
)}
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user