Added base path
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Shahan Nedadahandeh 2022-12-29 18:01:19 -05:00
parent 7088c3b494
commit efc4b3a198
3 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import { pageRoutes } from "data/routes";
import Link from "next/link";
import React, { useState } from "react";
import { basePath } from "utils/getBasePath";
import { Sections } from "./Sections";
@ -32,7 +33,7 @@ export function Header() {
className={styles.menuIcon}
>
<img
src="/images/menuIcon.svg"
src={basePath + "/images/menuIcon.svg"}
width="50"
height="50"
draggable="false"
@ -52,7 +53,7 @@ export function Header() {
}}
>
<img
src="/images/rightArrow.svg"
src={basePath + "/images/rightArrow.svg"}
className={styles.arrowIcon}
width="50"
height="50"

View File

@ -4,6 +4,8 @@ const nextConfig = {
basePath: basePath,
assetPrefix: basePath + "/",
publicRuntimeConfig : { basePath: basePath },
// test comment
reactStrictMode: true,
trailingSlash: true,

6
utils/getBasePath.ts Normal file
View File

@ -0,0 +1,6 @@
import config from "next/config";
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const { publicRuntimeConfig } = config();
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
const basePath = publicRuntimeConfig.basePath as string;
export { basePath };