From 25a5ad518106c1bfb30e33c499976412de014c80 Mon Sep 17 00:00:00 2001 From: wheattoast11 Date: Wed, 20 Nov 2024 18:18:08 -0600 Subject: [PATCH] router fixes for Manifesto --- .github/workflows/deploy.yml | 8 ++++---- index.html | 5 ----- main.jsx | 7 +++++-- src/App.jsx | 25 +++++++++++++------------ vite.config.js | 3 --- 5 files changed, 22 insertions(+), 26 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9eab9ad..781688c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -12,8 +12,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 - uses: actions/setup-node@v4 with: node-version: 18 @@ -22,8 +20,10 @@ jobs: run: npm ci - name: Build run: npm run build - - name: Add .nojekyll file - run: touch dist/.nojekyll + - name: Add routing files + run: | + cp dist/index.html dist/404.html + touch dist/.nojekyll - name: Deploy to GitHub Pages uses: JamesIves/github-pages-deploy-action@v4 with: diff --git a/index.html b/index.html index 8714950..c769307 100644 --- a/index.html +++ b/index.html @@ -4,11 +4,7 @@ Intuition Labs LLC - AI Research & Consulting - -
diff --git a/main.jsx b/main.jsx index bf59ffe..9aaf4b1 100644 --- a/main.jsx +++ b/main.jsx @@ -3,6 +3,9 @@ import { createRoot } from 'react-dom/client'; import App from './src/App'; import './style.css'; -// Create React root for main app const root = createRoot(document.getElementById('root')); -root.render(); \ No newline at end of file +root.render( + + + +); \ No newline at end of file diff --git a/src/App.jsx b/src/App.jsx index 729d651..d07b4a5 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,6 +1,6 @@ import React, { useEffect } from 'react'; import { createRoot } from 'react-dom/client'; -import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; +import { BrowserRouter as Router, Routes, Route, Navigate } from 'react-router-dom'; import Home from './pages/Home'; import Manifesto from './pages/Manifesto'; import { Scene } from './three/Scene'; @@ -23,11 +23,13 @@ function App() { videoContainer.id = 'remotion-video'; document.body.appendChild(videoContainer); - // Create React root for video - const videoRoot = createRoot(videoContainer); + const root = document.createElement('div'); + root.id = 'remotion-root'; + videoContainer.appendChild(root); + + const videoRoot = createRoot(root); videoRoot.render(); - // Cleanup on unmount return () => { if (videoContainer.parentNode) { videoContainer.parentNode.removeChild(videoContainer); @@ -36,15 +38,14 @@ function App() { }, []); return ( - <> + - - - } /> - } /> - - - + + } /> + } /> + } /> + + ); } diff --git a/vite.config.js b/vite.config.js index e46d49f..cf567d4 100644 --- a/vite.config.js +++ b/vite.config.js @@ -9,8 +9,5 @@ export default defineConfig({ }, resolve: { extensions: ['.js', '.jsx'] - }, - server: { - historyApiFallback: true } }); \ No newline at end of file