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
25 changes: 14 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>

</html>
91 changes: 91 additions & 0 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"preview": "vite preview"
},
"dependencies": {
"axios": "^1.7.9",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand All @@ -26,4 +27,4 @@
"sass": "^1.83.0",
"vite": "^6.0.3"
}
}
}
4 changes: 2 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import Home from "./pages/Home";

function App() {
return (
<>
<div>
<Home />
</>
</div>
);
}

Expand Down
9 changes: 8 additions & 1 deletion src/assets/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
outline: none;
}

.container {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}

html {
font-size: 100%;
scroll-behavior: smooth;
Expand Down Expand Up @@ -306,4 +313,4 @@ body.dark-theme .country-info li {

body.dark-theme .country-info strong {
color: white;
}
}
2 changes: 1 addition & 1 deletion src/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,4 @@
font-size: 16px;
text-transform: capitalize;
margin-bottom: 15px;
}
}
31 changes: 31 additions & 0 deletions src/assets/css/modal.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
}

.modal-container {
background: white;
padding: 20px;
border-radius: 8px;
width: 90%;
max-width: 500px;
position: relative;
}

.modal-close-button {
position: absolute;
top: 10px;
right: 10px;
background: none;
border: none;
font-size: 1.5rem;
cursor: pointer;
}
19 changes: 16 additions & 3 deletions src/components/Country.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
import React from 'react'
import "../assets/css/main.css"

const Country = () => {

const Country = ({ country }) => {
return (
// TODO: Country component
<div>Country</div>
<div className='country'>
<div className='country-flag'>
<img src={country.flag} alt={`${country.name} flag`} className='country-flag img' />
</div>
<div className='country-info'>
<h2 className='country-title'>{country.name}</h2>
<ul>
<li className='country-brief li'><strong>Population: </strong>{country.population}</li>
<li className='country-brief li'><strong>Region: </strong>{country.region}</li>
<li className='country-brief li'><strong>Capital: </strong>{country.capital}</li>
</ul>
</div>
</div>
)
}

Expand Down
17 changes: 17 additions & 0 deletions src/components/Modal.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from "react";
import "../assets/css/modal.css";

const Modal = ({ children, onClose }) => {
return (
<div className="modal-overlay" onClick={onClose}>
<div className="modal-container" onClick={(e) => e.stopPropagation()}>
<button className="modal-close-button" onClick={onClose}>
&times;
</button>
{children}
</div>
</div>
);
};

export default Modal;
Loading