Skip to content
This repository was archived by the owner on Jun 12, 2025. It is now read-only.

Commit d9c0052

Browse files
authored
Merge pull request #11 from EVOGD-Project/dev
Dev
2 parents 2bd9247 + 17188b4 commit d9c0052

13 files changed

Lines changed: 1038 additions & 60 deletions

File tree

bun.lock

Lines changed: 162 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,47 @@
55
"private": true,
66
"type": "module",
77
"scripts": {
8-
"build": "bun next build",
9-
"dev": "bun next dev",
10-
"lint": "bun run lint:biome && bun run lint:tsc && bun run lint:eslint",
11-
"lint:biome": "bun biome check --write .",
12-
"lint:tsc": "bun tsc --noEmit",
13-
"lint:eslint": "bun eslint --fix",
14-
"prod": "bun run build && bun run start",
15-
"start": "bun next start"
8+
"build": "bun next build",
9+
"dev": "bun next dev",
10+
"lint": "bun run lint:biome && bun run lint:tsc && bun run lint:eslint",
11+
"lint:biome": "bun biome check --write .",
12+
"lint:tsc": "bun tsc --noEmit",
13+
"lint:eslint": "bun eslint --fix",
14+
"prod": "bun run build && bun run start",
15+
"start": "bun next start"
1616
},
1717
"dependencies": {
18-
"@chakra-ui/icons": "^2.2.4",
19-
"@chakra-ui/next-js": "^2.4.2",
20-
"@chakra-ui/react": "2.10.2",
21-
"@chakra-ui/system": "^2.6.2",
22-
"@emotion/cache": "^11.14.0",
23-
"@emotion/react": "^11.14.0",
24-
"@emotion/styled": "^11.14.0",
25-
"@fontsource/inter": "^5.2.5",
26-
"@next/bundle-analyzer": "^15.2.3",
27-
"framer-motion": "^11.18.2",
28-
"jotai": "^2.12.2",
29-
"million": "2.6.4",
30-
"next": "^14.2.25",
31-
"react": "19.0.0",
32-
"react-dom": "19.0.0",
33-
"react-icons": "^5.5.0",
34-
"sharp": "^0.33.5",
35-
"typescript": "5.7.2",
36-
"utf-8-validate": "^6.0.5"
18+
"@chakra-ui/icons": "^2.2.4",
19+
"@chakra-ui/next-js": "^2.4.2",
20+
"@chakra-ui/react": "2.10.2",
21+
"@chakra-ui/system": "^2.6.2",
22+
"@emotion/cache": "^11.14.0",
23+
"@emotion/react": "^11.14.0",
24+
"@emotion/styled": "^11.14.0",
25+
"@fontsource/inter": "^5.2.5",
26+
"@next/bundle-analyzer": "^15.2.3",
27+
"date-fns": "^4.1.0",
28+
"framer-motion": "^11.18.2",
29+
"jotai": "^2.12.2",
30+
"million": "2.6.4",
31+
"next": "^14.2.25",
32+
"react": "19.0.0",
33+
"react-dom": "19.0.0",
34+
"react-icons": "^5.5.0",
35+
"react-markdown": "^10.1.0",
36+
"sharp": "^0.33.5",
37+
"typescript": "5.7.2",
38+
"utf-8-validate": "^6.0.5"
3739
},
3840
"devDependencies": {
39-
"@biomejs/biome": "^1.9.4",
40-
"@types/node": "22.10.2",
41-
"@types/react": "19.0.2",
42-
"@types/react-dom": "19.0.2",
43-
"eslint": "^9.22.0",
44-
"eslint-config-next": "^15.2.3"
41+
"@biomejs/biome": "^1.9.4",
42+
"@types/node": "22.10.2",
43+
"@types/react": "19.0.2",
44+
"@types/react-dom": "19.0.2",
45+
"eslint": "^9.22.0",
46+
"eslint-config-next": "^15.2.3"
4547
},
4648
"trustedDependencies": [
47-
"@biomejs/biome"
49+
"@biomejs/biome"
4850
]
49-
}
50-
51+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use client';
2+
3+
import ActivityScreen from '@/components/screens/ActivityScreen';
4+
import { useParams } from 'next/navigation';
5+
6+
export default function ActivityPage() {
7+
const { id, activityId } = useParams<{ id: string; activityId: string }>();
8+
return <ActivityScreen classroomId={id} activityId={activityId} />;
9+
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
'use client';
2+
3+
import type { IActivity } from '@/types/IActivity';
4+
import { Badge, Box, Card, CardBody, Flex, Heading, Stack, Text } from '@chakra-ui/react';
5+
import { format } from 'date-fns';
6+
import { es } from 'date-fns/locale';
7+
import { FiCalendar, FiFileText } from 'react-icons/fi';
8+
9+
const activityTypeInfo = {
10+
assignment: {
11+
label: 'Tarea',
12+
color: 'blue'
13+
},
14+
material: {
15+
label: 'Material',
16+
color: 'green'
17+
}
18+
} as const;
19+
20+
export default function ActivityCard({ activity, onClick }: Readonly<{ activity: IActivity; onClick?: () => void }>) {
21+
return (
22+
<Card maxW='100%' onClick={onClick} cursor='pointer'>
23+
<CardBody>
24+
<Stack spacing={4}>
25+
<Flex gap={2} align='center'>
26+
<Badge colorScheme={activityTypeInfo[activity.type].color} px={2} py={1} borderRadius='md'>
27+
{activityTypeInfo[activity.type].label}
28+
</Badge>
29+
{activity.dueDate && (
30+
<Text fontSize='sm' color='gray.400'>
31+
Para el{' '}
32+
{format(new Date(activity.dueDate), "d 'de' MMMM", {
33+
locale: es
34+
})}
35+
</Text>
36+
)}
37+
</Flex>
38+
39+
<Box>
40+
<Heading
41+
size='md'
42+
noOfLines={2}
43+
transition='color 0.3s ease'
44+
_groupHover={{ color: 'brand.primary.400' }}
45+
mb={2}
46+
>
47+
{activity.title}
48+
</Heading>
49+
<Text fontSize='sm' noOfLines={2} color='gray.400'>
50+
{activity.description}
51+
</Text>
52+
</Box>
53+
54+
<Flex justify='space-between' align='center'>
55+
{activity.createdAt && (
56+
<Flex align='center' gap={2} color='gray.400' fontSize='sm'>
57+
<FiCalendar />
58+
<Text>
59+
Creado el{' '}
60+
{format(new Date(activity.createdAt), "d 'de' MMMM", {
61+
locale: es
62+
})}
63+
</Text>
64+
</Flex>
65+
)}
66+
{(activity.content.resources?.length || 0) > 0 && (
67+
<Flex align='center' gap={2} color='gray.400' fontSize='sm'>
68+
<FiFileText />
69+
<Text>
70+
{activity.content.resources?.length || 0} recurso
71+
{activity.content.resources?.length !== 1 ? 's' : ''}
72+
</Text>
73+
</Flex>
74+
)}
75+
</Flex>
76+
</Stack>
77+
</CardBody>
78+
</Card>
79+
);
80+
}

0 commit comments

Comments
 (0)