fix: Capas
Some checks are pending
Docker Build and Push / build (push) Waiting to run

This commit is contained in:
Lucas Santana 2025-01-23 19:59:01 -03:00
parent e154dd2372
commit 62594f5e62
4 changed files with 12 additions and 8 deletions

View File

@ -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']);

View File

@ -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<string | null>(null);
const [conversionError, setConversionError] = React.useState<string | null>(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 {

View File

@ -252,7 +252,7 @@ export function StudentDashboardPage() {
{story.cover && (
<div className="relative aspect-video">
<img
src={`${story.cover[0].image_url}?width=400&height=300&quality=80&format=webp`}
src={`${story.cover.image_url}?width=400&height=300&quality=80&format=webp`}
alt={story.title}
className="w-full h-48 object-cover"
loading="lazy"

View File

@ -32,9 +32,7 @@ export function StudentStoriesPage() {
)
`)
.eq('student_id', session.user.id)
.order('created_at', { ascending: false })
.order('page_number', { foreignTable: 'story_pages', ascending: true })
.limit(1, { foreignTable: 'story_pages' });
.order('created_at', { ascending: false });
if (statusFilter !== 'all') {
query.eq('status', statusFilter);
@ -205,15 +203,15 @@ export function StudentStoriesPage() {
className="bg-white rounded-xl shadow-sm border border-gray-200 overflow-hidden cursor-pointer hover:shadow-md transition"
onClick={() => navigate(`/aluno/historias/${story.id}`)}
>
{!story.pages?.[0]?.image_url && (
{!story.cover?.image_url && (
<div className="bg-gray-100 aspect-video flex items-center justify-center">
<BookOpen className="h-12 w-12 text-gray-400" />
</div>
)}
{story.pages?.[0]?.image_url && (
{story.cover?.image_url && (
<div className="relative aspect-video">
<img
src={story.pages[0].image_url}
src={story.cover.image_url}
alt={`Capa da história: ${story.title}`}
className="w-full h-48 object-cover"
loading="lazy"