diff --git a/src/App.tsx b/src/App.tsx index 4a80055fe..9780be72e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,9 +3,7 @@ import { useQuery } from '@tanstack/react-query'; import { MarkdownText } from 'MarkdownTest'; import { fetchUserProfile } from 'api/requests'; import useSblAuth from 'api/useSblAuth'; -import classNames from 'classnames'; import FooterCfGovWrapper from 'components/FooterCfGovWrapper'; -import { Link } from 'components/Link'; import { LoadingApp, LoadingContent } from 'components/Loading'; import ScrollToTop from 'components/ScrollToTop'; import { Alert, PageHeader, SkipNav } from 'design-system-react'; @@ -77,44 +75,6 @@ if (import.meta.env.DEV) { // eslint-disable-next-line no-console if (!isRoutingEnabled) console.warn('Routing is disabled!'); -/** - * Determine if the current provided URL (href) is the current page - * @param href string - * @returns string - */ -const deriveClassname = (href: string): string => { - let cname = 'nav-item'; - const pattern = `${href}$`; - - const regex = new RegExp(pattern); - if (regex.test(window.location.href)) { - cname += ' selected'; - } - - return cname; -}; - -interface NavItemProperties { - className: string; - href: string; - label: string; -} - -export function NavItem({ - href, - label, - className, -}: NavItemProperties): JSX.Element { - return ( - - {label} - - ); -} - function BasicLayout(): Promise | ReactElement { const headerLinks = [...useHeaderAuthLinks()]; const location = useLocation(); diff --git a/src/components/Link.utils.tsx b/src/components/Link.utils.tsx index 092e07685..e721c00ac 100644 --- a/src/components/Link.utils.tsx +++ b/src/components/Link.utils.tsx @@ -27,12 +27,16 @@ export const isExternalLinkImplied = (targetUrl: string): boolean => { const internalProtocols = ['mailto:']; if (internalProtocols.includes(parsed.protocol)) return false; - // Any subdomain of consumerfinance.gov or the current host - const isInternalDomain = new RegExp( - `([\\S]*\\.)?(consumerfinance\\.gov|${window.location.host})`, - ).test(parsed.host); + // [Internal] Any subdomain of consumerfinance.gov or the current host + const internalHosts = [ + 'www.consumerfinance.gov', + 'sblhelp.consumerfinance.gov', + window.location.host, + ]; - return !isInternalDomain; + const isExternal = !internalHosts.includes(parsed.host); + + return isExternal; }; // External link icon w/ spacing diff --git a/src/pages/Filing/FilingApp/FilingSteps.helpers.tsx b/src/pages/Filing/FilingApp/FilingSteps.helpers.tsx index a4cbec41a..70dd27ad1 100644 --- a/src/pages/Filing/FilingApp/FilingSteps.helpers.tsx +++ b/src/pages/Filing/FilingApp/FilingSteps.helpers.tsx @@ -6,9 +6,7 @@ import { FilingStatusAsNumber } from 'types/filingTypes'; // Does the current browser URL correspond to this Step? const isStepCurrent = (stepPath: string): boolean => { const { pathname } = window.location; - const matcher = new RegExp(stepPath); - if (matcher.test(pathname)) return true; - return false; + return pathname.includes(stepPath); }; const getUploadStatus = (