Skip to content

Commit 682843d

Browse files
committed
fix: run lint
1 parent c1ff0b3 commit 682843d

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

src/extensions/Link/components/LinkEditBlock.tsx

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* eslint-disable no-unsafe-optional-chaining */
22
/* eslint-disable @typescript-eslint/no-unsafe-call */
33
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
4-
import { useEffect, useState } from "react";
4+
import { useEffect, useState } from 'react';
55

6-
import { Button, IconComponent, Input, Label, Switch } from "@/components";
7-
import { useLocale } from "@/locales";
6+
import { Button, IconComponent, Input, Label, Switch } from '@/components';
7+
import { useLocale } from '@/locales';
88

99
interface IPropsLinkEditBlock {
1010
editor: any;
@@ -15,36 +15,38 @@ function LinkEditBlock(props: IPropsLinkEditBlock) {
1515
const { t } = useLocale();
1616

1717
const [form, setForm] = useState({
18-
text: "",
19-
link: "",
18+
text: '',
19+
link: '',
2020
});
2121
const [openInNewTab, setOpenInNewTab] = useState<boolean>(false);
2222

2323
useEffect(() => {
2424
if (props?.editor) {
25-
const { href: link, target } = props.editor?.getAttributes("link");
25+
const { href: link, target } = props.editor?.getAttributes('link');
2626

2727
const { from, to } = props.editor.state.selection;
28-
const text = props.editor.state.doc.textBetween(from, to, " ");
28+
const text = props.editor.state.doc.textBetween(from, to, ' ');
2929
setForm({
30-
link: link || "",
30+
link: link || '',
3131
text,
3232
});
33-
setOpenInNewTab(target === "_blank");
33+
setOpenInNewTab(target === '_blank');
3434
}
3535
}, [props?.editor]);
3636

3737
function handleSubmit(event: any) {
3838
event.preventDefault();
3939
event.stopPropagation();
4040
props?.onSetLink(form.link, form.text, openInNewTab);
41-
setForm({ text: "", link: "" });
41+
setForm({ text: '', link: '' });
4242
}
4343

4444
return (
4545
<div className="border-neutral-200 richtext-rounded-lg !richtext-border richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black">
4646
<div className="richtext-flex richtext-flex-col richtext-gap-2">
47-
<Label className="mb-[6px]">{t("editor.link.dialog.text")}</Label>
47+
<Label className="mb-[6px]">
48+
{t('editor.link.dialog.text')}
49+
</Label>
4850

4951
<div className="richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5">
5052
<div className="richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center">
@@ -59,7 +61,9 @@ function LinkEditBlock(props: IPropsLinkEditBlock) {
5961
</div>
6062
</div>
6163

62-
<Label className="mb-[6px]">{t("editor.link.dialog.link")}</Label>
64+
<Label className="mb-[6px]">
65+
{t('editor.link.dialog.link')}
66+
</Label>
6367

6468
<div className="richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5">
6569
<div className="richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center">
@@ -81,7 +85,9 @@ function LinkEditBlock(props: IPropsLinkEditBlock) {
8185
</div>
8286

8387
<div className="richtext-flex richtext-items-center richtext-space-x-2">
84-
<Label>{t("editor.link.dialog.openInNewTab")}</Label>
88+
<Label>
89+
{t('editor.link.dialog.openInNewTab')}
90+
</Label>
8591

8692
<Switch
8793
checked={openInNewTab}
@@ -96,7 +102,7 @@ function LinkEditBlock(props: IPropsLinkEditBlock) {
96102
onClick={handleSubmit}
97103
type="button"
98104
>
99-
{t("editor.link.dialog.button.apply")}
105+
{t('editor.link.dialog.button.apply')}
100106
</Button>
101107
</div>
102108
</div>

0 commit comments

Comments
 (0)