Skip to content

Commit 83d2d21

Browse files
committed
Add / for all urls
1 parent 0c7d307 commit 83d2d21

7 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ export default function App() {
2828
<Route path="/map" element={<MapPage />} />
2929
<Route path="*" element={<NotFoundPage />} />
3030
</Routes>
31-
</RouterComponent>
31+
</HashRouter>
3232
);
3333
}

src/components/BottomNav.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default function BottomNav() {
2424
style={{ paddingBottom: "env(safe-area-inset-bottom)" }}
2525
>
2626
<NavLink
27-
to="home"
27+
to={`/home`}
2828
aria-label="خانه"
2929
className={({ isActive }) =>
3030
`w-20 flex flex-col items-center justify-center px-3 py-1.5 rounded-md ${isActive ? "bg-primary text-white" : "text-gray-600"}`
@@ -35,7 +35,7 @@ export default function BottomNav() {
3535
</NavLink>
3636

3737
<NavLink
38-
to="cities"
38+
to={`/cities`}
3939
aria-label="شهرها"
4040
className={({ isActive }) =>
4141
`w-20 flex flex-col items-center justify-center px-3 py-1.5 rounded-md ${isActive ? "bg-primary text-white" : "text-gray-600"}`
@@ -46,7 +46,7 @@ export default function BottomNav() {
4646
</NavLink>
4747

4848
<NavLink
49-
to="smart-suggest"
49+
to={`/smart-suggest`}
5050
aria-label="پیشنهاد"
5151
className={({ isActive }) =>
5252
`w-20 flex flex-col items-center justify-center px-3 py-1.5 rounded-md ${isActive ? "bg-primary text-white" : "text-gray-600"}`
@@ -57,7 +57,7 @@ export default function BottomNav() {
5757
</NavLink>
5858

5959
<NavLink
60-
to="map"
60+
to={`/map`}
6161
aria-label="نقشه"
6262
className={({ isActive }) =>
6363
`w-20 flex flex-col items-center justify-center px-3 py-1.5 rounded-md ${isActive ? "bg-primary text-white" : "text-gray-600"}`

src/pages/CitiesListPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const CitiesListPage: React.FC = () => {
9393
return (
9494
<li key={city.name} className="list-none">
9595
<Link
96-
to={`city/${city.name}`}
96+
to={`/city/${city.name}`}
9797
className="block w-full cursor-pointer bg-white rounded shadow p-3"
9898
>
9999
<div className="flex items-center w-full">

src/pages/CityDetailPage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ const CityDetailPage: React.FC = () => {
167167
<Container>
168168
<p className="text-sm text-gray-600 mb-4">نام شهر معتبر نیست.</p>
169169
<Link
170-
to="cities"
170+
to={`/cities`}
171171
className="inline-flex items-center gap-2 rounded-full bg-primary text-white px-4 py-2 text-sm shadow"
172172
>
173173
بازگشت به لیست شهرها
@@ -314,7 +314,7 @@ const CityDetailPage: React.FC = () => {
314314
<h2 className="text-lg font-bold">جاهای دیدنی</h2>
315315
</div>
316316
<Link
317-
to={`city/${cityName}/attractions`}
317+
to={`/city/${cityName}/attractions`}
318318
className="flex items-center gap-2 text-sm text-primary hover:text-primary/80"
319319
>
320320
مشاهده بیشتر
@@ -330,7 +330,7 @@ const CityDetailPage: React.FC = () => {
330330
{featuredAttractions.map((attraction) => (
331331
<Link
332332
key={attraction.id}
333-
to={`city/${cityName}/attraction/${attraction.id}`}
333+
to={`/city/${cityName}/attraction/${attraction.id}`}
334334
className="flex items-center gap-3 rounded-2xl border border-gray-100 bg-white p-3 shadow-sm hover:shadow-md transition"
335335
>
336336
<div className="relative h-20 w-24 overflow-hidden rounded-xl">

src/pages/NotFoundPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default function NotFoundPage() {
2121
ممکن است آدرس را اشتباه وارد کرده باشید یا صفحه حذف شده باشد.
2222
</p>
2323
<div className="flex flex-col sm:flex-row gap-3 justify-center mt-2">
24-
<Link to="home" className="px-4 py-2 rounded-lg bg-primary text-white hover:opacity-90 transition">
24+
<Link to={`/home`} className="px-4 py-2 rounded-lg bg-primary text-white hover:opacity-90 transition">
2525
بازگشت به خانه
2626
</Link>
2727
</div>

src/routes/ProtectedRoute.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type Props = {
88

99
export default function ProtectedRoute({ children }: Props) {
1010
if (!isAuthenticated()) {
11-
return <Navigate to="login" replace />;
11+
return <Navigate to={`/login`} replace />;
1212
}
1313
return <>{children}</>;
1414
}

src/routes/PublicRoute.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type Props = {
88

99
export default function ProtectedRoute({ children }: Props) {
1010
if (isAuthenticated()) {
11-
return <Navigate to="home" replace />;
11+
return <Navigate to={`/home`} replace />;
1212
}
1313
return <>{children}</>;
1414
}

0 commit comments

Comments
 (0)