Skip to content

Commit

Permalink
refactor: simplifying imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry Curtis committed Jul 31, 2024
1 parent 8693b18 commit 4ef17b1
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 28 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions src/components/decorators/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./ButtonAnimationDecorator";
export * from "./TransitionDecorator";
9 changes: 9 additions & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export * from "./ConfirmDeleteModal";
export * from "./ErrorComponent";
export * from "./LoadingWithSpinner";
export * from "./PrimaryButton";
export * from "./SecondaryButton";
export * from "./FeedbackComponent";
export * from "./Header";
export * from "./ProtectedRoute";
export * from "./PublicRoute";
5 changes: 5 additions & 0 deletions src/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export * from "./useAuth";
export * from "./useAuthHook";
export * from "./useFeedback";
export * from "./useFeedbackHook";
export * from "./useLocalStorage";
5 changes: 5 additions & 0 deletions src/interfaces/FeedbackItem.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface FeedbackItem {
type: string;
title: string;
message: string;
}
6 changes: 6 additions & 0 deletions src/interfaces/RegisterResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface RegisterResponse {
status: number;
data: {
msg: string;
};
}
2 changes: 2 additions & 0 deletions src/interfaces/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./FeedbackItem";
export * from "./RegisterResponse";
25 changes: 7 additions & 18 deletions src/pages/Register.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { validatePassword, validateUsername } from "../validation/validate";
import feedback from "../../data/feedback.json";
import { useAuth } from "../hooks/useAuth";
import { useFeedback } from "../hooks/useFeedback";
import { TransitionDecorator } from "../components/decorators/TransitionDecorator";
import { ButtonAnimationDecorator } from "../components/decorators/ButtonAnimationDecorator";
import { PrimaryButton } from "../components/PrimaryButton";
import { useAuth, useFeedback } from "../hooks";
import {
TransitionDecorator,
ButtonAnimationDecorator,
} from "../components/decorators";
import { PrimaryButton } from "../components";
import React, { useState, useEffect } from "react";
import {
Container,
Expand All @@ -16,19 +17,7 @@ import {
InputGroup,
Spinner,
} from "react-bootstrap";

interface FeedbackItem {
type: string,
title: string,
message: string
}

interface RegisterResponse {
status: number;
data: {
msg: string;
};
}
import { FeedbackItem, RegisterResponse } from "../interfaces";

export const Register = () => {
const { triggerFeedback } = useFeedback();
Expand Down
12 changes: 6 additions & 6 deletions src/pages/SignIn.jsx → src/pages/SignIn.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { handleChangeHelper } from "../helper/handleHelper";
import { useAuth } from "../hooks/useAuth";
import { useFeedback } from "../hooks/useFeedback";
import { LoadingWithSpinner } from "../components/LoadingWithSpinner";
import { TransitionDecorator } from "../components/decorators/TransitionDecorator";
import { ButtonAnimationDecorator } from "../components/decorators/ButtonAnimationDecorator";
import { useAuth, useFeedback } from "../hooks";
import { LoadingWithSpinner, PrimaryButton } from "../components";
import {
TransitionDecorator,
ButtonAnimationDecorator,
} from "../components/decorators";
import { useState } from "react";
import {
Form,
Expand All @@ -14,7 +15,6 @@ import {
Button,
Image,
} from "react-bootstrap";
import { PrimaryButton } from "../components/PrimaryButton";

export const SignIn = () => {
const { triggerFeedback } = useFeedback();
Expand Down
9 changes: 5 additions & 4 deletions src/pages/Splash.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { PrimaryButton } from "../components/PrimaryButton";
import { SecondaryButton } from "../components/SecondaryButton";
import { TransitionDecorator } from "../components/decorators/TransitionDecorator";
import { ButtonAnimationDecorator } from "../components/decorators/ButtonAnimationDecorator";
import { PrimaryButton, SecondaryButton } from "../components";
import {
TransitionDecorator,
ButtonAnimationDecorator,
} from "../components/decorators";
import { Stack } from "react-bootstrap";
import { Link } from "react-router-dom";

Expand Down

0 comments on commit 4ef17b1

Please sign in to comment.