Skip to content

Commit

Permalink
feat: Update imports
Browse files Browse the repository at this point in the history
  • Loading branch information
RudraPatel2003 committed Jan 11, 2025
1 parent cb7890e commit b69eca7
Show file tree
Hide file tree
Showing 32 changed files with 87 additions and 63 deletions.
2 changes: 1 addition & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AppRouterCacheProvider } from "@mui/material-nextjs/v14-appRouter";
import type { Metadata } from "next";
import { Roboto } from "next/font/google";

import Header from "@/components/Header";
import { Header } from "@/components/Header";
import NextAuthProvider from "@/providers/NextAuthProvider";
import theme from "@/styles/theme";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import { Check } from "@mui/icons-material";
import Button from "@mui/material/Button";
import React, { Dispatch, SetStateAction } from "react";

import { Row } from "@/components/AdminDashboard/PendingApplicationDashboard";
import { handleApproveProgramApplication } from "@/server/api/program-enrollments/public-mutations";
import { ProgramEnrollment } from "@/types";

import { Row } from ".";

type AcceptPendingApplicationButtonProps = {
programEnrollment: ProgramEnrollment;
rows: Row[];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Box, Typography } from "@mui/material";

import FormResponse from "@/components/AdminDashboard/PendingApplicationDashboard/PendingApplicationInfoModal/FormResponse";
import { GeneralInformationSection } from "@/types/EnrollmentForm";

import FormResponse from "./FormResponse";

type GeneralInformationResponsesProps = {
generalInformationSection: GeneralInformationSection;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Box, Typography } from "@mui/material";

import FormResponse from "@/components/AdminDashboard/PendingApplicationDashboard/PendingApplicationInfoModal/FormResponse";
import { ProgramSelectionSection } from "@/types/EnrollmentForm";
import { ProgramSelectionSection } from "@/types";

import FormResponse from "./FormResponse";

type ProgramSelectionResponsesProps = {
programSelectionSection: ProgramSelectionSection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Box, Typography } from "@mui/material";

import FormResponse from "@/components/AdminDashboard/PendingApplicationDashboard/PendingApplicationInfoModal/FormResponse";
import { ProgramSpecificQuestionsSection } from "@/types/EnrollmentForm";

import FormResponse from "../FormResponse";

type GetPreventativeScreeningResponsesProps = {
programSpecificQuestionsSection: ProgramSpecificQuestionsSection;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Box, Typography } from "@mui/material";

import FormResponse from "@/components/AdminDashboard/PendingApplicationDashboard/PendingApplicationInfoModal/FormResponse";
import { ProgramSpecificQuestionsSection } from "@/types/EnrollmentForm";
import { ProgramSpecificQuestionsSection } from "@/types";
import getBmiClassification from "@/utils/getBmiClassification";

import FormResponse from "../FormResponse";

type HealthyHabitsAndDiabetesPreventionResponsesProps = {
programSpecificQuestionsSection: ProgramSpecificQuestionsSection;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Box, Typography } from "@mui/material";

import FormResponse from "@/components/AdminDashboard/PendingApplicationDashboard/PendingApplicationInfoModal/FormResponse";
import { ProgramSpecificQuestionsSection } from "@/types/EnrollmentForm";
import { ProgramSpecificQuestionsSection } from "@/types";

import FormResponse from "../FormResponse";

type RigsWithoutCigsResponsesProps = {
programSpecificQuestionsSection: ProgramSpecificQuestionsSection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Box, Typography } from "@mui/material";

import FormResponse from "@/components/AdminDashboard/PendingApplicationDashboard/PendingApplicationInfoModal/FormResponse";
import { ProgramSpecificQuestionsSection } from "@/types/EnrollmentForm";
import { ProgramSpecificQuestionsSection } from "@/types";

import FormResponse from "../FormResponse";

type VaccineVoucherResponsesProps = {
programSpecificQuestionsSection: ProgramSpecificQuestionsSection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Box, Typography } from "@mui/material";

import GetPreventativeScreeningResponses from "@/components/AdminDashboard/PendingApplicationDashboard/PendingApplicationInfoModal/ProgramSpecificResponses/GetPreventativeScreeningResponses";
import HealthyHabitsAndDiabetesPreventionResponses from "@/components/AdminDashboard/PendingApplicationDashboard/PendingApplicationInfoModal/ProgramSpecificResponses/HealthyHabitsAndDiabetesPreventionResponses";
import RigsWithoutCigsResponses from "@/components/AdminDashboard/PendingApplicationDashboard/PendingApplicationInfoModal/ProgramSpecificResponses/RigsWithoutCigsResponses";
import VaccineVoucherResponses from "@/components/AdminDashboard/PendingApplicationDashboard/PendingApplicationInfoModal/ProgramSpecificResponses/VaccineVoucherResponses";
import { ProgramSpecificQuestionsSection } from "@/types/EnrollmentForm";
import { ProgramSpecificQuestionsSection } from "@/types";

import GetPreventativeScreeningResponses from "./GetPreventativeScreeningResponses";
import HealthyHabitsAndDiabetesPreventionResponses from "./HealthyHabitsAndDiabetesPreventionResponses";
import RigsWithoutCigsResponses from "./RigsWithoutCigsResponses";
import VaccineVoucherResponses from "./VaccineVoucherResponses";

type ProgramSpecificResponsesProps = {
programSpecificQuestionsSection: ProgramSpecificQuestionsSection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Box, Typography } from "@mui/material";

import FormResponse from "@/components/AdminDashboard/PendingApplicationDashboard/PendingApplicationInfoModal/FormResponse";
import { QualifyingQuestionsSection } from "@/types/EnrollmentForm";
import { QualifyingQuestionsSection } from "@/types";

import FormResponse from "./FormResponse";

type QualifyingQuestionResponsesProps = {
qualifyingQuestionsSection: QualifyingQuestionsSection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import InfoIcon from "@mui/icons-material/Info";
import { Box, Button, Fade, Modal, Typography } from "@mui/material";
import { useState } from "react";

import GeneralInformationResponses from "@/components/AdminDashboard/PendingApplicationDashboard/PendingApplicationInfoModal/GeneralInformationResponses";
import ProgramSelectionResponses from "@/components/AdminDashboard/PendingApplicationDashboard/PendingApplicationInfoModal/ProgramSelectionResponses";
import ProgramSpecificResponses from "@/components/AdminDashboard/PendingApplicationDashboard/PendingApplicationInfoModal/ProgramSpecificResponses";
import QualifyingQuestionResponses from "@/components/AdminDashboard/PendingApplicationDashboard/PendingApplicationInfoModal/QualifyingQuestionResponses";
import { EnrollmentForm } from "@/types";

import GeneralInformationResponses from "./GeneralInformationResponses";
import ProgramSelectionResponses from "./ProgramSelectionResponses";
import ProgramSpecificResponses from "./ProgramSpecificResponses";
import QualifyingQuestionResponses from "./QualifyingQuestionResponses";

const style = {
position: "absolute",
top: "50%",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ import React, { Dispatch, SetStateAction, useState } from "react";
import { useForm } from "react-hook-form";
import { z } from "zod";

import { Row } from "@/components/AdminDashboard/PendingApplicationDashboard";
import ControlledTextField from "@/components/controlled/ControlledTextField";
import { handleRejectProgramApplication } from "@/server/api/program-enrollments/public-mutations";
import { ProgramEnrollment } from "@/types";

import { Row } from ".";

const rejectionReasonSchema = z.object({
rejectionReason: z.string().min(1, { message: "Reason is required" }),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import { Box, Snackbar, TextField, Typography } from "@mui/material";
import { DataGrid, GridColDef } from "@mui/x-data-grid";
import { useState } from "react";

import AcceptPendingApplicationButton from "@/components/AdminDashboard/PendingApplicationDashboard/AcceptPendingApplicationButton";
import PendingApplicationInfoModal from "@/components/AdminDashboard/PendingApplicationDashboard/PendingApplicationInfoModal";
import RejectPendingApplicationButton from "@/components/AdminDashboard/PendingApplicationDashboard/RejectPendingApplicationButton";
import { ClientUser, Program, ProgramEnrollment } from "@/types";

import AcceptPendingApplicationButton from "./AcceptPendingApplicationButton";
import PendingApplicationInfoModal from "./PendingApplicationInfoModal";
import RejectPendingApplicationButton from "./RejectPendingApplicationButton";

export type Row = {
id?: string;
lastName: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from "@mui/material";
import { ReactNode } from "react";

import getButtonStyles from "@/components/AdminDashboard/Sidebar/getButtonStyles";
import getButtonStyles from "./getButtonStyles";

type CollapsibleSidebarButtonProps = {
pathname: string;
Expand Down
2 changes: 1 addition & 1 deletion src/components/AdminDashboard/Sidebar/SidebarButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import Link from "next/link";
import { ReactNode } from "react";

import getButtonStyles from "@/components/AdminDashboard/Sidebar/getButtonStyles";
import getButtonStyles from "./getButtonStyles";

type SidebarButtonProps = {
pathname: string;
Expand Down
4 changes: 2 additions & 2 deletions src/components/AdminDashboard/Sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { Box, Collapse, Drawer, List, Toolbar, useTheme } from "@mui/material";
import { usePathname } from "next/navigation";
import { useState } from "react";

import CollapsibleSidebarButton from "@/components/AdminDashboard/Sidebar/CollapsibleSidebarButton";
import SidebarButton from "@/components/AdminDashboard/Sidebar/SidebarButton";
import CollapsibleSidebarButton from "./CollapsibleSidebarButton";
import SidebarButton from "./SidebarButton";

const drawerWidth = 200;

Expand Down
3 changes: 2 additions & 1 deletion src/components/ChangePassword/ChangePasswordForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import { useState } from "react";
import { useForm } from "react-hook-form";
import { z } from "zod";

import ControlledTextField from "@/components/controlled/ControlledTextField";
import { handleChangePassword } from "@/server/api/users/public-mutations";

import ControlledTextField from "../controlled/ControlledTextField";

const changePasswordFormSchema = z
.object({
oldPassword: z.string().min(8, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ import {
} from "@mui/material";
import { useState } from "react";

import HealthyHabitsTrackingFormModal from "@/components/ClientDashboard/HealthyHabits/HealthyHabitsHistory/HealthyHabitsTrackingFormList/HealthyHabitsTrackingFormModal";
import { HealthyHabitsTrackingForm } from "@/types";
import dayjsUtil from "@/utils/dayjsUtil";

import HealthyHabitsTrackingFormModal from "./HealthyHabitsTrackingFormModal";

type HealthyHabitsTrackingFormListItemProps = {
form: HealthyHabitsTrackingForm;
handleDelete: (form: HealthyHabitsTrackingForm) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import { Box, List, Snackbar, Typography } from "@mui/material";
import { Dispatch, SetStateAction, useState } from "react";

import HealthyHabitsTrackingFormListItem from "@/components/ClientDashboard/HealthyHabits/HealthyHabitsHistory/HealthyHabitsTrackingFormList/HealthyHabitsTrackingFormListItem";
import { handleHealthyHabitsTrackingFormDeletion } from "@/server/api/healthy-habits-tracking-forms/public-mutations";
import { ClientUser, HealthyHabitsTrackingForm } from "@/types";

import HealthyHabitsTrackingFormListItem from "./HealthyHabitsTrackingFormListItem";

type HealthyHabitsTrackingFormListProps = {
trackingForms: HealthyHabitsTrackingForm[];
setTrackingForms: Dispatch<SetStateAction<HealthyHabitsTrackingForm[]>>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import { Box, Typography } from "@mui/material";
import { useState } from "react";

import HealthyHabitsTrackingFormList from "@/components/ClientDashboard/HealthyHabits/HealthyHabitsHistory/HealthyHabitsTrackingFormList";
import ModularBarChart from "@/components/ClientDashboard/HealthyHabits/HealthyHabitsHistory/ModularBarChart";
import ModularLineChart from "@/components/ClientDashboard/HealthyHabits/HealthyHabitsHistory/ModularLineChart";
import { ClientUser, HealthyHabitsTrackingForm } from "@/types";

import HealthyHabitsTrackingFormList from "./HealthyHabitsTrackingFormList";
import ModularBarChart from "./ModularBarChart";
import ModularLineChart from "./ModularLineChart";

type HealthyHabitsHistoryProps = {
initialForms: HealthyHabitsTrackingForm[];
user: ClientUser;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ import { Controller, useForm } from "react-hook-form";

import ControlledTextField from "@/components/controlled/ControlledTextField";
import { handleHealthyHabitsTrackingFormSubmission } from "@/server/api/healthy-habits-tracking-forms/public-mutations";
import { ClientUser } from "@/types";
import {
ClientUser,
HealthyHabitsFormValues,
HealthyHabitsTrackingForm,
healthyHabitsValidator,
} from "@/types/HealthyHabitsTrackingForm";
} from "@/types";
import apiErrors from "@/utils/constants/apiErrors";
import dayjsUtil from "@/utils/dayjsUtil";
import getClosestPastSunday from "@/utils/getClosestPastSunday";
Expand Down
11 changes: 6 additions & 5 deletions src/components/ClientDashboard/HealthyHabits/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
"use client";
import { Box, Divider, Tab, Tabs, Typography } from "@mui/material";
import { useState } from "react";
import { SyntheticEvent, useState } from "react";

import HealthyHabitsHistory from "@/components/ClientDashboard/HealthyHabits/HealthyHabitsHistory";
import HealthyHabitsInfo from "@/components/ClientDashboard/HealthyHabits/HealthyHabitsInfo";
import HealthyHabitsTracking from "@/components/ClientDashboard/HealthyHabits/HealthyHabitsTracking";
import { ClientUser } from "@/types";

import HealthyHabitsHistory from "./HealthyHabitsHistory";
import HealthyHabitsInfo from "./HealthyHabitsInfo";
import HealthyHabitsTracking from "./HealthyHabitsTracking";

type HealthyHabitsSections = "tracking" | "history" | "info";

type HealthyHabitsProps = {
Expand All @@ -18,7 +19,7 @@ export default function HealthyHabits({ user }: HealthyHabitsProps) {
useState<HealthyHabitsSections>("tracking");

const handleTabChange = (
_event: React.SyntheticEvent,
_event: SyntheticEvent,
newValue: HealthyHabitsSections,
) => {
setSelectedSection(newValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ import { useRouter } from "next/navigation";
import { useState } from "react";
import { Controller, useFieldArray, useForm } from "react-hook-form";

import ControlledTextField from "@/components/controlled/ControlledTextField";
import useEnrollmentForm from "@/hooks/useEnrollmentForm";
import {
Doctor,
GeneralInformationSection,
generalInformationSectionValidator,
} from "@/types/EnrollmentForm";
} from "@/types";
import dayjsUtil from "@/utils/dayjsUtil";

import ControlledTextField from "../controlled/ControlledTextField";

function isDisqualified(generalInformationSection: GeneralInformationSection) {
if (!generalInformationSection.hasClassACdl) {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
EnrollmentForm,
ProgramSelectionSection,
programSelectionSectionValidator,
} from "@/types/EnrollmentForm";
} from "@/types";
import calculateAge from "@/utils/calculateAge";

function shouldShowDiabetesPreventionButton(enrollmentForm: EnrollmentForm) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@ import { useRouter } from "next/navigation";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";

import GetPreventativeScreeningsProgramSpecificQuestions from "@/components/EnrollmentForm/ProgramSpecificQuestions/GetPreventativeScreeningsProgramSpecificQuestions";
import HealthyHabitsProgramSpecificQuestions from "@/components/EnrollmentForm/ProgramSpecificQuestions/HealthyHabitsProgramSpecificQuestions";
import RigsWithoutCigsProgramSpecificQuestions from "@/components/EnrollmentForm/ProgramSpecificQuestions/RigsWithoutCigsProgramSpecificQuestions";
import VaccineVoucherProgramSpecificQuestions from "@/components/EnrollmentForm/ProgramSpecificQuestions/VaccineVoucherProgramSpecificQuestions";
import useEnrollmentForm from "@/hooks/useEnrollmentForm";
import { handleEnrollmentFormSubmission } from "@/server/api/enrollment-forms/public-mutations";
import {
ProgramSpecificQuestionsSection,
programSpecificQuestionsSectionValidator,
} from "@/types/EnrollmentForm";
} from "@/types";
import apiErrors from "@/utils/constants/apiErrors";

import GetPreventativeScreeningsProgramSpecificQuestions from "./GetPreventativeScreeningsProgramSpecificQuestions";
import HealthyHabitsProgramSpecificQuestions from "./HealthyHabitsProgramSpecificQuestions";
import RigsWithoutCigsProgramSpecificQuestions from "./RigsWithoutCigsProgramSpecificQuestions";
import VaccineVoucherProgramSpecificQuestions from "./VaccineVoucherProgramSpecificQuestions";

export default function ProgramSpecificQuestionsFormSection() {
const [snackbarOpen, setSnackbarOpen] = useState(false);
const [snackbarMessage, setSnackbarMessage] = useState("");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ import { useRouter } from "next/navigation";
import { useEffect, useState } from "react";
import { Controller, useForm } from "react-hook-form";

import ControlledTextField from "@/components/controlled/ControlledTextField";
import useEnrollmentForm from "@/hooks/useEnrollmentForm";
import {
QualifyingQuestionsSection,
qualifyingQuestionsSectionValidator,
} from "@/types/EnrollmentForm";
} from "@/types";

import ControlledTextField from "../controlled/ControlledTextField";

export default function QualifyingQuestionsFormSection() {
const [isLoading, setIsLoading] = useState(false);
Expand Down
3 changes: 2 additions & 1 deletion src/components/ForgotPassword/ForgotPasswordForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import { useState } from "react";
import { useForm } from "react-hook-form";
import { z } from "zod";

import ControlledTextField from "@/components/controlled/ControlledTextField";
import handlePasswordResetRequest from "@/server/api/password-reset-tokens/public-mutations";

import ControlledTextField from "../controlled/ControlledTextField";

const forgotPasswordFormSchema = z.object({
email: z.string().email({ message: "Invalid email" }),
});
Expand Down
3 changes: 2 additions & 1 deletion src/components/ForgotPassword/ResetPasswordForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import { useState } from "react";
import { useForm } from "react-hook-form";
import { z } from "zod";

import ControlledTextField from "@/components/controlled/ControlledTextField";
import { resetPasswordWithToken } from "@/server/api/users/public-mutations";

import ControlledTextField from "../controlled/ControlledTextField";

const resetPasswordFormSchema = z
.object({
newPassword: z.string().min(8, {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { Button } from "@mui/material";
import Link from "next/link";
import { useSession } from "next-auth/react";

import Logo from "@/components/Logo";
import Logo from "../Logo";

export default function Header() {
export function Header() {
const { data: session } = useSession();

return (
Expand Down
Loading

0 comments on commit b69eca7

Please sign in to comment.