diff --git a/src/app/journey-page/[journeyId]/page.tsx b/src/app/journey-page/[journeyId]/page.tsx
index 97f6f2f..35d418b 100644
--- a/src/app/journey-page/[journeyId]/page.tsx
+++ b/src/app/journey-page/[journeyId]/page.tsx
@@ -1,20 +1,31 @@
'use client';
import React, { useEffect, useState } from 'react';
-import { Box, CircularProgress, Divider, IconButton, Typography } from '@mui/material';
+import {
+ Box,
+ CircularProgress,
+ Divider,
+ IconButton,
+ Typography,
+} from '@mui/material';
import JourneyInfo from '@/components/journey/journeyInfo';
import JourneyPath from '@/components/journey/journeyPath';
-import { getJourney, getJourneysByPoint, getTrails } from '@/services/studioMaker.service';
+import {
+ getJourney,
+ getJourneysByPoint,
+ getTrails,
+} from '@/services/studioMaker.service';
import { Journey } from '@/lib/interfaces/journey.interface';
import { Trail } from '@/lib/interfaces/trails.interface';
import { useParams, useRouter } from 'next/navigation';
-import { getSubscribedJourneys, } from '@/services/user.service';
+import {
+ getSubscribedJourneys,
+ getCompletedTrails,
+} from '@/services/user.service';
import { useSession } from 'next-auth/react';
-import { getCompletedTrails } from '@/services/user.service';
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
import ArrowForwardIcon from '@mui/icons-material/ArrowForward';
-
export default function JourneyPage() {
const { journeyId } = useParams();
const router = useRouter();
@@ -56,13 +67,17 @@ export default function JourneyPage() {
const pointId = journeyData.point;
if (pointId) {
const relatedJourneys: Journey[] = await getJourneysByPoint(pointId);
- const next = relatedJourneys.find(j => j.order === journeyData.order + 1);
+ const next = relatedJourneys.find(
+ (j) => j.order === journeyData.order + 1,
+ );
if (next != undefined) {
setNextJourney(next);
console.log(next);
console.log(nextJourney);
}
- const previous = relatedJourneys.find(j => j.order === journeyData.order - 1);
+ const previous = relatedJourneys.find(
+ (j) => j.order === journeyData.order - 1,
+ );
if (previous != undefined) {
setPreviousJourney(previous);
console.log(previous);
@@ -90,11 +105,11 @@ export default function JourneyPage() {
const handleNext = async () => {
router.push(`/journey-page/${nextJourney?._id}`);
- }
+ };
const handlePrevious = async () => {
router.push(`/journey-page/${previousJourney?._id}`);
- }
+ };
if (error) {
return
{error}
;
@@ -109,45 +124,53 @@ export default function JourneyPage() {
);
return (
-
- {(previousJourney) &&
-
+
+ {previousJourney && (
+
- }
-
- {(nextJourney) &&
-
+ )}
+
+ {nextJourney && (
+
- }
-
+ )}
+
-
+
-
+
{!trails.length ? (
) : (
-
-
-
+
)}
diff --git a/src/app/journey/[...pointId]/page.tsx b/src/app/journey/[...pointId]/page.tsx
index e2cf2dc..b3cb4f7 100644
--- a/src/app/journey/[...pointId]/page.tsx
+++ b/src/app/journey/[...pointId]/page.tsx
@@ -27,7 +27,7 @@ import { toast } from 'sonner';
export default function JourneyPage({
params,
}: {
- params: { pointId: string };
+ readonly params: { pointId: string };
}) {
const fetchJourneys = async (): Promise
=> {
let journeys = await getJourneysByPoint(params.pointId);
@@ -85,8 +85,6 @@ export default function JourneyPage({
const handleJourneyAction = (action: string) => {
if (action === 'editar') setEditionDialogOpen(true);
- if (action === 'gerenciar') {
- }
if (action === 'excluir') setExclusionDialogOpen(true);
};
@@ -116,20 +114,12 @@ export default function JourneyPage({
}
};
- const handleCloseCreateDialog = () => {
- setCreateDialogOpen(false);
- };
-
if (isLoading) {
return ;
}
if (error) {
- return (
-
- Error fetching journeys: {(error as Error).message}
-
- );
+ return Error fetching journeys;
}
return (
diff --git a/src/app/register/page.tsx b/src/app/register/page.tsx
index 4b6a722..03bd19a 100644
--- a/src/app/register/page.tsx
+++ b/src/app/register/page.tsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { Box, Typography, IconButton, Link, Grid } from '@mui/material';
+import { Box, Typography, Link, Grid } from '@mui/material';
import Image from 'next/image';
import maoCerebro from '@/public/mao_cerebro.png';
import { SingUpForm } from '@/components/forms/signUpForm';
diff --git a/src/app/reset-password/page.tsx b/src/app/reset-password/page.tsx
index a038ec5..ac30da7 100644
--- a/src/app/reset-password/page.tsx
+++ b/src/app/reset-password/page.tsx
@@ -5,26 +5,19 @@ import { Box, TextField, IconButton, InputAdornment } from '@mui/material';
import { Visibility, VisibilityOff } from '@mui/icons-material';
import MyButton from '@/components/ui/buttons/myButton.component';
import calculusLogos from '@/public/calculus-logo.svg';
-import { useSearchParams } from 'next/navigation';
+import { useSearchParams, useRouter } from 'next/navigation';
import {
ResetPasswordData,
resetPasswordSchema,
} from '@/lib/schemas/password.schema';
import { useForm, SubmitHandler } from 'react-hook-form';
import { zodResolver } from '@hookform/resolvers/zod';
-import { useRouter } from 'next/navigation';
import { resetPassword } from '@/services/user.service';
import { useMutation } from '@tanstack/react-query';
import { toast } from 'sonner';
import { useState, Suspense } from 'react';
export default function ResetPassword() {
- const SearchParamsComponent = () => {
- const searchParams = useSearchParams();
- const token = searchParams.get('token');
- return { token };
- };
-
return (
Loading...
@@ -47,7 +40,7 @@ function SearchParamsComponentWrapper() {
resolver: zodResolver(resetPasswordSchema),
});
- const { mutate, isPending } = useMutation({
+ const { mutate } = useMutation({
mutationFn: async (data: any) => await resetPassword(data),
onSuccess: (data) => {
toast.success('Senha alterada com sucesso');
diff --git a/src/app/starting-points/page.tsx b/src/app/starting-points/page.tsx
index 92f5787..60298ad 100644
--- a/src/app/starting-points/page.tsx
+++ b/src/app/starting-points/page.tsx
@@ -14,7 +14,7 @@ import {
} from '@mui/material';
import ButtonRed from '@/components/ui/buttons/red.button';
import SearchBar from '@/components/admin/SearchBar';
-import StartpointTable from '@/components/tables/startingpoints.table';
+import StartPointTable from '@/components/tables/startingpoints.table';
import { StartPoint } from '@/lib/interfaces/startPoint.interface';
import { UserRole } from '@/lib/enum/userRole.enum';
import {
@@ -32,7 +32,9 @@ const StartPointPage: React.FC = () => {
const router = useRouter();
const { data: session } = useSession();
const [listStartPoints, setListStartPoints] = useState