-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fishing map/vessel profile route (#2807)
- Loading branch information
Showing
13 changed files
with
135 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,7 @@ | |
text-decoration: underline; | ||
margin: 0 0.2rem; | ||
} | ||
|
||
.link { | ||
text-decoration: underline; | ||
} |
36 changes: 36 additions & 0 deletions
36
apps/fishing-map/features/vessel-group-report/VesselGroupReportLink.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { useSelector } from 'react-redux' | ||
import React from 'react' | ||
import Link from 'redux-first-router-link' | ||
import { VESSEL_GROUP_REPORT } from 'routes/routes' | ||
import { selectWorkspace } from 'features/workspace/workspace.selectors' | ||
import { DEFAULT_WORKSPACE_CATEGORY, DEFAULT_WORKSPACE_ID } from 'data/workspaces' | ||
import { selectLocationQuery } from 'routes/routes.selectors' | ||
import styles from './VesselGroupReport.module.css' | ||
|
||
type VesselGroupReportLinkProps = { | ||
vesselGroupId: string | ||
children: React.ReactNode | ||
} | ||
|
||
function VesselGroupReportLink({ children, vesselGroupId }: VesselGroupReportLinkProps) { | ||
const workspace = useSelector(selectWorkspace) | ||
const query = useSelector(selectLocationQuery) | ||
return ( | ||
<Link | ||
className={styles.link} | ||
to={{ | ||
type: VESSEL_GROUP_REPORT, | ||
payload: { | ||
category: workspace?.category || DEFAULT_WORKSPACE_CATEGORY, | ||
workspaceId: workspace?.id || DEFAULT_WORKSPACE_ID, | ||
vesselGroupId: vesselGroupId, | ||
}, | ||
query, | ||
}} | ||
> | ||
{children} | ||
</Link> | ||
) | ||
} | ||
|
||
export default VesselGroupReportLink |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters