Skip to content

Commit

Permalink
eslint
Browse files Browse the repository at this point in the history
Signed-off-by: Micah Chiang <micahkchiang@gmail.com>
  • Loading branch information
micahchiang committed Mar 11, 2024
1 parent 54c4ee8 commit 81b3c2b
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 95 deletions.
20 changes: 10 additions & 10 deletions src/applications/medical-copays/containers/DetailPage.jsx
Expand Up @@ -33,19 +33,19 @@ const DetailPage = ({ match }) => {
mcpHTMLStatementToggle(state),
);

useEffect(
() => {
if (!isCurrentBalance) {
setAlert('past-due-balance');
}
scrollToTop();
},
[isCurrentBalance],
);
useEffect(() => {

Check failure on line 36 in src/applications/medical-copays/containers/DetailPage.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/medical-copays/containers/DetailPage.jsx:36:13:Insert `⏎····`
if (!isCurrentBalance) {

Check failure on line 37 in src/applications/medical-copays/containers/DetailPage.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/medical-copays/containers/DetailPage.jsx:37:1:Replace `····` with `······`
setAlert('past-due-balance');

Check failure on line 38 in src/applications/medical-copays/containers/DetailPage.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/medical-copays/containers/DetailPage.jsx:38:1:Insert `··`
}

Check failure on line 39 in src/applications/medical-copays/containers/DetailPage.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/medical-copays/containers/DetailPage.jsx:39:5:Insert `··`
scrollToTop();

Check failure on line 40 in src/applications/medical-copays/containers/DetailPage.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/medical-copays/containers/DetailPage.jsx:40:1:Replace `····` with `······`
}, [isCurrentBalance]);

Check failure on line 41 in src/applications/medical-copays/containers/DetailPage.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/medical-copays/containers/DetailPage.jsx:41:3:Replace `},·[isCurrentBalance]` with `··},⏎····[isCurrentBalance],⏎··`

return (
<>
<va-breadcrumbs uswds="false" className="vads-u-font-family--sans no-wrap">
<va-breadcrumbs
uswds="false"
className="vads-u-font-family--sans no-wrap"
>
<a href="/">Home</a>
<a href="/health-care">Health care</a>
<a href="/health-care/pay-copay-bill">Pay your VA copay bill</a>
Expand Down
Expand Up @@ -32,7 +32,10 @@ const HTMLStatementPage = ({ match }) => {
return (
<>
<article>
<va-breadcrumbs uswds="false" className="vads-u-font-family--sans no-wrap">
<va-breadcrumbs
uswds="false"
className="vads-u-font-family--sans no-wrap"
>
<a href="/">Home</a>
<a href="/health-care">Health care</a>
<a href="/health-care/pay-copay-bill">Pay your VA copay bill</a>
Expand Down
Expand Up @@ -26,98 +26,84 @@ const SmBreadcrumbs = () => {
}
}

const [locationBasePath, locationChildPath] = useMemo(
() => {
const pathElements = location.pathname.split('/');
if (pathElements[0] === '') pathElements.shift();
return pathElements;
},
[location],
);
const [locationBasePath, locationChildPath] = useMemo(() => {

Check failure on line 29 in src/applications/mhv/secure-messaging/components/shared/SmBreadcrumbs.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/mhv/secure-messaging/components/shared/SmBreadcrumbs.jsx:29:57:Insert `␍⏎····`
const pathElements = location.pathname.split('/');

Check failure on line 30 in src/applications/mhv/secure-messaging/components/shared/SmBreadcrumbs.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/mhv/secure-messaging/components/shared/SmBreadcrumbs.jsx:30:1:Replace `····` with `······`
if (pathElements[0] === '') pathElements.shift();

Check failure on line 31 in src/applications/mhv/secure-messaging/components/shared/SmBreadcrumbs.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/mhv/secure-messaging/components/shared/SmBreadcrumbs.jsx:31:5:Insert `··`
return pathElements;

Check failure on line 32 in src/applications/mhv/secure-messaging/components/shared/SmBreadcrumbs.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/mhv/secure-messaging/components/shared/SmBreadcrumbs.jsx:32:1:Replace `····` with `······`
}, [location]);

useEffect(
() => {
checkScreenSize();
},
[isMobile],
);
useEffect(() => {
checkScreenSize();
}, [isMobile]);

useEffect(
() => {
if (
`/${locationBasePath}/` === Constants.Paths.FOLDERS &&
parseInt(locationChildPath, 10) < 1
) {
navigateToFolderByFolderId(locationChildPath, history);
}
},
[locationBasePath, locationChildPath, history],
);
useEffect(() => {
if (
`/${locationBasePath}/` === Constants.Paths.FOLDERS &&
parseInt(locationChildPath, 10) < 1
) {
navigateToFolderByFolderId(locationChildPath, history);
}
}, [locationBasePath, locationChildPath, history]);

window.addEventListener('resize', checkScreenSize);

useEffect(
() => {
if (!locationBasePath) {
dispatch(setBreadcrumbs({}, location));
return;
}
useEffect(() => {
if (!locationBasePath) {
dispatch(setBreadcrumbs({}, location));
return;
}

const path = `/${locationBasePath}/`;
const path = `/${locationBasePath}/`;

if (
[
Constants.Paths.INBOX,
Constants.Paths.SENT,
Constants.Paths.DELETED,
Constants.Paths.DRAFTS,
].includes(path) ||
(path === Constants.Paths.FOLDERS && !locationChildPath)
) {
dispatch(setBreadcrumbs(Constants.Breadcrumbs.MESSAGES, location));
} else if (path === Constants.Paths.FOLDERS && locationChildPath) {
dispatch(setBreadcrumbs(Constants.Breadcrumbs.FOLDERS, location));
} else if (path === Constants.Paths.COMPOSE) {
dispatch(setBreadcrumbs(Constants.Breadcrumbs.INBOX, location));
} else if (
path ===
if (
[
Constants.Paths.INBOX,
Constants.Paths.SENT,
Constants.Paths.DELETED,
Constants.Paths.DRAFTS,
].includes(path) ||
(path === Constants.Paths.FOLDERS && !locationChildPath)
) {
dispatch(setBreadcrumbs(Constants.Breadcrumbs.MESSAGES, location));
} else if (path === Constants.Paths.FOLDERS && locationChildPath) {
dispatch(setBreadcrumbs(Constants.Breadcrumbs.FOLDERS, location));
} else if (path === Constants.Paths.COMPOSE) {
dispatch(setBreadcrumbs(Constants.Breadcrumbs.INBOX, location));
} else if (
path ===
(Constants.Paths.MESSAGE_THREAD ||
Constants.Paths.REPLY ||
Constants.Paths.COMPOSE) &&
activeFolder
) {
dispatch(
setBreadcrumbs(
{
path: `${Constants.Paths.FOLDERS}${activeFolder.folderId}`,
label: `Back to ${activeFolder.folderId < 1
? activeFolder.name.toLowerCase()
: activeFolder.name
}`,
},
location,
),
);
}
},
[
activeFolder,
dispatch,
location,
locationBasePath,
locationChildPath,
messageDetails?.subject,
],
);
activeFolder
) {
dispatch(
setBreadcrumbs(
{
path: `${Constants.Paths.FOLDERS}${activeFolder.folderId}`,
label: `Back to ${
activeFolder.folderId < 1
? activeFolder.name.toLowerCase()
: activeFolder.name
}`,
},
location,
),
);
}
}, [
activeFolder,
dispatch,
location,
locationBasePath,
locationChildPath,
messageDetails?.subject,
]);

useEffect(
() => {
if (messageDetails && !activeFolder) {
dispatch(retrieveFolder(messageDetails?.threadFolderId));
}
},
[messageDetails, activeFolder, dispatch],
);
useEffect(() => {
if (messageDetails && !activeFolder) {
dispatch(retrieveFolder(messageDetails?.threadFolderId));
}
}, [messageDetails, activeFolder, dispatch]);

const breadcrumbSize = () => {
if (isMobile) {
Expand All @@ -128,10 +114,15 @@ const SmBreadcrumbs = () => {

return (
<div
className={`breadcrumbs vads-1-row ${!crumbs?.label ? 'breadcrumbs--hidden' : ''
}`}
className={`breadcrumbs vads-1-row ${
!crumbs?.label ? 'breadcrumbs--hidden' : ''
}`}
>
<va-breadcrumbs uswds="false" label="Breadcrumb" home-veterans-affairs={false}>
<va-breadcrumbs
uswds="false"
label="Breadcrumb"
home-veterans-affairs={false}
>
{crumbs && (
<ul className={breadcrumbSize()}>
<li>
Expand Down

0 comments on commit 81b3c2b

Please sign in to comment.