|
1 | 1 | 'use client'; |
2 | | - |
3 | 2 | import { useState } from 'react'; |
4 | | -import LaunchCampaignFlow from '@/components/project/LaunchCampaignFlow'; |
5 | | -import BoundlessSheet from '@/components/sheet/boundless-sheet'; |
6 | | -import { Button } from '@/components/ui/button'; |
7 | | -import { Rocket } from 'lucide-react'; |
8 | | -import { useWalletProtection } from '@/hooks/use-wallet-protection'; |
9 | | -import WalletRequiredModal from '@/components/wallet/WalletRequiredModal'; |
10 | | - |
11 | | -export default function TestPage() { |
12 | | - const [showLaunchFlow, setShowLaunchFlow] = useState(false); |
13 | | - |
14 | | - // Wallet protection hook |
15 | | - const { |
16 | | - requireWallet, |
17 | | - showWalletModal, |
18 | | - handleWalletConnected, |
19 | | - closeWalletModal, |
20 | | - } = useWalletProtection({ |
21 | | - actionName: 'test launch campaign', |
22 | | - }); |
23 | | - |
24 | | - const handleOpenModal = () => { |
25 | | - requireWallet(() => setShowLaunchFlow(true)); |
26 | | - }; |
27 | | - |
28 | | - const handleCloseModal = () => { |
29 | | - setShowLaunchFlow(false); |
| 3 | +import AuthLoadingState from '@/components/auth/AuthLoadingState'; |
| 4 | +import { BoundlessButton } from '@/components/buttons'; |
| 5 | + |
| 6 | +export default function TestLoadingPage() { |
| 7 | + const [showLoading, setShowLoading] = useState(false); |
| 8 | + |
| 9 | + const handleShowLoading = () => { |
| 10 | + setShowLoading(true); |
| 11 | + // Simulate loading for 3 seconds |
| 12 | + setTimeout(() => { |
| 13 | + setShowLoading(false); |
| 14 | + }, 3000); |
30 | 15 | }; |
31 | 16 |
|
32 | 17 | return ( |
33 | | - <div className='flex min-h-screen items-center justify-center bg-gray-900'> |
34 | | - <div className='space-y-6 text-center'> |
35 | | - <h1 className='mb-8 text-4xl font-bold text-white'> |
36 | | - Launch Campaign Test |
37 | | - </h1> |
38 | | - |
39 | | - <p className='mb-8 text-gray-300'> |
40 | | - Click the button below to test the Launch Campaign feature |
| 18 | + <div className='flex min-h-screen items-center justify-center bg-gray-900 p-4'> |
| 19 | + <div className='space-y-4 text-center'> |
| 20 | + <h1 className='text-2xl font-bold text-white'>Loading State Test</h1> |
| 21 | + <p className='text-gray-300'> |
| 22 | + Test the animated loading state across different screen sizes |
41 | 23 | </p> |
42 | 24 |
|
43 | | - <Button |
44 | | - onClick={handleOpenModal} |
45 | | - size='lg' |
46 | | - className='bg-green-600 px-8 py-4 text-lg text-white hover:bg-green-700' |
47 | | - > |
48 | | - <Rocket className='mr-2 h-6 w-6' /> |
49 | | - Test Launch Campaign |
50 | | - </Button> |
| 25 | + <BoundlessButton onClick={handleShowLoading} className='mt-4'> |
| 26 | + Test Loading State |
| 27 | + </BoundlessButton> |
51 | 28 |
|
52 | | - {/* Debug info */} |
53 | | - <div className='text-sm text-white'> |
54 | | - Modal state: {showLaunchFlow ? 'Open' : 'Closed'} |
55 | | - </div> |
| 29 | + {showLoading && <AuthLoadingState message='Testing loading...' />} |
56 | 30 |
|
57 | | - {/* Launch Campaign Flow Modal */} |
58 | | - <BoundlessSheet |
59 | | - open={showLaunchFlow} |
60 | | - setOpen={handleCloseModal} |
61 | | - contentClassName='h-full' |
62 | | - title='Review Campaign' |
63 | | - > |
64 | | - <LaunchCampaignFlow |
65 | | - projectId='test-project-123' |
66 | | - onBack={handleCloseModal} |
67 | | - onComplete={handleCloseModal} |
68 | | - /> |
69 | | - </BoundlessSheet> |
70 | | - |
71 | | - {/* Wallet Required Modal */} |
72 | | - <WalletRequiredModal |
73 | | - open={showWalletModal} |
74 | | - onOpenChange={closeWalletModal} |
75 | | - actionName='test launch campaign' |
76 | | - onWalletConnected={handleWalletConnected} |
77 | | - /> |
| 31 | + <div className='mt-8 text-sm text-gray-400'> |
| 32 | + <p>Test on different screen sizes:</p> |
| 33 | + <ul className='mt-2 list-inside list-disc space-y-1'> |
| 34 | + <li>Mobile (320px - 768px)</li> |
| 35 | + <li>Tablet (768px - 1024px)</li> |
| 36 | + <li>Desktop (1024px+)</li> |
| 37 | + </ul> |
| 38 | + </div> |
78 | 39 | </div> |
79 | 40 | </div> |
80 | 41 | ); |
|
0 commit comments