mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-17 07:52:16 -07:00
auto lint fixes
This commit is contained in:
parent
9f85845973
commit
9b6c806c00
5 changed files with 42 additions and 40 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
import React from "react";
|
import React from 'react';
|
||||||
import { useGameGuard } from "hooks";
|
import { useGameGuard } from 'hooks';
|
||||||
import { RefreshGuardModal } from "../RefreshGuardModal/RefreshGuardModal";
|
import { RefreshGuardModal } from '../RefreshGuardModal/RefreshGuardModal';
|
||||||
|
|
||||||
interface RefreshGuardProviderProps {
|
interface RefreshGuardProviderProps {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
|
|
@ -34,8 +34,8 @@ export const RefreshGuardProvider: React.FC<RefreshGuardProviderProps> = ({
|
||||||
onClose={handleCancelNavigation}
|
onClose={handleCancelNavigation}
|
||||||
onConfirm={handleConfirmNavigation}
|
onConfirm={handleConfirmNavigation}
|
||||||
message={navigationMessage}
|
message={navigationMessage}
|
||||||
title={isInActiveGame ? "Active Game Warning" : "Connection Warning"}
|
title={isInActiveGame ? 'Active Game Warning' : 'Connection Warning'}
|
||||||
confirmButtonText={isInActiveGame ? "Leave Game" : "Leave Anyway"}
|
confirmButtonText={isInActiveGame ? 'Leave Game' : 'Leave Anyway'}
|
||||||
cancelButtonText="Stay"
|
cancelButtonText="Stay"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
@ -45,7 +45,7 @@ export const RefreshGuardProvider: React.FC<RefreshGuardProviderProps> = ({
|
||||||
onClose={handleCancelRefresh}
|
onClose={handleCancelRefresh}
|
||||||
onConfirm={handleConfirmRefresh}
|
onConfirm={handleConfirmRefresh}
|
||||||
message={refreshMessage}
|
message={refreshMessage}
|
||||||
title={isInActiveGame ? "Page Refresh Warning" : "Connection Warning"}
|
title={isInActiveGame ? 'Page Refresh Warning' : 'Connection Warning'}
|
||||||
confirmButtonText="Refresh Anyway"
|
confirmButtonText="Refresh Anyway"
|
||||||
cancelButtonText="Stay on Page"
|
cancelButtonText="Stay on Page"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,9 @@ export const useNavigationGuard = ({
|
||||||
const target = event.target as HTMLElement;
|
const target = event.target as HTMLElement;
|
||||||
const link = target.closest('a');
|
const link = target.closest('a');
|
||||||
|
|
||||||
if (!link) return;
|
if (!link) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const href = link.getAttribute('href');
|
const href = link.getAttribute('href');
|
||||||
if (!href || href.startsWith('#') || href.startsWith('http') || href.startsWith('mailto:')) {
|
if (!href || href.startsWith('#') || href.startsWith('http') || href.startsWith('mailto:')) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue