|
| 1 | +'use client'; |
| 2 | + |
| 3 | +import React, { useState, useEffect } from 'react'; |
| 4 | +import { Code2, X } from 'lucide-react'; |
| 5 | +import { |
| 6 | + Dialog, |
| 7 | + DialogContent, |
| 8 | + DialogDescription, |
| 9 | + DialogTitle, |
| 10 | +} from '@/components/ui/dialog'; |
| 11 | + |
| 12 | +const BRAND_COLOR = '#a7f950'; |
| 13 | +const DEV_MODAL_KEY = 'dev-status-modal-dismissed'; |
| 14 | + |
| 15 | +const DevelopmentStatusModal = () => { |
| 16 | + const [isOpen, setIsOpen] = useState(false); |
| 17 | + |
| 18 | + useEffect(() => { |
| 19 | + // Check if user has already dismissed the modal |
| 20 | + try { |
| 21 | + const dismissed = localStorage.getItem(DEV_MODAL_KEY); |
| 22 | + if (!dismissed) { |
| 23 | + // Show modal after a short delay |
| 24 | + const timer = setTimeout(() => { |
| 25 | + setIsOpen(true); |
| 26 | + }, 800); |
| 27 | + return () => clearTimeout(timer); |
| 28 | + } |
| 29 | + } catch { |
| 30 | + // If localStorage fails, show the modal anyway |
| 31 | + setIsOpen(true); |
| 32 | + } |
| 33 | + }, []); |
| 34 | + |
| 35 | + const handleClose = () => { |
| 36 | + try { |
| 37 | + localStorage.setItem(DEV_MODAL_KEY, 'true'); |
| 38 | + } catch { |
| 39 | + // Silently fail if localStorage is not available |
| 40 | + } |
| 41 | + setIsOpen(false); |
| 42 | + }; |
| 43 | + |
| 44 | + return ( |
| 45 | + <Dialog open={isOpen} onOpenChange={setIsOpen}> |
| 46 | + <DialogContent className='max-w-md overflow-hidden border border-zinc-800 bg-zinc-900 p-0 text-white [&>button]:hidden'> |
| 47 | + {/* Header with gradient background */} |
| 48 | + <div |
| 49 | + className='relative px-6 pt-6 pb-4' |
| 50 | + style={{ |
| 51 | + background: `linear-gradient(135deg, ${BRAND_COLOR}15 0%, transparent 100%)`, |
| 52 | + }} |
| 53 | + > |
| 54 | + <div className='absolute top-4 right-4'> |
| 55 | + <button |
| 56 | + onClick={handleClose} |
| 57 | + className='rounded-full p-1 transition-colors hover:bg-zinc-800' |
| 58 | + aria-label='Close modal' |
| 59 | + > |
| 60 | + <X className='h-4 w-4 text-zinc-400' /> |
| 61 | + </button> |
| 62 | + </div> |
| 63 | + |
| 64 | + <div className='flex items-start gap-4'> |
| 65 | + <div |
| 66 | + className='flex h-12 w-12 shrink-0 items-center justify-center rounded-xl' |
| 67 | + style={{ backgroundColor: `${BRAND_COLOR}20` }} |
| 68 | + > |
| 69 | + <Code2 className='h-6 w-6' style={{ color: BRAND_COLOR }} /> |
| 70 | + </div> |
| 71 | + <div className='flex-1 pt-1'> |
| 72 | + <DialogTitle className='mb-2 text-lg font-bold text-white'> |
| 73 | + Boundless is Under Active Development |
| 74 | + </DialogTitle> |
| 75 | + </div> |
| 76 | + </div> |
| 77 | + </div> |
| 78 | + |
| 79 | + {/* Content */} |
| 80 | + <div className='px-6 pb-6'> |
| 81 | + <DialogDescription className='mb-4 text-sm leading-relaxed text-zinc-400'> |
| 82 | + Welcome to Boundless! We're actively building and improving the |
| 83 | + platform. You may encounter: |
| 84 | + </DialogDescription> |
| 85 | + |
| 86 | + <div className='mb-6 space-y-3'> |
| 87 | + <div className='flex items-start gap-3'> |
| 88 | + <div |
| 89 | + className='mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full' |
| 90 | + style={{ backgroundColor: `${BRAND_COLOR}20` }} |
| 91 | + > |
| 92 | + <div |
| 93 | + className='h-2 w-2 rounded-full' |
| 94 | + style={{ backgroundColor: BRAND_COLOR }} |
| 95 | + /> |
| 96 | + </div> |
| 97 | + <p className='text-sm text-zinc-300'> |
| 98 | + New features being rolled out regularly |
| 99 | + </p> |
| 100 | + </div> |
| 101 | + |
| 102 | + <div className='flex items-start gap-3'> |
| 103 | + <div |
| 104 | + className='mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full' |
| 105 | + style={{ backgroundColor: `${BRAND_COLOR}20` }} |
| 106 | + > |
| 107 | + <div |
| 108 | + className='h-2 w-2 rounded-full' |
| 109 | + style={{ backgroundColor: BRAND_COLOR }} |
| 110 | + /> |
| 111 | + </div> |
| 112 | + <p className='text-sm text-zinc-300'> |
| 113 | + Occasional bugs and UI improvements in progress |
| 114 | + </p> |
| 115 | + </div> |
| 116 | + |
| 117 | + <div className='flex items-start gap-3'> |
| 118 | + <div |
| 119 | + className='mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full' |
| 120 | + style={{ backgroundColor: `${BRAND_COLOR}20` }} |
| 121 | + > |
| 122 | + <div |
| 123 | + className='h-2 w-2 rounded-full' |
| 124 | + style={{ backgroundColor: BRAND_COLOR }} |
| 125 | + /> |
| 126 | + </div> |
| 127 | + <p className='text-sm text-zinc-300'> |
| 128 | + Changes to features and functionality |
| 129 | + </p> |
| 130 | + </div> |
| 131 | + </div> |
| 132 | + |
| 133 | + <div className='mb-6 rounded-lg border border-zinc-800 bg-zinc-900/50 p-4'> |
| 134 | + <p className='text-xs leading-relaxed text-zinc-400'> |
| 135 | + <strong className='text-zinc-300'>Your feedback matters!</strong>{' '} |
| 136 | + Help us build the best platform by reporting issues or suggesting |
| 137 | + improvements through our support channels. |
| 138 | + </p> |
| 139 | + </div> |
| 140 | + |
| 141 | + <button |
| 142 | + onClick={handleClose} |
| 143 | + className='w-full rounded-lg px-4 py-2.5 text-sm font-medium transition-colors' |
| 144 | + style={{ |
| 145 | + backgroundColor: BRAND_COLOR, |
| 146 | + color: '#000', |
| 147 | + }} |
| 148 | + onMouseEnter={e => { |
| 149 | + e.currentTarget.style.backgroundColor = '#8ae63a'; |
| 150 | + }} |
| 151 | + onMouseLeave={e => { |
| 152 | + e.currentTarget.style.backgroundColor = BRAND_COLOR; |
| 153 | + }} |
| 154 | + > |
| 155 | + Got it, let's explore! |
| 156 | + </button> |
| 157 | + </div> |
| 158 | + </DialogContent> |
| 159 | + </Dialog> |
| 160 | + ); |
| 161 | +}; |
| 162 | + |
| 163 | +export default DevelopmentStatusModal; |
0 commit comments