create SwitchBox comp

This commit is contained in:
madarsbiss
2021-09-21 19:31:30 +03:00
parent 3ec5ec415e
commit 56268d2392
4 changed files with 36 additions and 26 deletions

24
components/SwitchBox.js Normal file
View File

@@ -0,0 +1,24 @@
import styles from "./SwitchBox.module.css";
const SwitchBox = ({ onClick, systemUsed }) => {
return (
<div className={styles.wrapper}>
<p
className={styles.switch}
style={{ color: systemUsed == "metric" ? "green" : "black" }}
onClick={onClick}
>
Metric System
</p>
<p
className={styles.switch}
style={{ color: systemUsed == "metric" ? "black" : "green" }}
onClick={onClick}
>
Imperial System
</p>
</div>
);
};
export default SwitchBox;

View File

@@ -0,0 +1,9 @@
.wrapper {
text-align: right;
}
.switch {
margin: 0 10px;
cursor: pointer;
display: inline;
}