Skip to content

Commit d287d77

Browse files
committed
FIX JS tests
* Aggregate js translations * Remove namespaces * Remove namespaces from Trans components * Add missing translations, remove namespaces, use correct hook
1 parent 5bbfb7c commit d287d77

File tree

465 files changed

+3063
-1052
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

465 files changed

+3063
-1052
lines changed

app/javascript/components/common/HandleWithFlair.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function HandleWithFlair({
3737
iconClassName?: string
3838
className?: string
3939
}): JSX.Element | null {
40-
const { t } = useAppTranslation('components/common/HandleWithFlair.tsx')
40+
const { t } = useAppTranslation()
4141

4242
return (
4343
<span className={assembleClassNames('flex items-center', className)}>

app/javascript/components/common/Loading.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import React from 'react'
44
import { useAppTranslation } from '@/i18n/useAppTranslation'
55

66
export function Loading() {
7-
const { t } = useAppTranslation('components/common/Loading.tsx')
7+
const { t } = useAppTranslation()
88
return (
99
<div className="c-loading" role="alert">
1010
<span className="sr-only">{t('loading')}</span>

app/javascript/components/common/MarkdownEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function MarkdownEditor({
3131
onChange?: (value: string) => void
3232
options?: EasyMDE.Options
3333
}): JSX.Element {
34-
const { t } = useAppTranslation('components/common/MarkdownEditor.tsx')
34+
const { t } = useAppTranslation()
3535
const getInstance = useCallback(
3636
(editor) => {
3737
if (!editorDidMount) {

app/javascript/components/common/MarkdownEditorForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const MarkdownEditorForm = ({
6363
expanded ? '--expanded' : '--compressed',
6464
].filter((className) => className.length > 0)
6565
const { isBelowLgWidth = false } = useContext(ScreenSizeContext) || {}
66-
const { t } = useAppTranslation('components/common/MarkdownEditorForm.tsx')
66+
const { t } = useAppTranslation()
6767

6868
const handleSubmit = useCallback(
6969
(e) => {

app/javascript/components/common/MedianWaitTime.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type MedianWaitTimeProps = {
1010
}
1111

1212
export function MedianWaitTime({ seconds }: MedianWaitTimeProps) {
13-
const { t } = useAppTranslation('components/common/MedianWaitTime.tsx')
13+
const { t } = useAppTranslation()
1414

1515
if (seconds === undefined || seconds === null) {
1616
return null

app/javascript/components/common/MentorDiscussionSummary.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ export const MentorDiscussionSummary = ({
1313
postsCount,
1414
createdAt,
1515
}: MentorDiscussion): JSX.Element => {
16-
const { t } = useAppTranslation(
17-
'components/common/MentorDiscussionSummary.tsx'
18-
)
16+
const { t } = useAppTranslation()
1917
const commentsClass = ['comments', isUnread ? 'unread' : '']
2018

2119
return (

app/javascript/components/common/Pagination/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function Pagination({
1717
setPage,
1818
around = 2,
1919
}: PaginationProps): JSX.Element | null {
20-
const { t } = useAppTranslation('components/common/Pagination.tsx')
20+
const { t } = useAppTranslation()
2121

2222
const {
2323
valid,

app/javascript/components/common/ProcessingStatusSummary.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import { GraphicalIcon } from '.'
44
import { useAppTranslation } from '@/i18n/useAppTranslation'
55

66
function Content({ status }: { status: string }) {
7-
const { t } = useAppTranslation(
8-
'components/common/ProcessingStatusSummary.tsx'
9-
)
7+
const { t } = useAppTranslation()
108

119
switch (status) {
1210
case 'processing':
@@ -53,9 +51,7 @@ export function ProcessingStatusSummary({
5351
}: {
5452
iterationStatus: IterationStatus
5553
}): JSX.Element {
56-
const { t } = useAppTranslation(
57-
'components/common/ProcessingStatusSummary.tsx'
58-
)
54+
const { t } = useAppTranslation()
5955

6056
if (
6157
iterationStatus == IterationStatus.DELETED ||

app/javascript/components/common/Pronouns.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const Pronouns = ({
1010
handle: string
1111
pronouns?: string[]
1212
}): JSX.Element | null => {
13-
const { t } = useAppTranslation('components/common/Pronouns.tsx')
13+
const { t } = useAppTranslation()
1414
if (!pronouns || pronouns.length === 0) return null
1515

1616
const useHandle = handle.toLowerCase() !== pronouns[0].toLowerCase()
@@ -38,7 +38,7 @@ export const Pronouns = ({
3838
}
3939

4040
function createExample(handle: string, pronouns: string[]) {
41-
const { t } = useAppTranslation('components/common/Pronouns.tsx')
41+
const { t } = useAppTranslation()
4242
const pronounsString = pronouns.join(' / ')
4343
return (
4444
<>

app/javascript/components/common/ShareButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default function ShareButton({
1616
shareLink: string
1717
platforms: readonly SharePlatform[]
1818
}): JSX.Element {
19-
const { t } = useAppTranslation('components/common/ShareButton.tsx')
19+
const { t } = useAppTranslation()
2020
const { open, setOpen, buttonAttributes, panelAttributes } = usePanel({
2121
placement: 'bottom-end',
2222
modifiers: [

0 commit comments

Comments
 (0)