Skip to content

Commit

Permalink
feat: configured aliasing paths in project (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
yll0rd authored Nov 6, 2024
1 parent b4685c5 commit 4fecf22
Show file tree
Hide file tree
Showing 34 changed files with 86 additions and 55 deletions.
21 changes: 20 additions & 1 deletion src/apis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { AxiosError } from "axios";
import axiosClient from "./axios";
import { ILoginForm, IRegisterForm } from "../models";
import { ILoginForm, IRegisterForm } from "@/models";
import { toast } from "react-hot-toast";

type IResponse<T = unknown> = {
Expand Down Expand Up @@ -77,3 +77,22 @@ export const signinUser = async (
}
return null;
};




export const verifyEmail = async (body: {
email: string;
}): Promise<IResponse | null> => {
try {
const { data } = await axiosClient.post<IResponse>("/auth/password/reset/", body);
toast.success(data.message);
return data;
} catch (err) {
if (err instanceof AxiosError){
const { data: { errors } } = err.response!
toast.error(errors[0]);
}
return null;
}
};
2 changes: 1 addition & 1 deletion src/components/AvatarUsers.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Avatars } from '../assets';
import { Avatars } from '@/assets';

const AvatarUsers = (
// { amount }: { amount?: number }
Expand Down
2 changes: 1 addition & 1 deletion src/components/Carousel/Carousel.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import { Swiper, SwiperSlide } from 'swiper/react';
import { Pagination, Autoplay, EffectCoverflow } from 'swiper/modules';
import {AuthImages} from '../../assets'
import {AuthImages} from '@/assets'


import 'swiper/css';
Expand Down
2 changes: 1 addition & 1 deletion src/components/EventCard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Badge, Button } from './layout';
import { Link } from 'react-router-dom';
import { GoArrowUpRight } from 'react-icons/go';
import { cn } from '../utils/constants';
import { cn } from '@/utils/constants';

interface EventCardProps {
discoverMore?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProjectCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HomeImages } from "../assets";
import { HomeImages } from "@/assets";
import { Badge } from "./layout";
import { GrArticle } from "react-icons/gr";
import { GoArrowUpRight } from "react-icons/go";
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/badge/Badge.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ReactNode } from 'react';
import { cn } from '../../../utils/constants';
import { cn } from '@/utils/constants';


interface BadgeProps {
Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/base-layout/BaseLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Navbar from '../navbar/Navbar';
import Footer from '../footer/Footer';
import Navbar from '@/components/layout/navbar/Navbar';
import Footer from '@/components/layout/footer/Footer';
import { Outlet } from 'react-router-dom';


Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ReactNode } from "react";
import { cn } from "../../../utils/constants";
import { cn } from "@/utils/constants";

interface ButtonProps {
backgroundColor?: string;
Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/footer/AuthFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { AuthImages } from '../../../assets';
import { AuthImages } from '@/assets';
import { VscGithubAlt } from 'react-icons/vsc';
import { CiTwitter } from 'react-icons/ci';
import { FiLinkedin, FiYoutube } from 'react-icons/fi';
import { LanguageSwitcher } from '../..';
import { LanguageSwitcher } from '@/components';


const AuthFooter = () => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { HomeImages } from '../../../assets';
import { HomeImages } from '@/assets';
import { VscGithubAlt } from 'react-icons/vsc';
import { CiTwitter } from 'react-icons/ci';
import { FiLinkedin, FiYoutube } from 'react-icons/fi';
import { LanguageSwitcher } from '../..';
import { LanguageSwitcher } from '@/components';
import { useLocation } from 'react-router-dom';


Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/navbar/AuthNavbar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Link } from 'react-router-dom'
import { AuthImages } from '../../../assets'
import { AuthImages } from '@/assets'

const AuthNavbar = () => {
return (
Expand Down
6 changes: 3 additions & 3 deletions src/components/layout/navbar/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { HiMenuAlt3 } from 'react-icons/hi';
import { AiOutlineClose } from 'react-icons/ai';
import { HomeImages } from '../../../assets';
import { ToggleSwitch } from '../../../components';
import { HomeImages } from '@/assets';
import { ToggleSwitch } from '@/components';
import { useState, useEffect } from 'react';
import { Link, useLocation } from 'react-router-dom';
import { navLinks } from '../../../utils/constants';
import { navLinks } from '@/utils/constants';
import { Button } from '../button';
import { VscAccount } from "react-icons/vsc";

Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/About-Page-Components/AboutHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AboutImages } from '../../../assets';
import { AboutImages } from '@/assets';

const AboutHeader = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/About-Page-Components/JoinUsNow.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button } from '../../layout';
import { Button } from '@/components/layout';


const JoinUsNow = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AboutImages } from '../../../assets';
import { AboutImages } from '@/assets';


const MissionVission = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/About-Page-Components/Organisers.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IoLogoLinkedin } from "react-icons/io";
import { AboutImages } from "../../../assets";
import { AboutImages } from "@/assets";
import { Link } from "react-router-dom";
import { FaGithub } from "react-icons/fa6";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AboutImages } from '../../../assets';
import { AboutImages } from '@/assets';

const WhereITStarted = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/Auth-Page-Components/AuthQuote.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import { useLocation } from 'react-router-dom'
import { AuthImages } from '../../../assets'
import { AuthImages } from '@/assets'

const AuthQuote = () => {
const { pathname } = useLocation()
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/Auth-Page-Components/Slider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Swiper, SwiperSlide } from 'swiper/react';
import { Pagination } from 'swiper/modules';
// import { AuthImages } from '../../../assets';
// import { AuthImages } from '@/assets';
import 'swiper/css';
import 'swiper/css/navigation';
import 'swiper/css/pagination';
Expand Down
4 changes: 2 additions & 2 deletions src/components/pages/Home-Page-Components/BecomeMember.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HomeImages } from '../../../assets';
import { Button } from '../../layout';
import { HomeImages } from '@/assets';
import { Button } from '@/components/layout';

const BecomeMember = () => {
const { blueDjango, blueMap } = HomeImages;
Expand Down
4 changes: 2 additions & 2 deletions src/components/pages/Home-Page-Components/Collaboration.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GoArrowUpRight } from 'react-icons/go';
import { HomeImages } from '../../../assets';
import { Button } from '../../layout';
import { HomeImages } from '@/assets';
import { Button } from '@/components/layout';


const Collaboration = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EventCard } from '../..';
import { EventCard } from '@/components';
import { Link } from 'react-router-dom';
import { GoArrowUpRight } from 'react-icons/go';

Expand Down
4 changes: 2 additions & 2 deletions src/components/pages/Home-Page-Components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button } from "../../layout";
import { HomeImages } from "../../../assets";
import { Button } from "@/components/layout";
import { HomeImages } from "@/assets";

const Header = () => {
const FACTS = [
Expand Down
4 changes: 2 additions & 2 deletions src/components/pages/Home-Page-Components/Newsletter.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Badge, Button } from '../../layout'
import { Badge, Button } from '@/components/layout'
import { AiOutlineSend } from 'react-icons/ai';
import { HomeImages } from '../../../assets';
import { HomeImages } from '@/assets';


const Newsletter = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Link } from "react-router-dom";
import { ProjectCard } from "../..";
import { ProjectCard } from "@/components";
import { GoArrowUpRight } from "react-icons/go";
import { LuArrowLeft, LuArrowRight } from "react-icons/lu";
import { useRef } from "react";
Expand Down
6 changes: 3 additions & 3 deletions src/components/pages/Home-Page-Components/YoutubeSection.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AvatarUsers } from "../..";
import { HomeImages } from "../../../assets";
import { Badge, Button } from "../../layout";
import { AvatarUsers } from "@/components";
import { HomeImages } from "@/assets";
import { Badge, Button } from "@/components/layout";
import { Link } from "react-router-dom";
import { GoArrowUpRight } from "react-icons/go";

Expand Down
2 changes: 1 addition & 1 deletion src/pages/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
MissionVission,
Organisers,
WhereITStarted,
} from '../components/pages/About-Page-Components';
} from '@/components/pages/About-Page-Components';

const About = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
YoutubeSection,
Header,
Newsletter,
} from "../components/pages/Home-Page-Components";
} from "@/components/pages/Home-Page-Components";

const Home = () => {
return (
Expand Down
4 changes: 2 additions & 2 deletions src/pages/auth/Auth.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import { Outlet } from 'react-router-dom';
import { TogglePage } from '../../components/pages/Auth-Page-Components';
import { AuthFooter, AuthNavbar } from '../../components/layout';
import { TogglePage } from '@/components/pages/Auth-Page-Components';
import { AuthFooter, AuthNavbar } from '@/components/layout';

const Auth = () => {
return (
Expand Down
10 changes: 5 additions & 5 deletions src/pages/auth/Login.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/* eslint-disable @typescript-eslint/no-explicit-any */

import { ILoginForm } from "../../models";
import { ILoginForm } from "@/models";
import * as yup from "yup";
import { yupResolver } from "@hookform/resolvers/yup";
import { useForm } from "react-hook-form";
import { Button } from "../../components/layout";
import { Button } from "@/components/layout";
import { Link } from "react-router-dom";
import { useState } from "react";
import { AiOutlineEye, AiOutlineEyeInvisible } from "react-icons/ai";
// import {Carousel} from "../../components";
// import {Carousel} from "@/components";
import { useNavigate } from "react-router-dom";
import { GoArrowUpRight } from "react-icons/go";
import AuthQuote from "../../components/pages/Auth-Page-Components/AuthQuote";
import { signinUser } from "../../apis";
import AuthQuote from "@/components/pages/Auth-Page-Components/AuthQuote";
import { signinUser } from "@/apis";

const Login = () => {
const navigate = useNavigate();
Expand Down
10 changes: 5 additions & 5 deletions src/pages/auth/Register.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/* eslint-disable @typescript-eslint/no-explicit-any */

import { IRegisterForm } from "../../models";
import { IRegisterForm } from "@/models";
import * as yup from "yup";
import { yupResolver } from "@hookform/resolvers/yup";
import { useForm } from "react-hook-form";
import { Button } from "../../components/layout";
import { Button } from "@/components/layout";
import { AiOutlineEye, AiOutlineEyeInvisible } from "react-icons/ai";
import { useState } from "react";
// import {Carousel} from "../../components";
// import {Carousel} from "@/components";
import { useNavigate } from "react-router-dom";
import AuthQuote from "../../components/pages/Auth-Page-Components/AuthQuote";
import { registerUser } from "../../apis";
import AuthQuote from "@/components/pages/Auth-Page-Components/AuthQuote";
import { registerUser } from "@/apis";

const Register = () => {
const navigate = useNavigate();
Expand Down
6 changes: 3 additions & 3 deletions src/pages/auth/forgot-password/Reset-password.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {Link, useNavigate} from 'react-router-dom';
import { AuthImages, HomeImages } from '../../../assets';
import { Button } from '../../../components/layout';
import { AuthImages, HomeImages } from '@/assets';
import { Button } from '@/components/layout';
import { useForm } from 'react-hook-form';
import { ResetPasswordForm } from '../../../models';
import { ResetPasswordForm } from '@/models';
import * as yup from 'yup';
import { yupResolver } from '@hookform/resolvers/yup';

Expand Down
8 changes: 7 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
"noFallthroughCasesInSwitch": true,

"baseUrl": ".",
"paths": {
"@/*": ["src/*"],
},

},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
Expand Down
6 changes: 6 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import path from "path"

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
})

0 comments on commit 4fecf22

Please sign in to comment.