Skip to content

Commit

Permalink
Add base path into github action
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapawar1 committed Jan 17, 2025
1 parent 59dcf01 commit b4685e9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/nextjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ jobs:
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Build with Next.js
run: ${{ steps.detect-package-manager.outputs.runner }} next build
env: BASE_PATH: ${{ github.repository }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
17 changes: 14 additions & 3 deletions components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
'use client';

import { useState } from 'react';
import { FaBars } from 'react-icons/fa';
import Image from 'next/image';
import Link from 'next/link';
Expand All @@ -11,6 +14,8 @@ type NavbarProps = {

// TODO: Add mobile nav bar state
export default function Navbar({ variant }: NavbarProps) {
const [showMobileNav, setShowMobileNav] = useState(false);

return (
<nav className={`bp-nav ${variant}`}>
<div className="container max-w-[1170px]">
Expand All @@ -28,11 +33,17 @@ export default function Navbar({ variant }: NavbarProps) {
blueprint
</Link>
</div>
<button className="mobile-nav-btn mobile-nav-show">
<button
className="mobile-nav-btn mobile-nav-show"
onClick={() => setShowMobileNav(true)}
>
<FaBars />
</button>
<ul className="link-container">
<button className="mobile-nav-btn mobile-nav-close">
<ul className={`link-container ${showMobileNav && 'mobile-show'}`}>
<button
className="mobile-nav-btn mobile-nav-close"
onClick={() => setShowMobileNav(false)}
>
<Image alt="close menu" src={closeIcon} />
</button>
<li
Expand Down
2 changes: 1 addition & 1 deletion next.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { NextConfig } from 'next';

const nextConfig: NextConfig = {
basePath: process.env.BASE_PATH || '/calblueprint.org.v2',
basePath: '/' + (process.env.BASE_PATH || 'calblueprint.org.v2'),
images: {
dangerouslyAllowSVG: true,
contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;",
Expand Down

0 comments on commit b4685e9

Please sign in to comment.