Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

feat: added button on sidebar to ignore lint

Elijah Potterc3399de92cc2
diff --git a/src/harper/LintList.tsx b/src/harper/LintList.tsx
index f94082ab0..a17d018eb 100644
--- a/src/harper/LintList.tsx
+++ b/src/harper/LintList.tsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { LintBox } from './Box';
+import { IgnorableLintBox } from './Box';
import LintListItem from './LintListItem';
import { Animate, Spinner } from '@wordpress/components';
@@ -7,7 +7,7 @@ export default function LintList({
lintBoxes,
loading,
}: {
- lintBoxes: LintBox[];
+ lintBoxes: IgnorableLintBox[];
loading: boolean;
}) {
if (lintBoxes.length === 0) {
diff --git a/src/harper/LintListItem.tsx b/src/harper/LintListItem.tsx
index b5cf1832e..b75e74542 100644
--- a/src/harper/LintListItem.tsx
+++ b/src/harper/LintListItem.tsx
@@ -1,9 +1,9 @@
import { Card, Button, CardBody } from '@wordpress/components';
-import { LintBox } from './Box';
+import { IgnorableLintBox } from './Box';
import React from 'react';
import { suggestionText } from './lintUtils';
-export default function LintListItem({ box }: { box: LintBox }) {
+export default function LintListItem({ box }: { box: IgnorableLintBox }) {
return (
<Card size="small" className="harper-lint-card">
<CardBody>
@@ -25,6 +25,10 @@ export default function LintListItem({ box }: { box: LintBox }) {
)}
</Button>
))}
+
+ <Button variant="link" onClick={box.ignoreLint}>
+ Ignore
+ </Button>
</CardBody>
</Card>
);
diff --git a/src/harper/SidebarTabContainer.tsx b/src/harper/SidebarTabContainer.tsx
index 6199fefcc..29d613ee1 100644
--- a/src/harper/SidebarTabContainer.tsx
+++ b/src/harper/SidebarTabContainer.tsx
@@ -2,13 +2,13 @@ import React from 'react';
import LintSettingList from './LintSettingList';
import { TabPanel } from '@wordpress/components';
import LintList from './LintList';
-import { LintBox } from './Box';
+import { IgnorableLintBox } from './Box';
export default function SidebarTabContainer({
lintBoxes,
loading,
}: {
- lintBoxes: LintBox[];
+ lintBoxes: IgnorableLintBox[];
loading: boolean;
}) {
return (