Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: RevolvingBox translations #993

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/ui/components/sections/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
useMantineTheme,
} from '@mantine/core'
import { useReducedMotion } from '@mantine/hooks'
import { type TFunction, Trans, useTranslation } from 'next-i18next'
import { Trans, useTranslation } from 'next-i18next'
import { useEffect, useState } from 'react'

import { Link } from '~ui/components/core/Link'
Expand Down Expand Up @@ -73,7 +73,6 @@ const useHeroStyles = createStyles((theme) => ({

type RevolvingBoxProps = {
role: 'services' | 'community'
t: TFunction
}
type RandomArr = <T extends Array<unknown>>(arr: T) => T[number]

Expand All @@ -83,7 +82,8 @@ const getRandomNumber = (min: number, max: number) => {
return Math.floor(Math.random() * (max - min + 1)) + min
}

const RevolvingBox = ({ role, t }: RevolvingBoxProps) => {
const RevolvingBox = ({ role }: RevolvingBoxProps) => {
const { t } = useTranslation('landingPage')
const theme = useMantineTheme()
const reduceMotion = useReducedMotion()
const services = [
Expand Down Expand Up @@ -236,7 +236,7 @@ const RevolvingBox = ({ role, t }: RevolvingBoxProps) => {
}

export const Hero = () => {
const { t } = useTranslation('landingPage')
const { t } = useTranslation(['landingPage', 'common'])
const { classes } = useHeroStyles()
const [isLoading, setLoading] = useState(false)
const variants = useCustomVariant()
Expand All @@ -260,8 +260,8 @@ export const Hero = () => {
className={classes.findText}
components={{
Text: <Text className={classes.findText} />,
Service: <RevolvingBox role='services' t={t} />,
Community: <RevolvingBox role='community' t={t} />,
Service: <RevolvingBox role='services' />,
Community: <RevolvingBox role='community' />,
}}
/>
</Group>
Expand Down
Loading