help button
This commit is contained in:
19
src/views/Options/HelpButton.js
Normal file
19
src/views/Options/HelpButton.js
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import Button from "@mui/material/Button";
|
||||||
|
import { useI18n } from "../../hooks/I18n";
|
||||||
|
import HelpIcon from "@mui/icons-material/Help";
|
||||||
|
|
||||||
|
export default function HelpButton({ url }) {
|
||||||
|
const i18n = useI18n();
|
||||||
|
return (
|
||||||
|
<Button
|
||||||
|
size="small"
|
||||||
|
variant="outlined"
|
||||||
|
onClick={() => {
|
||||||
|
window.open(url, "_blank");
|
||||||
|
}}
|
||||||
|
startIcon={<HelpIcon />}
|
||||||
|
>
|
||||||
|
{i18n("help")}
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -36,7 +36,6 @@ import Radio from "@mui/material/Radio";
|
|||||||
import RadioGroup from "@mui/material/RadioGroup";
|
import RadioGroup from "@mui/material/RadioGroup";
|
||||||
import DeleteIcon from "@mui/icons-material/Delete";
|
import DeleteIcon from "@mui/icons-material/Delete";
|
||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
import HelpIcon from "@mui/icons-material/Help";
|
|
||||||
import ShareIcon from "@mui/icons-material/Share";
|
import ShareIcon from "@mui/icons-material/Share";
|
||||||
import SyncIcon from "@mui/icons-material/Sync";
|
import SyncIcon from "@mui/icons-material/Sync";
|
||||||
import { useSubRules } from "../../hooks/SubRules";
|
import { useSubRules } from "../../hooks/SubRules";
|
||||||
@@ -48,6 +47,7 @@ import { debounce } from "../../libs/utils";
|
|||||||
import { delSubRules, getSyncWithDefault } from "../../libs/storage";
|
import { delSubRules, getSyncWithDefault } from "../../libs/storage";
|
||||||
import OwSubRule from "./OwSubRule";
|
import OwSubRule from "./OwSubRule";
|
||||||
import ClearAllIcon from "@mui/icons-material/ClearAll";
|
import ClearAllIcon from "@mui/icons-material/ClearAll";
|
||||||
|
import HelpButton from "./HelpButton";
|
||||||
|
|
||||||
function RuleFields({ rule, rules, setShow, setKeyword }) {
|
function RuleFields({ rule, rules, setShow, setKeyword }) {
|
||||||
const initFormValues = rule || {
|
const initFormValues = rule || {
|
||||||
@@ -478,22 +478,6 @@ function ShareButton({ rules, injectRules, selectedUrl }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function HelpButton() {
|
|
||||||
const i18n = useI18n();
|
|
||||||
return (
|
|
||||||
<Button
|
|
||||||
size="small"
|
|
||||||
variant="outlined"
|
|
||||||
onClick={() => {
|
|
||||||
window.open(URL_KISS_RULES_NEW_ISSUE, "_blank");
|
|
||||||
}}
|
|
||||||
startIcon={<HelpIcon />}
|
|
||||||
>
|
|
||||||
{i18n("help")}
|
|
||||||
</Button>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function UserRules({ subRules }) {
|
function UserRules({ subRules }) {
|
||||||
const i18n = useI18n();
|
const i18n = useI18n();
|
||||||
const rules = useRules();
|
const rules = useRules();
|
||||||
@@ -582,7 +566,7 @@ function UserRules({ subRules }) {
|
|||||||
{i18n("clear_all")}
|
{i18n("clear_all")}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<HelpButton />
|
<HelpButton url={URL_KISS_RULES_NEW_ISSUE} />
|
||||||
|
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
control={
|
control={
|
||||||
@@ -762,7 +746,7 @@ function SubRulesEdit({ subList, addSub }) {
|
|||||||
>
|
>
|
||||||
{i18n("add")}
|
{i18n("add")}
|
||||||
</Button>
|
</Button>
|
||||||
<HelpButton />
|
<HelpButton url={URL_KISS_RULES_NEW_ISSUE} />
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
{showInput && (
|
{showInput && (
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ import { syncWebfix, loadOrFetchWebfix } from "../../libs/webfix";
|
|||||||
import Button from "@mui/material/Button";
|
import Button from "@mui/material/Button";
|
||||||
import SyncIcon from "@mui/icons-material/Sync";
|
import SyncIcon from "@mui/icons-material/Sync";
|
||||||
import { useAlert } from "../../hooks/Alert";
|
import { useAlert } from "../../hooks/Alert";
|
||||||
|
import HelpButton from "./HelpButton";
|
||||||
|
import { URL_KISS_RULES_NEW_ISSUE } from "../../config";
|
||||||
|
|
||||||
function ApiFields({ site }) {
|
function ApiFields({ site }) {
|
||||||
const { selector, rootSlector, fixer } = site;
|
const { selector, rootSlector, fixer } = site;
|
||||||
@@ -122,6 +124,7 @@ export default function Webfix() {
|
|||||||
>
|
>
|
||||||
{i18n("sync_now")}
|
{i18n("sync_now")}
|
||||||
</Button>
|
</Button>
|
||||||
|
<HelpButton url={URL_KISS_RULES_NEW_ISSUE} />
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
control={
|
control={
|
||||||
<Switch
|
<Switch
|
||||||
|
|||||||
Reference in New Issue
Block a user