From 62594f5e62c8d17d07c58d73de06a50e0ccd3866 Mon Sep 17 00:00:00 2001 From: Lucas Santana Date: Thu, 23 Jan 2025 19:59:01 -0300 Subject: [PATCH] fix: Capas --- src/features/syllables/utils/syllableSplitter.test.ts | 1 + src/pages/student-dashboard/StoryPage.tsx | 7 ++++++- src/pages/student-dashboard/StudentDashboardPage.tsx | 2 +- src/pages/student-dashboard/StudentStoriesPage.tsx | 10 ++++------ 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/features/syllables/utils/syllableSplitter.test.ts b/src/features/syllables/utils/syllableSplitter.test.ts index c7ed7a4..6395167 100644 --- a/src/features/syllables/utils/syllableSplitter.test.ts +++ b/src/features/syllables/utils/syllableSplitter.test.ts @@ -1,4 +1,5 @@ import { splitIntoSyllables } from './syllableSplitter'; +import { test, expect } from 'vitest'; test('Separação silábica básica', () => { expect(splitIntoSyllables('casa')).toEqual(['ca', 'sa']); diff --git a/src/pages/student-dashboard/StoryPage.tsx b/src/pages/student-dashboard/StoryPage.tsx index 90ec26b..669dd86 100644 --- a/src/pages/student-dashboard/StoryPage.tsx +++ b/src/pages/student-dashboard/StoryPage.tsx @@ -10,9 +10,10 @@ import * as Dialog from '@radix-ui/react-dialog'; import { ExerciseSuggestions } from '../../components/learning/ExerciseSuggestions'; import { TextCaseToggle } from '../../components/ui/text-case-toggle'; import { AdaptiveText, AdaptiveTitle, AdaptiveParagraph } from '../../components/ui/adaptive-text'; -import { useUppercasePreference } from '../../hooks/useUppercasePreference'; import { useSession } from '../../hooks/useSession'; import { useSyllables } from '../../features/syllables/hooks/useSyllables'; +import { useUppercasePreference } from '../../hooks/useUppercasePreference'; + interface StoryRecording { id: string; @@ -41,6 +42,9 @@ function RecordingHistoryCard({ recording }: { recording: StoryRecording }) { const [isConverting, setIsConverting] = React.useState(false); const [mp3Url, setMp3Url] = React.useState(null); const [conversionError, setConversionError] = React.useState(null); + const { session } = useSession(); + const { isUpperCase } = useUppercasePreference(session?.user?.id); + const { isHighlighted } = useSyllables(); // Verificar suporte ao formato WebM React.useEffect(() => { @@ -397,6 +401,7 @@ export function StoryPage() { const { isUpperCase, toggleUppercase, isLoading } = useUppercasePreference(session?.user?.id); const { isHighlighted, toggleHighlight } = useSyllables(); + React.useEffect(() => { const fetchStory = async () => { try { diff --git a/src/pages/student-dashboard/StudentDashboardPage.tsx b/src/pages/student-dashboard/StudentDashboardPage.tsx index 22b77bd..5a7d6ac 100644 --- a/src/pages/student-dashboard/StudentDashboardPage.tsx +++ b/src/pages/student-dashboard/StudentDashboardPage.tsx @@ -252,7 +252,7 @@ export function StudentDashboardPage() { {story.cover && (
{story.title} navigate(`/aluno/historias/${story.id}`)} > - {!story.pages?.[0]?.image_url && ( + {!story.cover?.image_url && (
)} - {story.pages?.[0]?.image_url && ( + {story.cover?.image_url && (