Skip to content

Commit 6143628

Browse files
refactor: 🛠️ Remove 'Configuración' from UserMenu, update EducationalMaterial and MedicalArticles components to use PageHeader, and improve error handling in API calls
1 parent 6b57535 commit 6143628

File tree

7 files changed

+22
-18
lines changed

7 files changed

+22
-18
lines changed

frontend/platform/features/auth/components/UserMenu.jsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,6 @@ function UserMenu() {
113113
<User className='mr-2 h-4 w-4' />
114114
<span>Perfil</span>
115115
</DropdownMenuItem>
116-
<DropdownMenuItem>
117-
<Settings className='mr-2 h-4 w-4' />
118-
<span>Configuración</span>
119-
</DropdownMenuItem>
120116
<DropdownMenuItem>
121117
<Bell className='mr-2 h-4 w-4' />
122118
<span>Notificaciones</span>

frontend/platform/features/educational-material/EducationalMaterial.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import React, { useState, useEffect } from 'react';
44
import { SearchBar } from './components/SearchBar';
55
import { MaterialsTable } from './components/MaterialsTable';
66
import { useEducationalMaterials } from './lib/hooks/useEducationalMaterials';
7+
import PageHeader from '@/shared/layout/sectionheader/pageHeader';
78

89
/**
910
* Main Educational Material component
@@ -58,14 +59,15 @@ export default function EducationalMaterial() {
5859

5960
return (
6061
<div className='w-full mx-auto px-4 sm:px-6 lg:px-8 py-4 sm:py-6 lg:py-8'>
61-
<div className='mb-4 sm:mb-6'>
62+
{/* <div className='mb-4 sm:mb-6'>
6263
<h1 className='text-xl sm:text-2xl font-bold text-gray-900'>
6364
Material Educativo
6465
</h1>
6566
<p className='text-sm sm:text-base text-gray-600 mt-1'>
6667
Explora y accede a recursos educativos para mejorar tus habilidades
6768
</p>
68-
</div>
69+
</div> */}
70+
<PageHeader sectionKey={'materialEducativo'} />
6971

7072
<SearchBar
7173
searchQuery={searchQuery}

frontend/platform/features/medical-articles/lib/hooks/useMedicalArticles.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ export function useMedicalArticles() {
2828
setError(null);
2929
try {
3030
const data = await fetchEducationalMaterials();
31+
console.log(data);
3132
const filteredData = data.filter(
32-
item => item.category?.name === 'Material Eductaivo'
33+
item => item.category?.name === 'Artículos Médicos'
3334
);
3435

3536
// Get file sizes for all materials

frontend/platform/features/medical-articles/medicalArticles.jsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import React, { useState, useEffect } from 'react';
44
import { SearchBar } from './components/SearchBar';
55
import { MaterialsTable } from './components/MaterialsTable';
66
import { useMedicalArticles } from './lib/hooks/useMedicalArticles';
7+
import PageHeader from '@/shared/layout/sectionheader/pageHeader';
78

89
/**
910
* Main Educational Material component
@@ -57,15 +58,8 @@ export default function MedicalArticles() {
5758
}, [materials, searchQuery, fileType, dateSort]);
5859

5960
return (
60-
<div className='w-full mx-auto px-4 sm:px-6 lg:px-8 py-4 sm:py-6 lg:py-8'>
61-
<div className='mb-4 sm:mb-6'>
62-
<h1 className='text-xl sm:text-2xl font-bold text-gray-900'>
63-
Material Educativo
64-
</h1>
65-
<p className='text-sm sm:text-base text-gray-600 mt-1'>
66-
Explora y accede a recursos educativos para mejorar tus habilidades
67-
</p>
68-
</div>
61+
<div className='w-full mx-auto px-4 sm:px-6 lg:px-8 py-4 sm:py-6 '>
62+
<PageHeader sectionKey={'medicalArticles'} />
6963

7064
<SearchBar
7165
searchQuery={searchQuery}
@@ -116,3 +110,10 @@ export default function MedicalArticles() {
116110
</div>
117111
);
118112
}
113+
114+
// Viewport export para Next.js
115+
export const viewport = {
116+
width: 'device-width',
117+
initialScale: 1,
118+
maximumScale: 1
119+
};

frontend/platform/shared/layout/sectionheader/pageHeader.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ const pageMetadata = {
1111
description:
1212
"Documentos, presentaciones y guías para usar Play Attention de manera efectiva.",
1313
},
14+
medicalArticles: {
15+
title: "Artículos Médicos",
16+
description:
17+
"Explora y accede a artículos médicos para mejorar tus habilidades",
18+
},
1419
};
1520

1621
export default function PageHeader({ sectionKey }) {

frontend/platform/shared/layout/sidebar/sidebar.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export function SidebarApp() {
3434
{ name: "Panel de control", icon: LayoutDashboard, path: "/dashboard" },
3535
{ name: "Actividades", icon: PenTool, path: "/activities" },
3636
{ name: "Soporte", icon: MessageCircle, path: "/support" },
37-
{ name: "Configuración", icon: Settings, path: "/settings" },
3837
];
3938

4039
// Items de contenido que se mostrarán/ocultarán

frontend/platform/shared/lib/api/content/api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export async function fetchEducationalMaterials() {
99
);
1010

1111
if (!response.ok) {
12-
throw new Error('Failed to fetch educational materials');
12+
throw new Error('Failed to fetch published resources');
1313
}
1414

1515
const data = await response.json();

0 commit comments

Comments
 (0)