Skip to content

Commit 2797d1d

Browse files
committed
Fixes typescript errors
1 parent f3f0d40 commit 2797d1d

File tree

4 files changed

+7
-14
lines changed

4 files changed

+7
-14
lines changed

src/components/ExperienceTimelineItem.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
import { TECHNOLOGIES, type Technology } from "../data/technologies";
2+
import { TECHNOLOGIES } from "../data/technologies";
33
import type { Experience } from "../types";
44
55
interface Props extends Experience {}

src/components/LanguageSelector.astro

+4-10
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22
import ArrowDownUpIcon from "../icons/ArrowDownUp.astro";
33
import SpanishFlagIcon from "../icons/SpanishFlag.astro";
44
import BritishFlagIcon from "../icons/BritishFlag.astro";
5-
6-
const THEMES = ["Español", "English"];
7-
8-
const THEME_CODES = {
9-
Español: "es",
10-
English: "en",
11-
};
5+
import { languages } from "../i18n/ui";
126
---
137

148
<div class="px-2">
@@ -34,9 +28,9 @@ const THEME_CODES = {
3428
>
3529
<ul>
3630
{
37-
THEMES.map((theme) => (
31+
Object.keys(languages).map((language) => (
3832
<li class="languages-menu-option px-2 py-1.5 cursor-default hover:bg-gray-500/50 rounded-sm">
39-
<a href={`/${THEME_CODES[theme]}/`}>{theme}</a>
33+
<a href={`/${languages[language]}/`}>{language}</a>
4034
</li>
4135
))
4236
}
@@ -101,7 +95,7 @@ const THEME_CODES = {
10195
});
10296

10397
document.querySelectorAll(".languages-menu-option").forEach((element) => {
104-
element.addEventListener("click", (e) => {
98+
element.addEventListener("click", () => {
10599
updateLanguage();
106100
});
107101
});

src/components/ProjectItem.astro

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
import SocialPill from "./SocialPill.astro";
33
import OpenTabIcon from "../icons/OpenTab.astro";
44
import GitHubIcon from "../icons/GitHub.astro";
5-
import { TECHNOLOGIES, type Technology } from "../data/technologies";
6-
import type { StringLiteralType } from "typescript";
5+
import { TECHNOLOGIES } from "../data/technologies";
76
import { getLangFromUrl, useTranslations } from "../i18n/utils";
87
98
const lang = getLangFromUrl(Astro.url);

src/i18n/ui.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
projectWefinz,
1313
} from "./projects";
1414

15-
export const languages = {
15+
export const languages: Record<string, string> = {
1616
en: "English",
1717
es: "Español",
1818
};

0 commit comments

Comments
 (0)