Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
"coverage": "vitest run --coverage"
},
"dependencies": {
"@reduxjs/toolkit": "^2.8.2",
"@types/react-router-dom": "^5.3.3",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-redux": "^9.2.0",
"react-router": "^7.7.1",
"react-router-dom": "^7.7.1"
},
Expand Down
2 changes: 0 additions & 2 deletions src/About.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import React from "react";
import Header from "./Header";
function About(): React.ReactElement {
return (
<div className="about">
<Header></Header>
<div className="about-page">
<h1>Star Wars Planets App</h1>
<p>The author of the application is Pavel Kozin</p>
Expand Down
55 changes: 53 additions & 2 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
body {
background-color: white;
}

body.dark {
background-color: #2a2a2a;
}

.app-container {
max-width: 1200px;
margin: 0 auto;
Expand All @@ -6,13 +14,25 @@
padding-right: 100px;
}

.light {
background-color: white;
}

.dark {
background-color: #2a2a2a;
}

.title {
text-align: center;
color: #000000;
margin-bottom: 30px;
font-size: 2.5rem;
}

.title.dark {
color: #ffffff;
}

.search-container {
display: flex;
align-items: center;
Expand All @@ -23,7 +43,7 @@
margin-bottom: 30px;
}

input {
.main-input {
flex-grow: 1;
padding: 12px 15px;
border: 2px solid #444;
Expand All @@ -32,6 +52,9 @@ input {
color: white;
font-size: 1rem;
}
.search-container.dark {
background-color: #0e0e0e;
}

.search-container button {
padding: 12px 25px;
Expand Down Expand Up @@ -68,11 +91,39 @@ input {
gap: 10px;
}

.planet-checkbox {
width: 20px;
height: 20px;

appearance: none;
outline: none;
cursor: pointer;

border: 2px solid #000;
background-color: #fff;
border-radius: 4px;

position: relative;
transition: all 0.2s ease;
}

.planet-checkbox:checked {
background-color: #ffd700;
border-color: #000;
}

.planet-checkbox:hover {
box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.3);
}

.planet-card {
display: flex;
justify-content: space-between;
background-color: #333;
border-radius: 8px;
padding: 10px 20px 10px 20px;
transition: transform 0.3s;
cursor: pointer;
}

.planet-details {
Expand Down Expand Up @@ -199,8 +250,8 @@ input {
transform: rotate(360deg);
}
}

.error-test-button {
margin: 20px auto;
padding: 10px 20px;
background-color: #ffe81f;
color: rgb(0, 0, 0);
Expand Down
34 changes: 22 additions & 12 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,31 @@ import About from "./About";
import ErrorBoundary from "./ErrorBoundary";
import { BrowserRouter } from "react-router";
import PlanetCard from "./PlanetCard";
import { ThemeProvider } from "./ThemeProvider";
import { Provider } from "react-redux";
import { store } from "./store/store";
import Wrapper from "./Wrapper";

function App() {
return (
<ErrorBoundary>
<BrowserRouter>
<Routes>
<Route path="/" element={<MainPage />} />
<Route path="/:pageNumber" element={<MainPage />}>
<Route path=":planetId" element={<PlanetCard />} />
</Route>
<Route path="/about" element={<About />} />
<Route path="*" element={<Page404 />} />
</Routes>
</BrowserRouter>
</ErrorBoundary>
<ThemeProvider>
<Provider store={store}>
<ErrorBoundary>
<BrowserRouter>
<Routes>
<Route element={<Wrapper />}>
<Route path="/" element={<MainPage />} />
<Route path="/about" element={<About />} />
<Route path="/list/:pageNumber" element={<MainPage />}>
<Route path=":planetId" element={<PlanetCard />} />
</Route>
<Route path="*" element={<Page404 />} />
</Route>
</Routes>
</BrowserRouter>
</ErrorBoundary>
</Provider>
</ThemeProvider>
);
}

Expand Down
24 changes: 0 additions & 24 deletions src/Header.css

This file was deleted.

17 changes: 0 additions & 17 deletions src/Header.tsx

This file was deleted.

Loading