Skip to content

Commit

Permalink
ready to deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
divu777 committed Jul 1, 2024
1 parent 5882e27 commit bb5053b
Show file tree
Hide file tree
Showing 47 changed files with 472 additions and 211 deletions.
130 changes: 130 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
130 changes: 130 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
6 changes: 3 additions & 3 deletions frontend/src/components/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const CardContainer = ({
const containerRef = useRef<HTMLDivElement>(null);
const [isMouseEntered, setIsMouseEntered] = useState(false);

const handleMouseMove = (e: React.MouseEvent<HTMLDivElement>) => {
const handleMouseMove = (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
if (!containerRef.current) return;
const { left, top, width, height } =
containerRef.current.getBoundingClientRect();
Expand All @@ -33,12 +33,12 @@ export const CardContainer = ({
containerRef.current.style.transform = `rotateY(${x}deg) rotateX(${y}deg)`;
};

const handleMouseEnter = (e: React.MouseEvent<HTMLDivElement>) => {
const handleMouseEnter = () => {
setIsMouseEntered(true);
if (!containerRef.current) return;
};

const handleMouseLeave = (e: React.MouseEvent<HTMLDivElement>) => {
const handleMouseLeave = () => {
if (!containerRef.current) return;
setIsMouseEntered(false);
containerRef.current.style.transform = `rotateY(0deg) rotateX(0deg)`;
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/Layout/AdminMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { NavLink } from "react-router-dom";

const AdminMenu = () => {
Expand Down
10 changes: 6 additions & 4 deletions frontend/src/components/Layout/Example.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from "react";
import { useRef } from "react";
import { motion, sync, useCycle } from "framer-motion";
import { motion, useCycle } from "framer-motion";
import { useDimensions } from "./use-dimensions";
import { MenuToggle } from "./MenuToggle";
import { Navigation } from "./Navigation";
Expand All @@ -27,8 +26,11 @@ const sidebar = {

export const Example = () => {
const [isOpen, toggleOpen] = useCycle(false, true);
const containerRef = useRef<HTMLDivElement>(null); // Initialize with React.createRef()
const { height } = useDimensions(containerRef);
const containerRef = useRef<HTMLDivElement>(null); // Initialize with useRef
const dimensions = useDimensions(containerRef);

// Ensure dimensions is not null or undefined
const height = dimensions ? dimensions.height : 0;

return (
<motion.nav
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/Layout/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { NavLink } from "react-router-dom";

const Footer = () => {
Expand Down
12 changes: 3 additions & 9 deletions frontend/src/components/Layout/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React, { useState } from "react";
import { useState } from "react";

import { Link, NavLink } from "react-router-dom";
import { NavLink } from "react-router-dom";
import { useAuth } from "../../context/auth";
import toast from "react-hot-toast";
import SearchInput from "../form/SearchInput";
import useCategory from "../../hooks/useCategory";
import { useCart } from "../../context/Cart";
import { Badge } from "antd";
import "./Header.css";
Expand All @@ -13,15 +12,10 @@ import { BsHandbag } from "react-icons/bs";

import SideBar from "./SideBar";
import { FaRegUser } from "react-icons/fa";
interface Category {
_id: string;
name: string;
slug: string;
}

const Header = () => {
const [auth, setAuth] = useAuth();
const categories: Category[] = useCategory();

const [cart] = useCart();
const [isUserDropdownOpen, setIsUserDropdownOpen] = useState(false);

Expand Down
2 changes: 0 additions & 2 deletions frontend/src/components/Layout/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ const variants = {
},
};

const colors = ["#FF008C", "#D309E1", "#9C1AFF", "#7700FF", "#4400FF"];

export const MenuItem = ({ children }: { children: React.ReactNode }) => {
const style = { border: `2px solid` };

Expand Down
12 changes: 9 additions & 3 deletions frontend/src/components/Layout/MenuToggle.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import * as React from "react";
import { motion } from "framer-motion";
import { motion, SVGMotionProps } from "framer-motion";

const Path = (props) => (
interface PathProps extends SVGMotionProps<SVGPathElement> {}

const Path: React.FC<PathProps> = (props) => (
<motion.path
fill="transparent"
strokeWidth="3"
Expand All @@ -11,7 +13,11 @@ const Path = (props) => (
/>
);

export const MenuToggle = ({ toggle }) => (
interface MenuToggleProps {
toggle: () => void;
}

export const MenuToggle: React.FC<MenuToggleProps> = ({ toggle }) => (
<button onClick={toggle}>
<svg width="23" height="23" viewBox="0 0 23 23">
<Path
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Layout/Navigation.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Navigation.tsx
import * as React from "react";

import { motion } from "framer-motion";
import { MenuItem } from "./MenuItem";
import { NavLink } from "react-router-dom";
Expand Down
Loading

0 comments on commit bb5053b

Please sign in to comment.