-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.tsx
More file actions
50 lines (47 loc) · 1.73 KB
/
index.tsx
File metadata and controls
50 lines (47 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import React from "react"
import { createRoot } from "react-dom/client"
import { KlevuConfig, KlevuKMCSettings } from "@klevu/core"
import { App } from "./app"
import { BrowserRouter, Routes, Route } from "react-router-dom"
import { HomePage } from "./routes/HomePage"
import { ProductsPage } from "./routes/ProductsPage"
import { ProductPage } from "./routes/ProductPage"
import { CategoryPage } from "./routes/CategoryPage"
import { SearchResultPage } from "./routes/SearchResultPage"
import { CheckoutPage } from "./routes/CheckoutPage"
import axios from "axios"
import "swiper/css/bundle"
import { config } from "./config"
KlevuConfig.init({
...config,
axios,
enableKlaviyoConnector:
!!localStorage.getItem("klevu-enable-klaviyo") || false,
useConsent: !!localStorage.getItem("klevu-use-consent") || false,
consentGiven: !!localStorage.getItem("klevu-consent-given") || false,
})
KlevuKMCSettings()
const container = document.getElementById("reactroot")
const root = createRoot(container!)
root.render(
<BrowserRouter>
<Routes>
<Route path="/" element={<App />}>
<Route index element={<HomePage />} />
<Route path="products" element={<ProductsPage />}>
<Route path=":groupId/:id" element={<ProductPage />} />
<Route path=":id" element={<ProductPage />} />
</Route>
<Route path="category" element={<CategoryPage />}>
<Route path=":id" element={<CategoryPage />} />
</Route>
<Route
path="search"
element={<SearchResultPage personlisationEnabled />}
/>
<Route path="searchnopersonalisation" element={<SearchResultPage />} />
<Route path="cart" element={<CheckoutPage />} />
</Route>
</Routes>
</BrowserRouter>
)