mirror of
https://github.com/walkxcode/dashboard-icons.git
synced 2025-11-18 17:47:30 +01:00
refactor(ui): update UI components and navigation
- Improve header, hero, and login modal components - Update command menu functionality - Enhance magic card component
This commit is contained in:
@@ -68,11 +68,7 @@ export function CommandMenu({ icons, open: externalOpen, onOpenChange: externalO
|
||||
|
||||
return (
|
||||
<CommandDialog open={isOpen} onOpenChange={setIsOpen} contentClassName="bg-background/90 backdrop-blur-sm border border-border/60">
|
||||
<CommandInput
|
||||
placeholder={`Search our collection of ${totalIcons} icons by name...`}
|
||||
value={query}
|
||||
onValueChange={setQuery}
|
||||
/>
|
||||
<CommandInput placeholder={`Search our collection of ${totalIcons} icons by name...`} value={query} onValueChange={setQuery} />
|
||||
<CommandList className="max-h-[300px]">
|
||||
{/* Icon Results */}
|
||||
<CommandGroup heading="Icons">
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
import { Github, LayoutDashboard, LogOut, PlusCircle, Search, Star } from "lucide-react"
|
||||
import Link from "next/link"
|
||||
import { useEffect, useState } from "react"
|
||||
import { usePostHog } from "posthog-js/react"
|
||||
import { useEffect, useState } from "react"
|
||||
import { LoginModal } from "@/components/login-modal"
|
||||
import { ThemeSwitcher } from "@/components/theme-switcher"
|
||||
import { REPO_NAME, REPO_PATH } from "@/constants"
|
||||
@@ -185,13 +185,21 @@ export function Header() {
|
||||
|
||||
<div className="hidden md:flex items-center gap-2 md:gap-4">
|
||||
{isLoggedIn ? (
|
||||
<Button variant="outline" className="hidden md:inline-flex cursor-pointer transition-all duration-300 items-center gap-2" asChild>
|
||||
<Button
|
||||
variant="outline"
|
||||
className="hidden md:inline-flex cursor-pointer transition-all duration-300 items-center gap-2"
|
||||
asChild
|
||||
>
|
||||
<Link href="/submit">
|
||||
<PlusCircle className="h-4 w-4 transition-all duration-300" /> Submit icon(s)
|
||||
</Link>
|
||||
</Button>
|
||||
) : (
|
||||
<Button variant="outline" className="hidden md:inline-flex cursor-pointer transition-all duration-300 items-center gap-2" onClick={handleSubmitClick}>
|
||||
<Button
|
||||
variant="outline"
|
||||
className="hidden md:inline-flex cursor-pointer transition-all duration-300 items-center gap-2"
|
||||
onClick={handleSubmitClick}
|
||||
>
|
||||
<PlusCircle className="h-4 w-4 transition-all duration-300" /> Submit icon(s)
|
||||
</Button>
|
||||
)}
|
||||
|
||||
@@ -114,7 +114,7 @@ function ElegantShape({
|
||||
y: [0, 15, 0],
|
||||
}}
|
||||
transition={{
|
||||
duration: 8 + Math.random() * 4, // Random duration between 8-12s for varied movement
|
||||
duration: 8,
|
||||
repeat: Number.POSITIVE_INFINITY,
|
||||
ease: "easeInOut",
|
||||
repeatType: "reverse",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
"use client"
|
||||
|
||||
import { Github, Loader2 } from "lucide-react"
|
||||
import { usePostHog } from "posthog-js/react"
|
||||
import type React from "react"
|
||||
import { useRef, useState } from "react"
|
||||
import { usePostHog } from "posthog-js/react"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@/components/ui/dialog"
|
||||
import { Input } from "@/components/ui/input"
|
||||
@@ -110,14 +110,9 @@ export function LoginModal({ open, onOpenChange }: LoginModalProps) {
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="w-full max-w-lg bg-background border shadow-2xl">
|
||||
<DialogHeader className="text-center space-y-2 pb-4">
|
||||
<DialogTitle className="text-3xl font-bold">
|
||||
{isRegister ? "Create Account" : "Welcome Back"}
|
||||
</DialogTitle>
|
||||
<DialogTitle className="text-3xl font-bold">{isRegister ? "Create Account" : "Welcome Back"}</DialogTitle>
|
||||
<DialogDescription className="text-lg text-muted-foreground">
|
||||
{isRegister
|
||||
? "Join our community and start submitting icons"
|
||||
: "Sign in to submit and manage your icons"
|
||||
}
|
||||
{isRegister ? "Join our community and start submitting icons" : "Sign in to submit and manage your icons"}
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
|
||||
@@ -137,12 +132,7 @@ export function LoginModal({ open, onOpenChange }: LoginModalProps) {
|
||||
)}
|
||||
|
||||
{/* GitHub Button (Coming Soon) */}
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
className="w-full h-12 text-base font-medium cursor-not-allowed opacity-50"
|
||||
disabled
|
||||
>
|
||||
<Button type="button" variant="outline" className="w-full h-12 text-base font-medium cursor-not-allowed opacity-50" disabled>
|
||||
<Github className="h-5 w-5 mr-2" />
|
||||
Continue with GitHub
|
||||
<span className="ml-2 text-xs text-muted-foreground">(Coming soon)</span>
|
||||
@@ -176,9 +166,7 @@ export function LoginModal({ open, onOpenChange }: LoginModalProps) {
|
||||
required
|
||||
/>
|
||||
{isRegister && (
|
||||
<p className="text-xs text-muted-foreground">
|
||||
We'll only use this to send you updates about your submissions
|
||||
</p>
|
||||
<p className="text-xs text-muted-foreground">We'll only use this to send you updates about your submissions</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -198,9 +186,7 @@ export function LoginModal({ open, onOpenChange }: LoginModalProps) {
|
||||
className="h-12 text-base"
|
||||
required
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
This will be displayed publicly with your submissions
|
||||
</p>
|
||||
<p className="text-xs text-muted-foreground">This will be displayed publicly with your submissions</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -242,11 +228,7 @@ export function LoginModal({ open, onOpenChange }: LoginModalProps) {
|
||||
</div>
|
||||
|
||||
{/* Submit Button */}
|
||||
<Button
|
||||
type="submit"
|
||||
className="w-full h-12 text-base font-semibold"
|
||||
disabled={isLoading}
|
||||
>
|
||||
<Button type="submit" className="w-full h-12 text-base font-semibold" disabled={isLoading}>
|
||||
{isLoading ? (
|
||||
<>
|
||||
<Loader2 className="h-5 w-5 mr-2 animate-spin" />
|
||||
@@ -264,10 +246,7 @@ export function LoginModal({ open, onOpenChange }: LoginModalProps) {
|
||||
onClick={toggleMode}
|
||||
className="text-sm text-muted-foreground hover:text-foreground transition-colors font-medium hover:underline underline-offset-4"
|
||||
>
|
||||
{isRegister
|
||||
? "Already have an account? Sign in"
|
||||
: "Don't have an account? Create one"
|
||||
}
|
||||
{isRegister ? "Already have an account? Sign in" : "Don't have an account? Create one"}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
"use client"
|
||||
|
||||
import { motion, useMotionTemplate, useMotionValue } from "motion/react"
|
||||
import { useTheme } from "next-themes"
|
||||
import type React from "react"
|
||||
import { useCallback, useEffect, useRef, useState } from "react"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
import { useTheme } from "next-themes"
|
||||
|
||||
interface MagicCardProps {
|
||||
children?: React.ReactNode
|
||||
@@ -30,7 +29,6 @@ export function MagicCard({
|
||||
const mouseX = useMotionValue(-gradientSize)
|
||||
const mouseY = useMotionValue(-gradientSize)
|
||||
|
||||
|
||||
const handleMouseMove = useCallback(
|
||||
(e: MouseEvent) => {
|
||||
if (cardRef.current) {
|
||||
@@ -85,10 +83,10 @@ export function MagicCard({
|
||||
|
||||
useEffect(() => {
|
||||
if (theme === "dark") {
|
||||
setFromColor("#ffb3c1") // fallback for dark
|
||||
setFromColor("#ffb3c1") // fallback for dark
|
||||
setToColor("#ff75a0")
|
||||
} else {
|
||||
setFromColor("#1e9df1") // fallback for light
|
||||
setFromColor("#1e9df1") // fallback for light
|
||||
setToColor("#8ed0f9")
|
||||
}
|
||||
}, [theme])
|
||||
|
||||
Reference in New Issue
Block a user