Skip to content

Commit

Permalink
basename add
Browse files Browse the repository at this point in the history
  • Loading branch information
kaleb110 committed Jun 25, 2024
1 parent e432a59 commit 719d449
Showing 1 changed file with 47 additions and 42 deletions.
89 changes: 47 additions & 42 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,49 +59,54 @@ function App() {
// fetchData();
};

const router = createBrowserRouter([
{
path: "/",
errorElement: <ErrorPage />,
element: (
<Home
handleBtnClick={handleBtnClick}
meal={meal}
truncateText={truncateText}
/>
),
},
{
path: "/search",
element: (
<Search
setquery={setquery}
handleBtnClick={handleBtnClick}
handleClick={handleClick}
isLoading={isLoading}
meal={meal}
truncateText={truncateText}
/>
),
},
const router = createBrowserRouter(
[
{
path: "/",
errorElement: <ErrorPage />,
element: (
<Home
handleBtnClick={handleBtnClick}
meal={meal}
truncateText={truncateText}
/>
),
},
{
path: "/search",
element: (
<Search
setquery={setquery}
handleBtnClick={handleBtnClick}
handleClick={handleClick}
isLoading={isLoading}
meal={meal}
truncateText={truncateText}
/>
),
},
{
path: "/alphabet",
element: (
<Alphabet
meal={meal}
handleBtnClick={handleBtnClick}
truncateText={truncateText}
onClick={handleBtnClick}
/>
),
children: [
{
path: "/alphabet/:letter",
element: <AlphabetLetter meal={meal} truncateText={truncateText} />,
},
],
},
],
{
path: "/alphabet",
element: (
<Alphabet
meal={meal}
handleBtnClick={handleBtnClick}
truncateText={truncateText}
onClick={handleBtnClick}
/>
),
children: [
{
path: "/alphabet/:letter",
element: <AlphabetLetter meal={meal} truncateText={truncateText} />,
},
],
},
]);
basename: "/Recipe-app-react",
}
);

return (
<div className="flex flex-col gap-3 py-4 px-4 sm:px-12 bg-slate-100 min-h-screen">
Expand Down

0 comments on commit 719d449

Please sign in to comment.