Skip to content

Commit

Permalink
Merge pull request #14 from db1group/feature/responsive-menu
Browse files Browse the repository at this point in the history
implement responsive language menu
  • Loading branch information
AlexandroHervis authored Jul 12, 2023
2 parents f995a19 + 306ffa1 commit 45b53a0
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/ButtonFlag/ButtonFlag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function ButtonFlag() {
<div>
{languageOptions.map(languageOption => (
<img
className='buttonFlag'
className='button-flag'
src={languageOption.flag}
alt={languageOption.name}
onClick={async () => {
Expand Down
9 changes: 4 additions & 5 deletions src/components/ButtonFlag/buttonFlag.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
.buttonFlag {
margin-left: 8px;
border-radius: 100%;
.button-flag {
margin-right: 8px;
height: 35px;
vertical-align: bottom;
vertical-align: bottom;
}

.buttonFlag:hover {
.button-flag:hover {
opacity: 0.7;
cursor: pointer;
}
6 changes: 5 additions & 1 deletion src/components/LogoLink/LogoLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { assetUrl } from "../../config";
import Link from "../Link/Link";
import "./logo-link.scss";
import { useTranslation } from "react-i18next";
import ButtonFlag from "../ButtonFlag/ButtonFlag";

export default function LogoLink({ small = false }: { small?: boolean }) {
const { t } = useTranslation();
Expand All @@ -20,7 +21,10 @@ export default function LogoLink({ small = false }: { small?: boolean }) {

alt={`${t('radarName')}`}
/>
<span className="logo-link__text">{t('radarName')}</span>
<div className="button-flag__logo"><ButtonFlag /></div>
{small &&
<span className="logo-link__text">{t('radarName')}</span>
}
</span>
</Link>
);
Expand Down
4 changes: 4 additions & 0 deletions src/components/LogoLink/logo-link.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
transform: scale(0.55);
}

.button-flag__logo {
display: none;
}

.logo-link__text {
opacity: 0.8;
}
Expand Down
26 changes: 25 additions & 1 deletion src/styles/components/page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,30 @@
margin: 0;
}

@media (max-width: $until-lg) {
@media (min-width: $until-sm) {
.button-flag__logo {
display: none;
}
}

@media (max-width: $until-sm) {
.nav {
display: none;
}

.button-flag {
display: inline-flex;
height: 25px;
margin-right: 5px;
}

.button-flag:hover {
opacity: 1;
}

.logo-link__text {
display: none;
}
}
}

Expand All @@ -33,5 +53,9 @@
&__footer {
margin-top: 5px;
flex: 0 0 auto;

.button-flag {
display: none;
}
}
}

0 comments on commit 45b53a0

Please sign in to comment.