From 49f4c95d02fd992b85e47b54776341c55c6b39f4 Mon Sep 17 00:00:00 2001 From: LucianoMariotti Date: Fri, 9 Sep 2022 18:16:30 -0300 Subject: [PATCH 1/7] add simple page --- pages/study-sessions/index.tsx | 83 ++++++++++++++++++++++++++++++++-- 1 file changed, 79 insertions(+), 4 deletions(-) diff --git a/pages/study-sessions/index.tsx b/pages/study-sessions/index.tsx index ffab46a..07d6ab4 100644 --- a/pages/study-sessions/index.tsx +++ b/pages/study-sessions/index.tsx @@ -1,7 +1,82 @@ -import React from "react"; +import type { NextPage } from "next"; +import Head from "next/head"; -const index = () => { - return
index
; +import StudySessionCard from "@/modules/StudySession/components/StudySessionCard"; +import { Center, Container, Grid, GridItem, Text } from "@chakra-ui/react"; + +const StudySessions: NextPage = () => { + const deleteFunction = (id: string) => { + console.log(id); + }; + + return ( + <> + + Study sessions / Flashcards + + + + + {/* Agregar Menu o TODO: Layout Component */} + + Mis rondas de estudio + + recientes + + +
boton de crear
+
+ + + + + + + + + + + + +
+
+ + ); }; -export default index; +export default StudySessions; From 27ebad2e12cd16ee7b4d1943f1fe28e4df4dd954 Mon Sep 17 00:00:00 2001 From: LucianoMariotti Date: Fri, 9 Sep 2022 18:17:57 -0300 Subject: [PATCH 2/7] add variant main for Container --- modules/shared/theme/index.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/shared/theme/index.ts b/modules/shared/theme/index.ts index bceaba2..0b8bd5f 100644 --- a/modules/shared/theme/index.ts +++ b/modules/shared/theme/index.ts @@ -189,6 +189,19 @@ const components: Theme["components"] = { variant: "primary", }, }, + + Container: { + variants: { + main: { + maxWidth: "auto", + padding: { + sm: "0px 21px", + md: "0px 48px", + lg: "30px 160px", + }, + }, + }, + }, }; const fonts: Theme["fonts"] = { From c1cde81ac39e609b89d999d3e40df99ee468b430 Mon Sep 17 00:00:00 2001 From: LucianoMariotti Date: Fri, 9 Sep 2022 18:21:14 -0300 Subject: [PATCH 3/7] fix studySessionCard width --- modules/StudySession/components/StudySessionCard.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/StudySession/components/StudySessionCard.tsx b/modules/StudySession/components/StudySessionCard.tsx index 4f600da..3182120 100644 --- a/modules/StudySession/components/StudySessionCard.tsx +++ b/modules/StudySession/components/StudySessionCard.tsx @@ -41,6 +41,7 @@ const StudySessionCard = ({ Date: Fri, 9 Sep 2022 18:43:31 -0300 Subject: [PATCH 4/7] card styles --- .../components/StudySessionCard.tsx | 9 ++++++++- pages/study-sessions/index.tsx | 18 ++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/modules/StudySession/components/StudySessionCard.tsx b/modules/StudySession/components/StudySessionCard.tsx index 3182120..5c7aaf8 100644 --- a/modules/StudySession/components/StudySessionCard.tsx +++ b/modules/StudySession/components/StudySessionCard.tsx @@ -64,7 +64,14 @@ const StudySessionCard = ({ {name} - + {collection} diff --git a/pages/study-sessions/index.tsx b/pages/study-sessions/index.tsx index 07d6ab4..96a04d9 100644 --- a/pages/study-sessions/index.tsx +++ b/pages/study-sessions/index.tsx @@ -1,14 +1,21 @@ import type { NextPage } from "next"; import Head from "next/head"; +import Menu from "@/modules/shared/components/Menu/Menu"; import StudySessionCard from "@/modules/StudySession/components/StudySessionCard"; -import { Center, Container, Grid, GridItem, Text } from "@chakra-ui/react"; +import { Center, Container, Grid, GridItem, Select, Text } from "@chakra-ui/react"; const StudySessions: NextPage = () => { const deleteFunction = (id: string) => { console.log(id); }; + // TODO: Obtener studysessions del usuario + // useEffect(() => { + // getUserStudySessions + // setStudySessions() + // }, []) + return ( <> @@ -17,11 +24,14 @@ const StudySessions: NextPage = () => { - {/* Agregar Menu o TODO: Layout Component */} - + {/* TODO: Layout Component */} + + Mis rondas de estudio - recientes + Date: Fri, 9 Sep 2022 19:22:37 -0300 Subject: [PATCH 5/7] add create button --- modules/shared/components/Icons/Add.tsx | 26 +++++++++++++++++++++++++ pages/study-sessions/index.tsx | 25 +++++++++++++++++++++--- 2 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 modules/shared/components/Icons/Add.tsx diff --git a/modules/shared/components/Icons/Add.tsx b/modules/shared/components/Icons/Add.tsx new file mode 100644 index 0000000..1d9efb1 --- /dev/null +++ b/modules/shared/components/Icons/Add.tsx @@ -0,0 +1,26 @@ +import React from "react"; + +interface IconProps { + width: number; + height: number; +} + +export default function AddIcon({ height, width }: IconProps) { + return ( + + + + ); +} diff --git a/pages/study-sessions/index.tsx b/pages/study-sessions/index.tsx index 96a04d9..549fa88 100644 --- a/pages/study-sessions/index.tsx +++ b/pages/study-sessions/index.tsx @@ -1,11 +1,14 @@ import type { NextPage } from "next"; import Head from "next/head"; +import { useRouter } from "next/router"; +import AddIcon from "@/modules/shared/components/Icons/Add"; import Menu from "@/modules/shared/components/Menu/Menu"; import StudySessionCard from "@/modules/StudySession/components/StudySessionCard"; -import { Center, Container, Grid, GridItem, Select, Text } from "@chakra-ui/react"; +import { Center, Container, Flex, Grid, GridItem, Select, Text } from "@chakra-ui/react"; const StudySessions: NextPage = () => { + const router = useRouter(); const deleteFunction = (id: string) => { console.log(id); }; @@ -16,6 +19,10 @@ const StudySessions: NextPage = () => { // setStudySessions() // }, []) + const handleCreate = () => { + router.push("/study-sessions/create"); + }; + return ( <> @@ -40,8 +47,20 @@ const StudySessions: NextPage = () => { gap={{ base: "25", lg: "10" }} justifyContent="center" > - -
boton de crear
+ + +
+ + Crear nueva sesión +
+
Date: Sat, 10 Sep 2022 01:35:52 -0300 Subject: [PATCH 6/7] fix general styles in StudySession Page --- .../components/StudySessionCard.tsx | 8 +++- modules/shared/components/Icons/Info.tsx | 20 +++++++++ pages/study-sessions/index.tsx | 44 ++++++++++++------- 3 files changed, 54 insertions(+), 18 deletions(-) create mode 100644 modules/shared/components/Icons/Info.tsx diff --git a/modules/StudySession/components/StudySessionCard.tsx b/modules/StudySession/components/StudySessionCard.tsx index 5c7aaf8..89358b7 100644 --- a/modules/StudySession/components/StudySessionCard.tsx +++ b/modules/StudySession/components/StudySessionCard.tsx @@ -15,6 +15,7 @@ import { } from "@chakra-ui/react"; import Trash from "../../shared/components/Icons/Trash"; +import InfoIcon from "@/modules/shared/components/Icons/Info"; interface StudySessionCardProps { id: string; @@ -84,7 +85,12 @@ const StudySessionCard = ({ - {percentage}% + + + {percentage}% + + + diff --git a/modules/shared/components/Icons/Info.tsx b/modules/shared/components/Icons/Info.tsx new file mode 100644 index 0000000..ff53957 --- /dev/null +++ b/modules/shared/components/Icons/Info.tsx @@ -0,0 +1,20 @@ +import React from "react"; + +interface IconProps { + width: number; + height: number; +} + +export default function InfoIcon({ height, width }: IconProps) { + return ( + + + + ); +} diff --git a/pages/study-sessions/index.tsx b/pages/study-sessions/index.tsx index 549fa88..17086d7 100644 --- a/pages/study-sessions/index.tsx +++ b/pages/study-sessions/index.tsx @@ -5,11 +5,12 @@ import { useRouter } from "next/router"; import AddIcon from "@/modules/shared/components/Icons/Add"; import Menu from "@/modules/shared/components/Menu/Menu"; import StudySessionCard from "@/modules/StudySession/components/StudySessionCard"; -import { Center, Container, Flex, Grid, GridItem, Select, Text } from "@chakra-ui/react"; +import { Center, Container, Grid, GridItem, Select, Text } from "@chakra-ui/react"; const StudySessions: NextPage = () => { const router = useRouter(); - const deleteFunction = (id: string) => { + const handleDelete = (id: string) => { + // Delete Funciont Id console.log(id); }; @@ -45,23 +46,29 @@ const StudySessions: NextPage = () => { desktop: "repeat(3, 1fr)", }} gap={{ base: "25", lg: "10" }} - justifyContent="center" + justifyContent="space-between" > - -
- - Crear nueva sesión -
-
+
+ + + Crear nueva sesión + +
+ {/* ------------MAP con las respectivas props-----------------*/} { cardsAmount={30} collection="Medicina" percentage={50} - deleteFunction={deleteFunction} + deleteFunction={handleDelete} /> + {/* -----------------MAP-------------------- */} + {/* ------------DELETE ------------- */} { cardsAmount={30} collection="Medicina" percentage={50} - deleteFunction={deleteFunction} + deleteFunction={handleDelete} /> @@ -89,7 +98,7 @@ const StudySessions: NextPage = () => { cardsAmount={30} collection="Medicina" percentage={50} - deleteFunction={deleteFunction} + deleteFunction={handleDelete} /> @@ -99,9 +108,10 @@ const StudySessions: NextPage = () => { cardsAmount={30} collection="Medicina" percentage={50} - deleteFunction={deleteFunction} + deleteFunction={handleDelete} /> + {/* ------------DELETE ------------- */}
From 630ffb4f17c711cfd5302a36e9956e6b20ccd919 Mon Sep 17 00:00:00 2001 From: LucianoMariotti Date: Sat, 10 Sep 2022 01:43:16 -0300 Subject: [PATCH 7/7] fix styles card --- pages/study-sessions/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/study-sessions/index.tsx b/pages/study-sessions/index.tsx index 17086d7..46d088e 100644 --- a/pages/study-sessions/index.tsx +++ b/pages/study-sessions/index.tsx @@ -57,8 +57,8 @@ const StudySessions: NextPage = () => { >