Skip to content

Commit 0a3f264

Browse files
committed
edit starting point for context lecture
1 parent 8e8d82b commit 0a3f264

File tree

7 files changed

+1
-310
lines changed

7 files changed

+1
-310
lines changed

react/core/06-context/lecture/AccountFavorites.tsx

Lines changed: 0 additions & 65 deletions
This file was deleted.

react/core/06-context/lecture/FavoriteContext.tsx

Lines changed: 0 additions & 41 deletions
This file was deleted.

react/core/06-context/lecture/FavoriteVacationButton.tsx

Lines changed: 0 additions & 25 deletions
This file was deleted.

react/core/06-context/lecture/VacationDetailsPage.tsx

Lines changed: 0 additions & 66 deletions
This file was deleted.

react/core/06-context/lecture/VacationsSubLayout.tsx

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 1 addition & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,4 @@
11
import * as ReactDOM from 'react-dom/client'
2+
import { App } from './hello-context'
23

3-
// Start Here
4-
import { App } from './hello-world'
54
ReactDOM.createRoot(document.getElementById('root')!).render(<App />)
6-
7-
// import { useState } from 'react'
8-
// import {
9-
// RouterProvider,
10-
// Navigate,
11-
// Route,
12-
// createBrowserRouter,
13-
// createRoutesFromElements,
14-
// } from 'react-router-dom'
15-
// import { QueryClientProvider } from '@tanstack/react-query'
16-
// import { AuthProvider } from '~/AuthContext'
17-
// import { FavoriteProvider } from './FavoriteContext'
18-
// import { queryClient } from '~/utils/queryClient'
19-
20-
// // Layouts
21-
// import { MainLayout } from '~/MainLayout'
22-
// import { VacationsSubLayout } from './VacationsSubLayout'
23-
24-
// // Pages
25-
// import { BrowseVacationsPage, loader as BrowseVacationsLoader } from '~/BrowseVacationsPage'
26-
// import { VacationDetailsPage, loader as VacationDetailsLoader } from './VacationDetailsPage'
27-
// import { ErrorPage } from '~/ErrorPage'
28-
// import { NotFoundPage } from '~/NotFoundPage'
29-
30-
// function App() {
31-
// const [favorites, setFavorites] = useState<number[]>([])
32-
33-
// function updateFavorite(id: number) {
34-
// if (isFavorite(id)) {
35-
// setFavorites(favorites.filter((favId) => favId !== id))
36-
// } else {
37-
// setFavorites(favorites.concat(id))
38-
// }
39-
// }
40-
41-
// function isFavorite(id: number) {
42-
// return favorites.includes(id)
43-
// }
44-
45-
// return (
46-
// <RouterProvider
47-
// router={createBrowserRouter(
48-
// createRoutesFromElements(
49-
// <Route element={<MainLayout />}>
50-
// <Route
51-
// element={<VacationsSubLayout favorites={favorites} updateFavorite={updateFavorite} />}
52-
// >
53-
// <Route index element={<BrowseVacationsPage />} loader={BrowseVacationsLoader} />
54-
// <Route path="vacations">
55-
// <Route
56-
// path=":vacationId"
57-
// element={
58-
// <VacationDetailsPage
59-
// favorites={favorites}
60-
// updateFavorite={updateFavorite}
61-
// isFavorite={isFavorite}
62-
// />
63-
// }
64-
// loader={VacationDetailsLoader}
65-
// errorElement={<ErrorPage />}
66-
// />
67-
// <Route path="deal-of-the-day" element={<Navigate to="../3" />} />
68-
// <Route index element={<Navigate to="/" />} />
69-
// </Route>
70-
// </Route>
71-
// <Route path="*" element={<NotFoundPage />} />
72-
// </Route>
73-
// )
74-
// )}
75-
// />
76-
// )
77-
// }
78-
79-
// ReactDOM.createRoot(document.getElementById('root')!).render(
80-
// <QueryClientProvider client={queryClient}>
81-
// <AuthProvider>
82-
// {/* <FavoriteProvider> */}
83-
// <App />
84-
// {/* </FavoriteProvider> */}
85-
// </AuthProvider>
86-
// </QueryClientProvider>
87-
// )

0 commit comments

Comments
 (0)