mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 04:17:23 +00:00
format code
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useNavigate } from "react-router";
|
||||
import {
|
||||
MdOutlineComment,
|
||||
} from "react-icons/md";
|
||||
import { MdOutlineComment } from "react-icons/md";
|
||||
import { Comment } from "../network/models";
|
||||
import { network } from "../network/network";
|
||||
import Badge from "./badge";
|
||||
|
@@ -282,7 +282,6 @@ function CommentsList({
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
function EditCommentDialog({
|
||||
comment,
|
||||
onUpdated,
|
||||
|
@@ -23,7 +23,8 @@ import Markdown from "react-markdown";
|
||||
import "../markdown.css";
|
||||
import Loading from "../components/loading.tsx";
|
||||
import {
|
||||
MdAdd, MdOutlineArchive,
|
||||
MdAdd,
|
||||
MdOutlineArchive,
|
||||
MdOutlineArticle,
|
||||
MdOutlineComment,
|
||||
MdOutlineDataset,
|
||||
|
@@ -8,7 +8,11 @@ import Loading from "../components/loading";
|
||||
import Pagination from "../components/pagination";
|
||||
import { CommentTile } from "../components/comment_tile.tsx";
|
||||
import Badge from "../components/badge.tsx";
|
||||
import { MdOutlineArchive, MdOutlineComment, MdOutlinePhotoAlbum, MdPhotoAlbum } from "react-icons/md";
|
||||
import {
|
||||
MdOutlineArchive,
|
||||
MdOutlineComment,
|
||||
MdOutlinePhotoAlbum,
|
||||
} from "react-icons/md";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function UserPage() {
|
||||
@@ -69,7 +73,10 @@ export default function UserPage() {
|
||||
return (
|
||||
<div>
|
||||
<UserCard user={user!} />
|
||||
<div role="tablist" className="border-b border-base-300 mx-2 flex tabs tabs-border">
|
||||
<div
|
||||
role="tablist"
|
||||
className="border-b border-base-300 mx-2 flex tabs tabs-border"
|
||||
>
|
||||
<div
|
||||
role="tab"
|
||||
className={`tab ${page === 0 ? "tab-active" : ""} `}
|
||||
@@ -97,20 +104,28 @@ export default function UserPage() {
|
||||
function UserCard({ user }: { user: User }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const statistics = <p className="mt-2">
|
||||
const statistics = (
|
||||
<p className="mt-2">
|
||||
<Badge className="badge-soft badge-primary badge-lg m-1">
|
||||
<MdOutlinePhotoAlbum size={18} />
|
||||
<span className="ml-1 text-sm">{t("Resources")} {user.resources_count}</span>
|
||||
<span className="ml-1 text-sm">
|
||||
{t("Resources")} {user.resources_count}
|
||||
</span>
|
||||
</Badge>
|
||||
<Badge className="badge-soft badge-secondary badge-lg m-1">
|
||||
<MdOutlineArchive size={18} />
|
||||
<span className="ml-1 text-sm">{t('Files')} {user.files_count}</span>
|
||||
<span className="ml-1 text-sm">
|
||||
{t("Files")} {user.files_count}
|
||||
</span>
|
||||
</Badge>
|
||||
<Badge className="badge-soft badge-accent badge-lg m-1">
|
||||
<MdOutlineComment size={18} />
|
||||
<span className="ml-1 text-sm">{t("Comments")} {user.comments_count}</span>
|
||||
<span className="ml-1 text-sm">
|
||||
{t("Comments")} {user.comments_count}
|
||||
</span>
|
||||
</Badge>
|
||||
</p>
|
||||
);
|
||||
|
||||
const haveBio = user.bio.trim() !== "";
|
||||
|
||||
@@ -128,9 +143,10 @@ function UserCard({ user }: { user: User }) {
|
||||
<div className="h-4"></div>
|
||||
{haveBio ? (
|
||||
<p className="text-sm text-base-content/80">{user.bio.trim()}</p>
|
||||
): statistics}
|
||||
) : (
|
||||
statistics
|
||||
)}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{haveBio && <div className="mb-2 mx-2">{statistics}</div>}
|
||||
</>
|
||||
|
Reference in New Issue
Block a user