From f8e3173067f65736fe155e42d344e16af189753a Mon Sep 17 00:00:00 2001 From: NotII <46204250+NotII@users.noreply.github.com> Date: Sat, 17 May 2025 17:52:25 +0100 Subject: [PATCH] Cleanup --- app/layout.tsx | 8 -- app/page.tsx | 3 - components/3d/ClientStatsWrapper.tsx | 32 -------- components/3d/HeroModel.tsx | 85 --------------------- components/3d/HeroSection.tsx | 51 ------------- components/3d/StatCard.tsx | 86 --------------------- components/3d/StatsSection.tsx | 108 --------------------------- components/dashboard/ChatDetail.tsx | 2 +- components/text-typer.tsx | 87 --------------------- package.json | 4 +- public/git-info.json | 4 +- scripts/build-optimized.sh | 1 - scripts/find-deprecated-imports.js | 11 +-- 13 files changed, 6 insertions(+), 476 deletions(-) delete mode 100644 components/3d/ClientStatsWrapper.tsx delete mode 100644 components/3d/HeroModel.tsx delete mode 100644 components/3d/HeroSection.tsx delete mode 100644 components/3d/StatCard.tsx delete mode 100644 components/3d/StatsSection.tsx delete mode 100644 components/text-typer.tsx delete mode 100644 scripts/build-optimized.sh diff --git a/app/layout.tsx b/app/layout.tsx index 923f313..65f0abe 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -12,7 +12,6 @@ export const metadata: Metadata = { title: "Ember | E-Commerce Management Platform", description: "Transform your e-commerce experience with Ember, a comprehensive platform that integrates secure cryptocurrency payments, efficient order management, and advanced analytics to help you optimize performance, boost sales, and expand your customer base", keywords: "e-commerce, marketplace, cryptocurrency payments, order management, vendor platform, online business", - metadataBase: new URL("https://embermarket.app"), authors: [{ name: "Ember Team" }], creator: "Ember ", publisher: "Ember", @@ -38,7 +37,6 @@ export const metadata: Metadata = { openGraph: { title: "Ember | E-Commerce Management Platform", description: "Transform your e-commerce experience with Ember, a comprehensive platform that integrates secure cryptocurrency payments, efficient order management, and advanced analytics to help you optimize performance, boost sales, and expand your customer base", - url: "https://embermarket.app", siteName: "Ember", locale: "en_GB", type: "website", @@ -51,12 +49,6 @@ export const metadata: Metadata = { }, ], }, - twitter: { - card: "summary_large_image", - title: "Ember Market | E-Commerce Management Platform", - description: "Streamlined e-commerce management with secure cryptocurrency payments", - images: ["/twitter-image.jpg"], - }, } export const viewport: Viewport = { diff --git a/app/page.tsx b/app/page.tsx index 37b81f6..118d60d 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -6,16 +6,13 @@ import { Button } from "@/components/ui/button"; import Link from "next/link"; import { AnimatedStatsSection } from "@/components/animated-stats-section"; -// Force the page to be dynamically rendered export const dynamic = 'force-dynamic'; -// Constants const PY_20 = 20; const PY_32 = 32; const PX_6 = 6; const PX_10 = 10; -// Format number with commas function formatNumberValue(num: number): string { return new Intl.NumberFormat().format(Math.round(num)); } diff --git a/components/3d/ClientStatsWrapper.tsx b/components/3d/ClientStatsWrapper.tsx deleted file mode 100644 index 42bfa5d..0000000 --- a/components/3d/ClientStatsWrapper.tsx +++ /dev/null @@ -1,32 +0,0 @@ -"use client"; - -import { Suspense, useEffect } from 'react'; -import dynamic from 'next/dynamic'; - -// Dynamically import the 3D stats component -const StatsSection = dynamic(() => import('./StatsSection'), { - ssr: false, - loading: () =>
-}); - -export default function ClientStatsWrapper({ stats }: { stats: any }) { - // Debug the stats to see what's being passed - useEffect(() => { - console.log('Stats data received in client component:', stats); - }, [stats]); - - // Apply defaults if stats is undefined - const safeStats = stats || { - totalProducts: 0, - totalVendors: 0, - totalOrders: 0, - totalCustomers: 0, - gmv: 0 - }; - - return ( - }> - - - ); -} \ No newline at end of file diff --git a/components/3d/HeroModel.tsx b/components/3d/HeroModel.tsx deleted file mode 100644 index bcc6818..0000000 --- a/components/3d/HeroModel.tsx +++ /dev/null @@ -1,85 +0,0 @@ -"use client"; - -import React, { useRef } from 'react'; -import { Canvas, useFrame } from '@react-three/fiber'; -import { OrbitControls, PerspectiveCamera, useTexture } from '@react-three/drei'; -import * as THREE from 'three'; - -function RotatingCube() { - const meshRef = useRef(null); - - // Animation loop - useFrame((state, delta) => { - if (meshRef.current) { - meshRef.current.rotation.x += delta * 0.2; - meshRef.current.rotation.y += delta * 0.3; - } - }); - - return ( - - - - - ); -} - -function FloatingGlobe() { - const meshRef = useRef(null); - - useFrame((state, delta) => { - if (meshRef.current) { - meshRef.current.rotation.y += delta * 0.1; - meshRef.current.position.y = Math.sin(state.clock.elapsedTime * 0.5) * 0.2; - } - }); - - return ( - - - - - ); -} - -export default function HeroModel() { - return ( -
- - - - - - - - - - -
- ); -} \ No newline at end of file diff --git a/components/3d/HeroSection.tsx b/components/3d/HeroSection.tsx deleted file mode 100644 index c4c24d4..0000000 --- a/components/3d/HeroSection.tsx +++ /dev/null @@ -1,51 +0,0 @@ -"use client"; - -import dynamic from 'next/dynamic'; -import { Suspense } from 'react'; -import { ArrowRight } from 'lucide-react'; -import Link from 'next/link'; -import { Button } from '@/components/ui/button'; - -// Dynamically import the 3D component to avoid SSR issues -const HeroModel = dynamic(() => import('@/components/3d/HeroModel'), { - ssr: false, - loading: () =>
-
Loading 3D model...
-
-}); - -export default function HeroSection() { - return ( -
-
-

- Streamlined E-commerce Management -

-

- Ember provides everything you need to manage your e-commerce business efficiently in one place, with secure cryptocurrency payments. -

-
- - {/* 3D Model */} -
-
}> - - - - -
- - - - - - -
-
- ); -} \ No newline at end of file diff --git a/components/3d/StatCard.tsx b/components/3d/StatCard.tsx deleted file mode 100644 index aaa8c4e..0000000 --- a/components/3d/StatCard.tsx +++ /dev/null @@ -1,86 +0,0 @@ -"use client"; - -import { useState, useRef } from 'react'; -import { motion, useMotionValue, useSpring, useTransform } from 'framer-motion'; - -interface StatCardProps { - title: string; - value: string; - className?: string; -} - -export default function StatCard({ title, value, className = "" }: StatCardProps) { - const cardRef = useRef(null); - const [isHovered, setIsHovered] = useState(false); - - const x = useMotionValue(0); - const y = useMotionValue(0); - - // Spring animations for smoother movement - const springX = useSpring(x, { stiffness: 150, damping: 20 }); - const springY = useSpring(y, { stiffness: 150, damping: 20 }); - - // Transform mouse movement to rotation values - const rotateXOutput = useTransform(springY, [-0.5, 0.5], ["7deg", "-7deg"]); - const rotateYOutput = useTransform(springX, [-0.5, 0.5], ["-7deg", "7deg"]); - - const handleMouseMove = (e: React.MouseEvent) => { - if (!cardRef.current) return; - - const rect = cardRef.current.getBoundingClientRect(); - - // Calculate mouse position relative to card (0-1) - const mouseX = (e.clientX - rect.left) / rect.width; - const mouseY = (e.clientY - rect.top) / rect.height; - - // Convert to -0.5 to 0.5 range - x.set(mouseX - 0.5); - y.set(mouseY - 0.5); - }; - - const handleMouseEnter = () => { - setIsHovered(true); - }; - - const handleMouseLeave = () => { - // Reset to neutral position when mouse leaves - x.set(0); - y.set(0); - setIsHovered(false); - }; - - return ( - - {/* Ambient light reflection */} -
- - {/* Main content with 3D effect */} -
-

{title}

-

{value}

-
- - {/* Shiny shimmer effect */} -
-
-
- - ); -} \ No newline at end of file diff --git a/components/3d/StatsSection.tsx b/components/3d/StatsSection.tsx deleted file mode 100644 index 6c1890c..0000000 --- a/components/3d/StatsSection.tsx +++ /dev/null @@ -1,108 +0,0 @@ -"use client"; - -import React, { useEffect } from 'react'; -import { motion } from 'framer-motion'; -import StatCard from './StatCard'; - -interface StatsProps { - stats: { - totalProducts?: number; - totalVendors?: number; - totalOrders?: number; - totalCustomers?: number; - gmv?: number; - }; -} - -function formatNumberValue(num: number = 0): string { - return new Intl.NumberFormat().format(Math.round(num)); -} - -function formatCurrencyValue(amount: number = 0): string { - return new Intl.NumberFormat('en-GB', { - style: 'currency', - currency: 'GBP', - maximumFractionDigits: 0 - }).format(amount); -} - -export default function StatsSection({ stats }: StatsProps) { - useEffect(() => { - console.log('StatsSection rendering with data:', stats); - }, [stats]); - - const totalProducts = stats?.totalProducts ?? 243; - const totalVendors = stats?.totalVendors ?? 15; - const totalOrders = stats?.totalOrders ?? 1289; - const totalCustomers = stats?.totalCustomers ?? 756; - const gmv = stats?.gmv ?? 38450; - - // Container animation variants - const containerVariants = { - hidden: { opacity: 0 }, - visible: { - opacity: 1, - transition: { - staggerChildren: 0.1 - } - } - }; - - // Item animation variants - const itemVariants = { - hidden: { y: 20, opacity: 0 }, - visible: { - y: 0, - opacity: 1, - transition: { - type: "spring", - stiffness: 260, - damping: 20 - } - } - }; - - return ( -
- - - - - - - - - - - - - - - - - -
- ); -} \ No newline at end of file diff --git a/components/dashboard/ChatDetail.tsx b/components/dashboard/ChatDetail.tsx index 9b0374c..6484324 100644 --- a/components/dashboard/ChatDetail.tsx +++ b/components/dashboard/ChatDetail.tsx @@ -553,7 +553,7 @@ export default function ChatDetail({ chatId }: { chatId: string }) {

- Chat with Customer {chat.buyerId.slice(-4)} + Chat with Customer {chat.buyerId}

{chat.telegramUsername && ( diff --git a/components/text-typer.tsx b/components/text-typer.tsx deleted file mode 100644 index 329fc46..0000000 --- a/components/text-typer.tsx +++ /dev/null @@ -1,87 +0,0 @@ -"use client"; - -import { useState, useEffect, useRef } from "react"; - -interface TextTyperProps { - text: string; - typingSpeed?: number; - delay?: number; - className?: string; - cursor?: boolean; - onComplete?: () => void; -} - -export function TextTyper({ - text, - typingSpeed = 50, - delay = 0, - className = "", - cursor = true, - onComplete -}: TextTyperProps) { - // Hide component if text is empty - if (!text) return null; - - const [displayedText, setDisplayedText] = useState(""); - const [cursorVisible, setCursorVisible] = useState(true); - const [isComplete, setIsComplete] = useState(false); - const timeoutRef = useRef(null); - const cursorIntervalRef = useRef(null); - - useEffect(() => { - // Clear any previous text - setDisplayedText(""); - setIsComplete(false); - - // Reset typing when text changes - if (timeoutRef.current) { - clearTimeout(timeoutRef.current); - } - - // Start typing after delay - const startTypingTimeout = setTimeout(() => { - let currentIndex = 0; - - const typeNextChar = () => { - if (currentIndex < text.length) { - setDisplayedText(text.substring(0, currentIndex + 1)); - currentIndex++; - timeoutRef.current = setTimeout(typeNextChar, typingSpeed); - } else { - setIsComplete(true); - if (onComplete) { - onComplete(); - } - } - }; - - typeNextChar(); - }, delay); - - // Store the start timeout - timeoutRef.current = startTypingTimeout; - - // Cursor blinking effect - if (cursor) { - cursorIntervalRef.current = setInterval(() => { - setCursorVisible(prev => !prev); - }, 500); - } - - return () => { - if (timeoutRef.current) { - clearTimeout(timeoutRef.current); - } - if (cursorIntervalRef.current) { - clearInterval(cursorIntervalRef.current); - } - }; - }, [text, typingSpeed, delay, cursor, onComplete]); - - return ( - - {displayedText} - {cursor && !isComplete && cursorVisible && |} - - ); -} \ No newline at end of file diff --git a/package.json b/package.json index 1039968..1a6f07d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "my-v0-project", - "version": "1.1.8", - "gitCommit": "1.1.8", + "version": "2.0.0", + "gitCommit": "2.0.0", "private": true, "scripts": { "predev": "node scripts/get-git-hash.js", diff --git a/public/git-info.json b/public/git-info.json index 0654430..f191091 100644 --- a/public/git-info.json +++ b/public/git-info.json @@ -1,4 +1,4 @@ { - "commitHash": "907831d", - "buildTime": "2025-04-10T00:00:11.756Z" + "commitHash": "e338a5d", + "buildTime": "2025-05-17T16:44:15.028Z" } \ No newline at end of file diff --git a/scripts/build-optimized.sh b/scripts/build-optimized.sh deleted file mode 100644 index 0519ecb..0000000 --- a/scripts/build-optimized.sh +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/scripts/find-deprecated-imports.js b/scripts/find-deprecated-imports.js index c02cb85..cf623ca 100644 --- a/scripts/find-deprecated-imports.js +++ b/scripts/find-deprecated-imports.js @@ -17,16 +17,13 @@ const DEPRECATED_PATTERNS = [ "from '@/lib/shippingHelper'", "from '@/lib/storeHelper'", "from '@/lib/stats-service'", - // Add other deprecated import patterns here ]; -// Run grep to find deprecated imports function findDeprecatedImports() { console.log('Searching for deprecated imports...\n'); DEPRECATED_PATTERNS.forEach(pattern => { try { - // Using grep to find the pattern in all TypeScript/JavaScript files const result = execSync(`grep -r "${pattern}" --include="*.ts" --include="*.tsx" --include="*.js" --include="*.jsx" .`, { encoding: 'utf8' }); if (result) { @@ -36,7 +33,6 @@ function findDeprecatedImports() { suggestReplacement(pattern); } } catch (error) { - // grep returns non-zero exit code if no matches found if (error.status !== 1) { console.error(`Error searching for ${pattern}:`, error.message); } @@ -45,14 +41,12 @@ function findDeprecatedImports() { } function suggestReplacement(pattern) { - // Extract the import path const match = pattern.match(/from '([^']+)'/); if (!match) return; const oldPath = match[1]; let replacement = ''; - // Generate replacement suggestions based on deprecated path switch (oldPath) { case '@/lib/client-utils': case '@/lib/client-service': @@ -83,7 +77,4 @@ function suggestReplacement(pattern) { } // Run the search -findDeprecatedImports(); - -// Uncomment the following line to run the remove-old-files.js script -// node scripts/remove-old-files.js \ No newline at end of file +findDeprecatedImports(); \ No newline at end of file