Skip to content

Commit

Permalink
[ MERGE ] Deploy to production v1.0.0
Browse files Browse the repository at this point in the history
[ MERGE ] Deploy to production
  • Loading branch information
danielcuque authored Sep 13, 2022
2 parents 6da6280 + 7182000 commit 4f5c3eb
Show file tree
Hide file tree
Showing 27 changed files with 608 additions and 407 deletions.
9 changes: 8 additions & 1 deletion src/api/api.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface ApiAuthLoginResponse {
errors: ApiListError[];
}

export interface ApiAuthRevalidateResponse extends ApiAuthLoginResponse {}
export interface ApiAuthRevalidateResponse extends ApiAuthLoginResponse { }

export interface ApiSearchUserRequest {
idStudent: string;
Expand Down Expand Up @@ -207,3 +207,10 @@ export interface ApiGetAprovedCoursesResponse {
errors: ApiListError[];
aprovedCourses: CourseInterface[];
}

export interface ApiGetUnaprovedCoursesResponse {
ok: boolean;
msg: string;
errors: ApiListError[];
unaprovedCourses: CourseInterface[];
}
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export * from "./ui/card/post/CardPost";
export * from "./ui/card/course/CardCourse";
export * from "./ui/card/comment/CardComment";
export * from "./ui/card/comment/CardCreateComment";
export * from './ui/card/editCourse/EditCourseCard'


export * from "./ui/card/grid/GridCardMain";
Expand Down
48 changes: 24 additions & 24 deletions src/components/theme/ToogleThemeButton.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import { useTheme } from "../../hooks"
import { MoonIcon } from '../../assets/icons/MoonIcon';
import { SunIcon } from '../../assets/icons/SunIcon';

import { useTheme } from "../../hooks";
import { MoonIcon, SunIcon } from "../../assets";

interface ToogleThemeButtonProps {
fab?: boolean //fab = Floating Action button
fab?: boolean; //fab = Floating Action button
}

export const ToogleThemeButton = ({ fab = false }: ToogleThemeButtonProps) => {
const { darkModeEnabled, toogleDarkMode } = useTheme();

const { darkModeEnabled, toogleDarkMode } = useTheme();

return (
<button onClick={() => toogleDarkMode()}
className={`
return (
<button
onClick={() => toogleDarkMode()}
className={`
z-50
cursor-pointer
h-[40px] lg:h-[45px]
Expand All @@ -24,17 +22,19 @@ export const ToogleThemeButton = ({ fab = false }: ToogleThemeButtonProps) => {
flex
justify-center
items-center
${darkModeEnabled ? 'border-info-dark-3 bg-darkContrast' : 'border-warning-light-4 bg-white '}
${fab ? 'fixed right-4 bottom-4' : 'relative'}
`} >
{
darkModeEnabled
? (
<MoonIcon className="text-white text-[20px] lg:text-[25px]" />
) : (
<SunIcon className="text-warning-light-4 text-[20px] lg:text-[25px]" />
)
}
</button>
)
}
${
darkModeEnabled
? "border-info-dark-3 bg-darkContrast"
: "border-warning-light-4 bg-white "
}
${fab ? "fixed right-4 bottom-4" : "relative"}
`}
>
{darkModeEnabled ? (
<MoonIcon className="text-white text-[20px] lg:text-[25px]" />
) : (
<SunIcon className="text-warning-light-4 text-[20px] lg:text-[25px]" />
)}
</button>
);
};
5 changes: 4 additions & 1 deletion src/components/ui/button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ type Props = {
className?: string;
children?: React.ReactNode;
type?: "button" | "submit" | "reset";
variant?: "primary" | "secondary" | "tertiary";
variant?: "primary" | "secondary" | "tertiary" | "fourth";
onClick?: () => void;
disabled?: boolean;
};
Expand All @@ -14,6 +14,8 @@ const secondaryStyles =

const tertiaryStyles = "bg-error-gradient hover:opacity-[.87]";

const fourthStyles = "bg-success-gradient hover:opacity-[.87]";

export const Button = ({
className,
children,
Expand All @@ -32,6 +34,7 @@ export const Button = ({
primary: primaryStyles,
secondary: secondaryStyles,
tertiary: tertiaryStyles,
fourth: fourthStyles,
}[variant] || "") +
" w-full rounded-md text-white py-2 px-4 bg-primary-light-1 hover:bg-primary-light-2 transition-all duration-200 text-xs md:text-sm"
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/card/course/CardCourse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type CardCourseProps = {
export const CardCourse = ({ course }: CardCourseProps) => {
return (
<>
<div>
<div className="dark:text-white">
{`
${course.code} - ${course.name} - ${course.credits} créditos
`}
Expand Down
35 changes: 35 additions & 0 deletions src/components/ui/card/editCourse/EditCourseCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { CourseInterface } from "../../../../api";
import { Button } from "../../../";

type CardCourseProps = {
course: CourseInterface;
type: "aproved" | "unaproved";
onClick: (course: CourseInterface) => void;
};


export const EditCourseCard = ({ course, type, onClick }: CardCourseProps) => {
return (
<div
className={
` flex my-2 dark:text-white items-center gap-x-2 justify-between border border-gray-400 bg-white dark:border-none dark:bg-darkContrast/100 min-w-min p-5 rounded-md transition md:duration-300 md:hover:scale-105 md:hover:shadow-lg`
}
>
<div className="text-center">
<p>{`${course.code}`}</p>
<p>{`${course.name}`}</p>
</div>
{
type === "unaproved"
? (

<Button className="w-1/3" variant="primary" onClick={() => onClick(course)}>+</Button>
)
: (

<Button className="w-1/3" variant="tertiary" onClick={() => onClick(course)}>-</Button>
)
}
</div>
)
}
7 changes: 4 additions & 3 deletions src/components/ui/card/user/CardUser.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { UserInterface } from "../../../../api";
import { Avatar } from "../../..";
import { Link } from "react-router-dom";

import { Avatar } from "../../..";
import { UserInterface } from "../../../../api";
import { useContentStore } from "../../../../hooks";

type CardUserProps = {
Expand All @@ -13,7 +14,7 @@ export const CardUser = ({ user, behavior }: CardUserProps) => {

return (
<>
<div className="flex space-x-3 md:space-x-4 lg:space-x-5">
<div className="flex space-x-3 md:space-x-4 lg:space-x-5 dark:text-white">
{behavior === "card" && <Avatar user={user} />}
<div className="flex flex-col text-sm md:text-base text-left w-full">
<h3 className="font-semibold">
Expand Down
Loading

0 comments on commit 4f5c3eb

Please sign in to comment.