Skip to content

Commit

Permalink
fix: types
Browse files Browse the repository at this point in the history
  • Loading branch information
dmythro committed Aug 31, 2023
1 parent 98966d7 commit 79848c6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
9 changes: 5 additions & 4 deletions apps/www/src/components/SectionLocale.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { FC, JSX, ReactNode } from 'react'
import type { FC } from 'react'
import type { InterestKey, LocaleCode } from 'my-locales'

import WebDevEn from 'my-locales/mdx/web-dev.en.md'
Expand All @@ -18,9 +18,10 @@ import FaqUk from 'my-locales/mdx/faq.uk.md'

import { Links } from 'src/components/Links'

type Interest = Record<LocaleCode, (props: unknown) => JSX.Element | ReactNode>

const sectionLocales: Record<InterestKey, Interest> = {
const sectionLocales: Record<
InterestKey,
unknown // Record<LocaleCode, (props) => JSX.Element | ReactNode>
> = {
webDev: {
en: WebDevEn,
uk: WebDevUk,
Expand Down
4 changes: 2 additions & 2 deletions apps/www/src/components/Sections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { FC } from 'react'

import { Accordion, AccordionItem } from '@nextui-org/accordion'

import type { InterestLocale } from 'my-locales'
import type { InterestKey, InterestLocale } from 'my-locales'

import myStudioImg from 'public/my-studio.webp'
import WorkIcon from 'src/assets/briefcase-solid.svg'
Expand Down Expand Up @@ -39,7 +39,7 @@ export const Sections: FC<WithLangProp & { isExpanded?: boolean }> = ({ isExpand
const isPrint = usePrint() // useMediaQuery('print')
const t = getT(lang)

const interestList = Object.keys(t.interests)
const interestList = Object.keys(t.interests) as InterestKey[]

return (
<article>
Expand Down
3 changes: 2 additions & 1 deletion packages/my-locales/src/uk/interests.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { InterestKey } from 'src'
import type { InterestLocale } from 'src/types'

export const interests: Record<string, InterestLocale> = {
export const interests: Record<InterestKey, InterestLocale> = {
webDev: {
title: "Веб розробка, кар'єра, освіта",
description:
Expand Down

1 comment on commit 79848c6

@vercel
Copy link

@vercel vercel bot commented on 79848c6 Aug 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.