mirror of https://github.com/usememos/memos.git
fix: frontend linter
This commit is contained in:
parent
83febf9928
commit
697e54758d
|
|
@ -12,7 +12,6 @@ import { generateDialog } from "./Dialog";
|
|||
const templateList: IdentityProvider[] = [
|
||||
{
|
||||
name: "",
|
||||
uid: "",
|
||||
title: "GitHub",
|
||||
type: IdentityProvider_Type.OAUTH2,
|
||||
identifierFilter: "",
|
||||
|
|
@ -34,7 +33,6 @@ const templateList: IdentityProvider[] = [
|
|||
},
|
||||
{
|
||||
name: "",
|
||||
uid: "",
|
||||
title: "GitLab",
|
||||
type: IdentityProvider_Type.OAUTH2,
|
||||
identifierFilter: "",
|
||||
|
|
@ -56,7 +54,6 @@ const templateList: IdentityProvider[] = [
|
|||
},
|
||||
{
|
||||
name: "",
|
||||
uid: "",
|
||||
title: "Google",
|
||||
type: IdentityProvider_Type.OAUTH2,
|
||||
identifierFilter: "",
|
||||
|
|
@ -78,7 +75,6 @@ const templateList: IdentityProvider[] = [
|
|||
},
|
||||
{
|
||||
name: "",
|
||||
uid: "",
|
||||
title: "Custom",
|
||||
type: IdentityProvider_Type.OAUTH2,
|
||||
identifierFilter: "",
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import { useColorScheme } from "@mui/joy";
|
|||
import { useEffect, useRef, useState } from "react";
|
||||
import ForceGraph2D, { ForceGraphMethods, LinkObject, NodeObject } from "react-force-graph-2d";
|
||||
import useNavigateTo from "@/hooks/useNavigateTo";
|
||||
import { extractMemoIdFromName } from "@/store/common";
|
||||
import { Memo, MemoRelation_Type } from "@/types/proto/api/v1/memo_service";
|
||||
import { cn } from "@/utils";
|
||||
import { LinkType, NodeType } from "./types";
|
||||
|
|
@ -47,7 +48,7 @@ const MemoRelationForceGraph = ({ className, memo, parentPage }: Props) => {
|
|||
cooldownTicks={0}
|
||||
nodeColor={(node) => (node.id === memo.name ? MAIN_NODE_COLOR : DEFAULT_NODE_COLOR)}
|
||||
nodeRelSize={3}
|
||||
nodeLabel={(node) => node.memo.uid.slice(0, 6).toLowerCase()}
|
||||
nodeLabel={(node) => extractMemoIdFromName(node.memo.name).slice(0, 6).toLowerCase()}
|
||||
linkColor={() => (mode === "light" ? "#e4e4e7" : "#3f3f46")}
|
||||
graphData={convertMemoRelationsToGraphData(memo.relations.filter((r) => r.type === MemoRelation_Type.REFERENCE))}
|
||||
onNodeClick={onNodeClick}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { LinkIcon, MilestoneIcon } from "lucide-react";
|
||||
import { memo, useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { extractMemoIdFromName } from "@/store/common";
|
||||
import { Memo, MemoRelation } from "@/types/proto/api/v1/memo_service";
|
||||
import { cn } from "@/utils";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
|
|
@ -65,14 +66,14 @@ const MemoRelationListView = (props: Props) => {
|
|||
<Link
|
||||
key={memo.name}
|
||||
className="w-auto max-w-full flex flex-row justify-start items-center text-sm leading-5 text-gray-600 dark:text-gray-400 dark:border-zinc-700 dark:bg-zinc-900 hover:underline"
|
||||
to={`/m/${memo.uid}`}
|
||||
to={`/${memo.name}`}
|
||||
viewTransition
|
||||
state={{
|
||||
from: parentPage,
|
||||
}}
|
||||
>
|
||||
<span className="text-xs opacity-60 leading-4 border border-zinc-200 font-mono px-1 rounded-full mr-1 dark:border-zinc-700">
|
||||
{memo.uid.slice(0, 6)}
|
||||
{extractMemoIdFromName(memo.name).slice(0, 6)}
|
||||
</span>
|
||||
<span className="truncate">{memo.snippet}</span>
|
||||
</Link>
|
||||
|
|
@ -87,14 +88,14 @@ const MemoRelationListView = (props: Props) => {
|
|||
<Link
|
||||
key={memo.name}
|
||||
className="w-auto max-w-full flex flex-row justify-start items-center text-sm leading-5 text-gray-600 dark:text-gray-400 dark:border-zinc-700 dark:bg-zinc-900 hover:underline"
|
||||
to={`/m/${memo.uid}`}
|
||||
to={`/${memo.name}`}
|
||||
viewTransition
|
||||
state={{
|
||||
from: parentPage,
|
||||
}}
|
||||
>
|
||||
<span className="text-xs opacity-60 leading-4 border border-zinc-200 font-mono px-1 rounded-full mr-1 dark:border-zinc-700">
|
||||
{memo.uid.slice(0, 6)}
|
||||
{extractMemoIdFromName(memo.name).slice(0, 6)}
|
||||
</span>
|
||||
<span className="truncate">{memo.snippet}</span>
|
||||
</Link>
|
||||
|
|
|
|||
Loading…
Reference in New Issue