Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Commit

Permalink
hopefully correct and working
Browse files Browse the repository at this point in the history
  • Loading branch information
mapachurro committed Jul 22, 2024
1 parent b287ade commit 8bcf936
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Education DAO Glossary</title>
<base href="/web3-glossary-website/" /> <!-- Ensure the base URL is correctly set -->
<base href="/web3-glossary-website/" /> <!-- Ensure this base URL is correctly set -->
</head>
<body>
<div id="root"></div>
<script type="module" src="./src/index.jsx"></script> <!-- Adjusted path to be relative -->
<script type="module" src="/src/index.jsx"></script> <!-- Adjusted path to be relative -->
</body>
</html>
16 changes: 15 additions & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useState, useEffect } from 'react';
import { Routes, Route, useNavigate } from 'react-router-dom';
import Search from './components/Search';
import index from './searchIndex';
import terms from './terms.json';
import EntryPage from './EntryPage';
Expand Down Expand Up @@ -50,6 +49,21 @@ function App() {
<Route path="/" element={<Home onSearch={handleSearch} />} />
<Route path="/term/:termKey" element={<EntryPage onNewSearch={handleNewSearch} />} />
</Routes>
{searchResults.length > 0 && (
<ul>
{searchResults.map((result) => (
<li
key={result.term}
onClick={() => navigate(`/term/${encodeURIComponent(result.term)}`)}
style={{
cursor: allTerms.includes(result.term) ? 'pointer' : 'default',
}}
>
{result.term}
</li>
))}
</ul>
)}
</div>
);
}
Expand Down
2 changes: 1 addition & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import react from '@vitejs/plugin-react';
import path from 'path';

export default defineConfig({
base: '/web3-glossary-website/', // Set this to your repository name
base: '/web3-glossary-website/', // Ensure this is set to your repository name
plugins: [react()],
resolve: {
alias: {
Expand Down

0 comments on commit 8bcf936

Please sign in to comment.