edit cards and switch

This commit is contained in:
madarsbiss 2021-09-23 13:40:17 +03:00
parent cf68971de5
commit 1dced10ce7
7 changed files with 21 additions and 16 deletions

4
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,4 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
}

View File

@ -17,7 +17,8 @@ export const MainCard = ({
</h1>
<p className={styles.description}>{description}</p>
<Image
className={styles.image}
width="300px"
height="300px"
src={`/icons/${iconName}.svg`}
alt="weatherIcon"
/>

View File

@ -13,11 +13,6 @@
margin-bottom: 20px;
}
.image {
width: 300px;
height: 300px;
}
.temperature {
font-size: 84px;
}

View File

@ -6,7 +6,7 @@ export const MetricsCard = ({ title, iconSrc, metric, unit }) => {
<div className={styles.wrapper}>
<p>{title}</p>
<div className={styles.content}>
<Image className={styles.image} src={iconSrc} alt="weatherIcon" />
<Image width="100px" height="100px" src={iconSrc} alt="weatherIcon" />
<div>
<h1>{metric}</h1>
<p>{unit}</p>

View File

@ -9,11 +9,6 @@
grid-template-columns: 1fr 1fr;
}
.image {
height: 100px;
width: 100px;
}
@media only screen and (max-width: 475px) {
.content {
grid-template-columns: 1fr 2fr;

View File

@ -4,15 +4,17 @@ export const UnitSwitch = ({ onClick, systemUsed }) => {
return (
<div className={styles.wrapper}>
<p
className={styles.switch}
style={{ color: systemUsed == "metric" ? "green" : "black" }}
className={`${styles.switch} ${
systemUsed == "metric" ? styles.active : styles.inactive
}`}
onClick={onClick}
>
Metric System
</p>
<p
className={styles.switch}
style={{ color: systemUsed == "metric" ? "black" : "green" }}
className={`${styles.switch} ${
systemUsed == "metric" ? styles.inactive : styles.active
}`}
onClick={onClick}
>
Imperial System

View File

@ -8,6 +8,14 @@
cursor: pointer;
}
.active {
color: green;
}
.inactive {
color: black;
}
@media only screen and (max-width: 475px) {
.wrapper {
text-align: center;