Skip to content

Commit 0b1f148

Browse files
committed
fix: fix base path on some links
1 parent 93e75d9 commit 0b1f148

File tree

6 files changed

+9
-7
lines changed

6 files changed

+9
-7
lines changed

components/logo/LogoImage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface LogoImageProps {
88

99
const alt = "Squonk (animal) logo with title text 'Squonk' and subtitle 'Data Manager'";
1010

11-
const basePath = process.env.NEXT_PUBLIC_BASE_PATH;
11+
const basePath = process.env.NEXT_PUBLIC_BASE_PATH ?? "";
1212

1313
export const LogoImage = ({ variant }: LogoImageProps) => {
1414
const [scheme] = useColorScheme();

components/products/ChargesLinkIconButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const ChargesLinkIconButton = ({ productId }: ChargesLinkIconButtonProps)
1313
<span>
1414
<IconButton
1515
disabled={!productId}
16-
href={`/product/${productId}/charges`}
16+
href={`${process.env.NEXT_PUBLIC_BASE_PATH ?? ""}/product/${productId}/charges`}
1717
size="small"
1818
sx={{ p: "1px" }}
1919
target="_blank"

components/userContext/SelectUnit.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ export const SelectUnit = (props: SelectUnitProps) => {
5858
<Tooltip title="Charges">
5959
<span>
6060
<IconButton
61-
href={`/unit/${unit.id}/charges`}
61+
href={`${process.env.NEXT_PUBLIC_BASE_PATH ?? ""}/unit/${
62+
unit.id
63+
}/charges`}
6264
size="small"
6365
sx={{ p: "1px" }}
6466
target="_blank"

features/DatasetsTable/DatasetDetails/VersionViewSection/VersionViewSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const VersionViewSection = ({ dataset, version }: VersionViewSectionProps
2828
button
2929
component="a"
3030
href={
31-
process.env.NEXT_PUBLIC_BASE_PATH +
31+
(process.env.NEXT_PUBLIC_BASE_PATH ?? "") +
3232
API_ROUTES.datasetVersion(dataset.dataset_id, version.version, "/api/viewer-proxy")
3333
}
3434
rel="noopener noreferrer"

features/ProjectTable/ProjectFileDetails/ProjectViewSection/ProjectViewSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const ProjectViewSection = ({ file }: ProjectViewSectionProps) => {
2323
button
2424
component="a"
2525
href={
26-
process.env.NEXT_PUBLIC_BASE_PATH +
26+
(process.env.NEXT_PUBLIC_BASE_PATH ?? "") +
2727
API_ROUTES.projectFile(projectId, path, file.fileName, "/api/viewer-proxy")
2828
}
2929
rel="noopener noreferrer"

layouts/navigation/UserMenuContent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const UserMenuContent = () => {
2626
<Typography>
2727
{user.username} /{" "}
2828
<Link
29-
href={process.env.NEXT_PUBLIC_BASE_PATH + `/api/auth/logout`}
29+
href={`${process.env.NEXT_PUBLIC_BASE_PATH ?? ""}/api/auth/logout`}
3030
onClick={() => {
3131
localStorage.clear();
3232
setUnit();
@@ -38,7 +38,7 @@ export const UserMenuContent = () => {
3838
</Typography>
3939
) : (
4040
<Typography>
41-
<Link href={process.env.NEXT_PUBLIC_BASE_PATH + `/api/auth/login`}>Login</Link>
41+
<Link href={`${process.env.NEXT_PUBLIC_BASE_PATH ?? ""}/api/auth/login`}>Login</Link>
4242
</Typography>
4343
)}
4444
</>

0 commit comments

Comments
 (0)