Skip to content

Commit efcaad6

Browse files
committed
fix: search for apps.
1 parent f4e4ef2 commit efcaad6

File tree

12 files changed

+37
-36
lines changed

12 files changed

+37
-36
lines changed

src/components/AnimatedRoutes.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import LogsPage from '../pages/LogsPage';
1111
import LogDetailPage from '../pages/LogDetailPage';
1212
import NotFoundPage from '../pages/NotFoundPage';
1313
import SeriesPage from '../pages/SeriesPage';
14-
import DndPage from '../pages/DndPage';
15-
import DndNotFoundPage from '../pages/DndNotFoundPage';
16-
import DndEpisodePage from '../pages/DndEpisodePage';
17-
import DndLorePage from '../pages/DndLorePage';
18-
import DndBookPage from '../pages/DndBookPage';
14+
import DndPage from '../pages/dnd/DndPage';
15+
import DndNotFoundPage from '../pages/dnd/DndNotFoundPage';
16+
import DndEpisodePage from '../pages/dnd/DndEpisodePage';
17+
import DndLorePage from '../pages/dnd/DndLorePage';
18+
import DndBookPage from '../pages/dnd/DndBookPage';
1919
import AppPage from '../pages/AppPage';
2020
import IpPage from '../pages/apps/IpPage';
2121
import WordCounterPage from '../pages/apps/WordCounterPage';

src/components/Layout.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import React, { useState, useEffect } from 'react';
22
import Navbar from './Navbar';
33
import Sidebar from './Sidebar';
44
import Footer from './Footer';
5-
import DndNavbar from './DndNavbar';
6-
import DndFooter from './DndFooter';
5+
import DndNavbar from './dnd/DndNavbar';
6+
import DndFooter from './dnd/DndFooter';
77
import { useLocation } from 'react-router-dom';
88
import Search from './Search'; // Import the Search component
99

src/components/Search.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ const Search = ({ isVisible }) => {
2929
const posts = await postsRes.json();
3030
const projects = await projectsRes.json();
3131
const logs = await logsRes.json();
32-
const apps = await appsRes.json();
32+
const appsData = await appsRes.json();
33+
const allApps = Object.values(appsData).flatMap(category => category.apps);
3334

3435
const allPosts = posts.flatMap(item =>
3536
item.series ? item.series.posts.map(p => ({ ...p, series: item.title })) : item
@@ -49,7 +50,7 @@ const Search = ({ isVisible }) => {
4950
{ title: 'Random', slug: '/random', type: 'route' },
5051
];
5152

52-
setData({ posts: allPosts, projects: projects, logs: logs, routes: routes, apps: apps }); // Include routes in data
53+
setData({ posts: allPosts, projects: projects, logs: logs, routes: routes, apps: allApps }); // Include routes in data
5354
} catch (error) {
5455
console.error('Failed to fetch search data:', error);
5556
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { Link } from 'react-router-dom';
3-
import '../styles/dnd.css';
3+
import '../../styles/dnd.css';
44

55
const DndCard = ({ title, author, link, backgroundImage, className, overlayColor }) => {
66
return (
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useContext } from 'react';
2-
import { DndContext } from '../context/DndContext';
2+
import { DndContext } from '../../context/DndContext';
33
import DndLogo from './DndLogo'; // Import DndLogo
44

55
const DndFooter = () => {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useContext } from 'react';
22
import { Link } from 'react-router-dom';
3-
import { DndContext } from '../context/DndContext'; // Import DndContext
3+
import { DndContext } from '../../context/DndContext'; // Import DndContext
44

55
const DndNavbar = () => {
66
const { breadcrumbs } = useContext(DndContext); // Get breadcrumbs from context
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React, { useState, useEffect, useContext } from 'react';
22
import { useParams, Link } from 'react-router-dom';
33
import { motion } from 'framer-motion';
4-
import '../styles/dnd.css';
5-
import { DndContext } from '../context/DndContext'; // Import DndContext
6-
import { parseWallpaperName } from '../utils/dndUtils'; // Import parseWallpaperName
7-
import dndWallpapers from '../utils/dndWallpapers';
8-
import useSeo from "../hooks/useSeo";
4+
import '../../styles/dnd.css';
5+
import { DndContext } from '../../context/DndContext'; // Import DndContext
6+
import { parseWallpaperName } from '../../utils/dndUtils'; // Import parseWallpaperName
7+
import dndWallpapers from '../../utils/dndWallpapers';
8+
import useSeo from "../../hooks/useSeo";
99
import piml from 'piml';
1010

1111
const pageVariants = {
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React, { useState, useEffect, useContext } from 'react';
22
import {Link, useParams} from 'react-router-dom';
33
import { motion } from 'framer-motion';
4-
import '../styles/dnd.css';
5-
import { DndContext } from '../context/DndContext'; // Import DndContext
6-
import { parseWallpaperName } from '../utils/dndUtils'; // Import parseWallpaperName
7-
import dndWallpapers from '../utils/dndWallpapers';
8-
import useSeo from "../hooks/useSeo";
4+
import '../../styles/dnd.css';
5+
import { DndContext } from '../../context/DndContext'; // Import DndContext
6+
import { parseWallpaperName } from '../../utils/dndUtils'; // Import parseWallpaperName
7+
import dndWallpapers from '../../utils/dndWallpapers';
8+
import useSeo from "../../hooks/useSeo";
99
import piml from 'piml';
1010

1111
const pageVariants = {
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import React, { useState, useEffect, useContext } from 'react'; // Added useState, useEffect, and useContext
22
import { Link } from 'react-router-dom';
33
import { motion } from 'framer-motion';
4-
import '../styles/dnd.css';
5-
import { DndContext } from '../context/DndContext'; // Import DndContext
6-
import { parseWallpaperName } from '../utils/dndUtils'; // Import parseWallpaperName
7-
import dndWallpapers from '../utils/dndWallpapers';
8-
import DndCard from '../components/DndCard'; // Import DndCard
4+
import '../../styles/dnd.css';
5+
import { DndContext } from '../../context/DndContext'; // Import DndContext
6+
import { parseWallpaperName } from '../../utils/dndUtils'; // Import parseWallpaperName
7+
import dndWallpapers from '../../utils/dndWallpapers';
8+
import DndCard from '../../components/dnd/DndCard'; // Import DndCard
99
import Slider from 'react-slick'; // Import Slider
1010
import 'slick-carousel/slick/slick.css'; // Import slick-carousel CSS
1111
import 'slick-carousel/slick/slick-theme.css'; // Import slick-carousel theme CSS
12-
import useSeo from "../hooks/useSeo";
12+
import useSeo from "../../hooks/useSeo";
1313
import piml from 'piml';
1414

1515
const pageVariants = {

0 commit comments

Comments
 (0)