fix: language selector is now working properly

This commit is contained in:
GivFNZ 2025-02-28 18:44:16 -03:00
parent cb79da4b18
commit 078b11afff
No known key found for this signature in database
GPG Key ID: 63DD92181B575322
6 changed files with 13 additions and 7 deletions

View File

@ -37,7 +37,7 @@ function App() {
</HashRouter>
<footer>
<p>© 2025 GivFNZ</p>
<p>Version: 1.1.10</p>
<p>Version: 1.1.11</p>
</footer>
</ThemeProvider>
);

View File

@ -2,11 +2,12 @@ import { HashRouter } from "react-router-dom";
import { HeaderContainer, NavLink, HomeLink, LanguageSelector } from "./styles";
import { AvatarHeader } from "../Avatar/avatar";
import i18n from "../../utils/i18n";
import { t } from "i18next";
import { Drawer, DrawerContainer, DrawerItem } from "../Drawer/styles";
import useDrawerVisible from "../../hooks/useDrawerVisible";
import { useTranslation } from "react-i18next";
export default function Header() {
const { t } = useTranslation();
const changeLanguage = (event: React.ChangeEvent<HTMLSelectElement>) => {
i18n.changeLanguage(event.target.value);
localStorage.setItem("language", event.target.value);

View File

@ -3,9 +3,10 @@ import { Button, TextArea } from './styles';
import { MainContainer } from '../../components/MainContent/styles';
import { Send } from 'lucide-react';
import { Paragraph } from '../../components/Paragraph/styles';
import { t } from 'i18next';
import { useTranslation } from 'react-i18next';
export default function Contact() {
const { t } = useTranslation();
const emailAddress = import.meta.env.VITE_GIV_EMAIL;
const [typedText, setTypedText] = useState('');

View File

@ -5,10 +5,12 @@ import { faTelegram, faGithub } from '@fortawesome/free-brands-svg-icons';
import { IconContainer, IconLink, HomeLabel, TopSection } from './styles';
import { MainContainer } from '../../components/MainContent/styles';
import { Avatar } from '../../components/Avatar/avatar';
import { t } from 'i18next';
import { Paragraph } from '../../components/Paragraph/styles';
import { useTranslation } from 'react-i18next';
import i18n from '../../utils/i18n';
export default function Home() {
const { t } = useTranslation();
const typedElement = useRef(null);
useEffect(() => {
@ -22,7 +24,7 @@ export default function Home() {
return () => {
typed.destroy();
};
}, []);
}, [i18n.language]);
return (
<MainContainer>

View File

@ -10,7 +10,7 @@ import {
ProjectStars,
} from './styles';
import { MainContainer } from '../../components/MainContent/styles';
import { t } from 'i18next';
import { useTranslation } from 'react-i18next';
interface Repo {
name: string;
@ -21,6 +21,7 @@ interface Repo {
}
export default function Projects() {
const { t } = useTranslation();
const [projects, setProjects] = useState<Repo[]>([]);
useEffect(() => {

View File

@ -2,9 +2,10 @@ import { MainContainer } from "../../components/MainContent/styles";
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faAndroid, faAngular, faGit, faLinux, faNode, faReact, faWindows } from '@fortawesome/free-brands-svg-icons'
import { SkillsContainer } from "./styles";
import { t } from "i18next";
import { useTranslation } from "react-i18next";
export default function Skills() {
const { t } = useTranslation();
return (
<MainContainer>
<h1>{t("skills")}</h1>