diff --git a/apps/codac-community/src/components/community/Mentor.tsx b/apps/codac-community/src/components/community/Mentor.tsx index ccdfe5d..5b39452 100644 --- a/apps/codac-community/src/components/community/Mentor.tsx +++ b/apps/codac-community/src/components/community/Mentor.tsx @@ -1,4 +1,5 @@ import { Card, SkeletonCards } from "codac-ui"; +import defaultAvatar from "../../../public/defaultAvatar.png"; import { useGetMentor } from "#/graphql/hooks"; @@ -6,6 +7,9 @@ export const Mentor = ({ id }: { id: string }) => { const { mentor, loading, error } = useGetMentor(id); console.log(mentor); + const avatarUrl = mentor?.attributes?.user?.data?.attributes?.avatar?.data?.attributes?.url ?? "" + const imageUrl = avatarUrl || defaultAvatar; + return (
{loading && } @@ -16,10 +20,11 @@ export const Mentor = ({ id }: { id: string }) => { {mentor.attributes && (
)} diff --git a/apps/codac-community/src/components/community/MentorList.tsx b/apps/codac-community/src/components/community/MentorList.tsx index 9ce4111..5ddd3f1 100644 --- a/apps/codac-community/src/components/community/MentorList.tsx +++ b/apps/codac-community/src/components/community/MentorList.tsx @@ -15,7 +15,7 @@ const MentorList = () => {
{loading && } {error &&
something is wrong
} -
+
{mentors && mentors.map((mentor: MentorEntity) => { const avatarUrl = diff --git a/apps/codac-community/src/components/community/StudentCard.tsx b/apps/codac-community/src/components/community/StudentCard.tsx index 1fb2df4..2eaa139 100644 --- a/apps/codac-community/src/components/community/StudentCard.tsx +++ b/apps/codac-community/src/components/community/StudentCard.tsx @@ -15,8 +15,6 @@ export const StudentCard = (props: CardStudentProp) => { return (
- -
{student.attributes && (
diff --git a/apps/codac-community/src/graphql/queries/mentors.ts b/apps/codac-community/src/graphql/queries/mentors.ts index 86edbbe..fed82ca 100644 --- a/apps/codac-community/src/graphql/queries/mentors.ts +++ b/apps/codac-community/src/graphql/queries/mentors.ts @@ -47,7 +47,6 @@ export const GetMentorIdDocument = gql` github linkedin createdAt - user { data { attributes { diff --git a/apps/codac-community/src/styles.css b/apps/codac-community/src/styles.css index 2bf7c49..da68e0c 100644 --- a/apps/codac-community/src/styles.css +++ b/apps/codac-community/src/styles.css @@ -3,12 +3,15 @@ @tailwind utilities; .card { border-radius: 12px 12px 12px 12px; - background: #00897b; + background: #17141d; transition: 0.2s; min-width: 20rem; max-width: 17rem; margin-right: 1rem; margin-block: 1rem; + border-left: 3px solid #508484; + transition: ease-in-out 0.1s; + border-bottom: 1px solid #508484; } .mentorListCard { border-radius: 20px 16px 10px 10px; @@ -18,29 +21,31 @@ max-width: 10rem; max-height: 10rem; margin-block: 1rem; + border-left: 3px solid #00897b; + transition: ease-in-out 0.1s; + border-bottom: 1px solid #00897b; } .card:hover { transition: ease-in-out 0.1s; } -.mentorListCard:hover { - border-left: 3px solid #508484; - transition: ease-in-out 0.1s; - border-bottom: 1px solid #508484; -} -.imageBorderMentor { - border-bottom: 3px solid #508484; -} -.imageBorderCohort{ - border-bottom: 3px solid #ffff; +.avatarBorder { + border-bottom: 3px solid #00897b; } + .cardCohort { + border-radius: 20px 16px 10px 10px; background: #17141d; - box-shadow: -1rem 0 3rem #000; - border-radius: 12px 12px 12px 12px; + transition: 0.2s; + min-width: 20rem; + margin-block: 1rem; + border-left: 3px solid #00897b; + transition: ease-in-out 0.1s; + border-bottom: 1px solid #00897b; } + .card:hover { transform: translateY(-1rem); } diff --git a/packages/codac-ui/src/components/cards/card-list.tsx b/packages/codac-ui/src/components/cards/card-list.tsx index e3b7b08..0b8712c 100644 --- a/packages/codac-ui/src/components/cards/card-list.tsx +++ b/packages/codac-ui/src/components/cards/card-list.tsx @@ -37,11 +37,11 @@ export const CardList = ({ src={image} width={160} height={200} - className="imageborder filter-grayscale block h-24 w-24 rounded-full " + className="avatarBorder filter-grayscale block h-24 w-24 rounded-full " alt={title} /> )} -
+
{title}
@@ -51,33 +51,6 @@ export const CardList = ({
-
- {github && ( - - - - - - )} - - {linkdin && ( - - - - - - )} -
); diff --git a/packages/codac-ui/src/components/cards/card-tag.tsx b/packages/codac-ui/src/components/cards/card-tag.tsx index 465619f..a0e5a9e 100644 --- a/packages/codac-ui/src/components/cards/card-tag.tsx +++ b/packages/codac-ui/src/components/cards/card-tag.tsx @@ -1,5 +1,5 @@ export const CardTag = ({ tag }: { tag: string }) => { return ( -
{tag}
+
{tag}
); }; diff --git a/packages/codac-ui/src/components/cards/card.stories.tsx b/packages/codac-ui/src/components/cards/card.stories.tsx new file mode 100644 index 0000000..f094697 --- /dev/null +++ b/packages/codac-ui/src/components/cards/card.stories.tsx @@ -0,0 +1,16 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import { Card } from "./card"; + +const meta = { + component: Card, +} satisfies Meta; + +export default meta; + +type Story = StoryObj; + +export const Default: Story = { + args: { + + }, +}; \ No newline at end of file diff --git a/packages/codac-ui/src/components/cards/card.tsx b/packages/codac-ui/src/components/cards/card.tsx index 0c20fa9..8825a28 100644 --- a/packages/codac-ui/src/components/cards/card.tsx +++ b/packages/codac-ui/src/components/cards/card.tsx @@ -7,10 +7,19 @@ export interface CohortCardProps { startDate?: string; github?: string; linkdin?: string; + course?: string; + email?: string; } -export const Card = ({ image, title = "", startDate = "", github = "", - linkdin = "" }: CohortCardProps) => { +export const Card = ({ + image, + title = "", + startDate = "", + github = "", + linkdin = "", + course = "", + email = "" +}: CohortCardProps) => { return (
@@ -29,8 +38,12 @@ export const Card = ({ image, title = "", startDate = "", github = "",
-

{title}

-
{startDate &&

Start date {startDate}

}
+

{title}

+
{startDate &&

Start date {startDate}

}
+
+ {course} +
+

{email}

{github && ( diff --git a/packages/codac-ui/src/components/cards/cohorts-card.tsx b/packages/codac-ui/src/components/cards/cohorts-card.tsx index 11c6aab..9cea6d4 100644 --- a/packages/codac-ui/src/components/cards/cohorts-card.tsx +++ b/packages/codac-ui/src/components/cards/cohorts-card.tsx @@ -31,7 +31,11 @@ export const Cohorts = ({
-
{startDate &&

Start date {startDate}

}
+
+ {startDate && ( +

Start date {startDate}

+ )} +
@@ -40,7 +44,7 @@ export const Cohorts = ({ src={image} width={160} height={200} - className="imageBorderCohort filter-grayscale block h-24 w-24 rounded-full " + className="avatarBorder filter-grayscale block h-24 w-24 rounded-full " alt={title} /> )} @@ -78,7 +82,7 @@ export const Cohorts = ({
{rating != undefined && }
-
{tag != undefined && }
+
{tag != undefined && }
{course}