Skip to content

Commit 871bf4d

Browse files
Update select languege icon and style
1 parent 0c4b344 commit 871bf4d

4 files changed

Lines changed: 42 additions & 10 deletions

File tree

public/brazil-flag.svg

Lines changed: 3 additions & 0 deletions
Loading

public/eua-flag.svg

Lines changed: 3 additions & 0 deletions
Loading

src/components/Language/language.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ import { useTranslation } from 'react-i18next';
44
import Image from 'next/image';
55
import { i18nConfig } from '@/i18n';
66
import { Paragraph1 } from '@/styles/typographies';
7-
import languageIcon from '../../../public/language.svg';
7+
import brazilFlag from '../../../public/brazil-flag.svg';
8+
import euaFlag from '../../../public/eua-flag.svg';
89
import { SelectContainer, OptionsContainer, Option, ContainerLanguage } from './styles';
910

1011
const languageNames: Record<string, string> = {
11-
pt: 'Português',
12-
en: 'English',
12+
pt: 'PT-BR',
13+
en: 'EN-US',
1314
};
1415

1516
export const Language: React.FC = () => {
@@ -51,7 +52,7 @@ export const Language: React.FC = () => {
5152
onClick={handleIconClick}
5253
>
5354
<Image
54-
src={languageIcon}
55+
src={currentLocale === 'pt' ? brazilFlag : euaFlag}
5556
alt='language icon in black'
5657
width={24}
5758
height={24}

src/components/Language/styles.tsx

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,58 @@ export const ContainerLanguage = styled.div`
55
position: relative;
66
flex-direction: column;
77
justify-content: center;
8-
align-items: center;
8+
align-items: stretch;
99
width: fit-content;
10+
border-radius: 8px;
11+
12+
&:hover {
13+
background-color: #ccc;
14+
}
1015
`;
1116

1217
export const SelectContainer = styled.button`
1318
cursor: pointer;
14-
border-radius: 4px;
19+
padding: 8px 24px;
1520
border: none;
16-
background-color: white;
21+
background-color: transparent;
22+
23+
@media (max-width: 500px) {
24+
padding: 8px 16px;
25+
img {
26+
width: 20px;
27+
height: 20px;
28+
}
29+
}
1730
`;
1831

1932
export const OptionsContainer = styled.div`
20-
border-radius: 4px;
33+
border-radius: 8px;
2134
margin-top: 5px;
2235
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
2336
z-index: 1000;
2437
position: absolute;
2538
top: 100%;
39+
width: 100%;
2640
`;
41+
2742
export const Option = styled.div`
2843
text-align: center;
2944
padding: 10px;
3045
min-width: fit-content;
31-
height: 30px;
3246
background-color: white;
3347
cursor: pointer;
48+
text-align: center;
49+
50+
&:first-child {
51+
border-top-left-radius: 8px;
52+
border-top-right-radius: 8px;
53+
}
54+
&:last-child {
55+
border-bottom-left-radius: 8px;
56+
border-bottom-right-radius: 8px;
57+
}
58+
3459
&:hover {
35-
background-color: #f0f0f0;
60+
background-color: #ccc;
3661
}
3762
`;

0 commit comments

Comments
 (0)