Skip to content

Commit dee9f33

Browse files
Merge pull request #59 from chauhan-varun/fix/loading
Enhance Loading State UI with Visual Loader
2 parents 5b2eb52 + 977cb39 commit dee9f33

File tree

18 files changed

+9511
-208
lines changed

18 files changed

+9511
-208
lines changed

client/pnpm-lock.yaml

Lines changed: 8737 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/src/App.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import { TooltipProvider } from '@radix-ui/react-tooltip'
44
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
55
import { BrowserRouter, Routes, Route } from 'react-router-dom'
66
import { useAuthState } from '@/hooks/useAuth'
7-
import { lazy, Suspense, useEffect } from 'react'
7+
import { PageLoader } from '@/components/ui/spinner'
88
import { registerUserForNotifications } from '@/socket'
9+
import { Suspense, useEffect, lazy } from 'react'
910

1011
import ScrollToTop from './components/ScrollToTop'
1112
import Navbar from '@/components/Navbar'
@@ -54,9 +55,7 @@ const App = () => {
5455
<div className='min-h-screen flex flex-col'>
5556
<Suspense
5657
fallback={
57-
<div className='flex min-h-screen w-full justify-center items-center'>
58-
Loading...
59-
</div>
58+
<PageLoader message="Loading..." variant="faded" />
6059
}
6160
>
6261
<ScrollToTop />

client/src/artifacts/contracts/Escrow.sol/Escrow.json

Lines changed: 98 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,81 @@
1616
},
1717
{
1818
"inputs": [],
19-
"name": "amount",
19+
"name": "Escrow__EtherTransferFailed",
20+
"type": "error"
21+
},
22+
{
23+
"inputs": [],
24+
"name": "Escrow__FundsAlreadyReleased",
25+
"type": "error"
26+
},
27+
{
28+
"inputs": [],
29+
"name": "Escrow__InsufficientBalance",
30+
"type": "error"
31+
},
32+
{
33+
"inputs": [],
34+
"name": "Escrow__InvalidFreelancerAddress",
35+
"type": "error"
36+
},
37+
{
38+
"inputs": [],
39+
"name": "Escrow__NoEtherSent",
40+
"type": "error"
41+
},
42+
{
43+
"inputs": [],
44+
"name": "Escrow__NotClient",
45+
"type": "error"
46+
},
47+
{
48+
"anonymous": false,
49+
"inputs": [
50+
{
51+
"indexed": true,
52+
"internalType": "address",
53+
"name": "client",
54+
"type": "address"
55+
},
56+
{
57+
"indexed": true,
58+
"internalType": "address",
59+
"name": "freelancer",
60+
"type": "address"
61+
},
62+
{
63+
"indexed": false,
64+
"internalType": "uint256",
65+
"name": "amount",
66+
"type": "uint256"
67+
}
68+
],
69+
"name": "FundsDeposited",
70+
"type": "event"
71+
},
72+
{
73+
"anonymous": false,
74+
"inputs": [
75+
{
76+
"indexed": true,
77+
"internalType": "address",
78+
"name": "freelancer",
79+
"type": "address"
80+
},
81+
{
82+
"indexed": false,
83+
"internalType": "uint256",
84+
"name": "amount",
85+
"type": "uint256"
86+
}
87+
],
88+
"name": "FundsReleased",
89+
"type": "event"
90+
},
91+
{
92+
"inputs": [],
93+
"name": "getBalance",
2094
"outputs": [
2195
{
2296
"internalType": "uint256",
@@ -29,20 +103,20 @@
29103
},
30104
{
31105
"inputs": [],
32-
"name": "client",
106+
"name": "i_amount",
33107
"outputs": [
34108
{
35-
"internalType": "address",
109+
"internalType": "uint256",
36110
"name": "",
37-
"type": "address"
111+
"type": "uint256"
38112
}
39113
],
40114
"stateMutability": "view",
41115
"type": "function"
42116
},
43117
{
44118
"inputs": [],
45-
"name": "freelancer",
119+
"name": "i_client",
46120
"outputs": [
47121
{
48122
"internalType": "address",
@@ -55,12 +129,12 @@
55129
},
56130
{
57131
"inputs": [],
58-
"name": "isComplete",
132+
"name": "i_freelancer",
59133
"outputs": [
60134
{
61-
"internalType": "bool",
135+
"internalType": "address",
62136
"name": "",
63-
"type": "bool"
137+
"type": "address"
64138
}
65139
],
66140
"stateMutability": "view",
@@ -72,10 +146,23 @@
72146
"outputs": [],
73147
"stateMutability": "nonpayable",
74148
"type": "function"
149+
},
150+
{
151+
"inputs": [],
152+
"name": "s_isComplete",
153+
"outputs": [
154+
{
155+
"internalType": "bool",
156+
"name": "",
157+
"type": "bool"
158+
}
159+
],
160+
"stateMutability": "view",
161+
"type": "function"
75162
}
76163
],
77-
"bytecode": "0x60806040526040516105f93803806105f983398181016040528101906100259190610131565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550346002819055506000600360006101000a81548160ff0219169083151502179055505061015e565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100fe826100d3565b9050919050565b61010e816100f3565b811461011957600080fd5b50565b60008151905061012b81610105565b92915050565b600060208284031215610147576101466100ce565b5b60006101558482850161011c565b91505092915050565b61048c8061016d6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063109e94cf1461005c57806369d895751461007a578063a37dda2c14610084578063aa8c217c146100a2578063b2fa1c9e146100c0575b600080fd5b6100646100de565b60405161007191906102e8565b60405180910390f35b610082610102565b005b61008c610268565b60405161009991906102e8565b60405180910390f35b6100aa61028e565b6040516100b7919061031c565b60405180910390f35b6100c8610294565b6040516100d59190610352565b60405180910390f35b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610190576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610187906103ca565b60405180910390fd5b600360009054906101000a900460ff16156101e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101d790610436565b60405180910390fd5b6001600360006101000a81548160ff021916908315150217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6002549081150290604051600060405180830381858888f19350505050158015610265573d6000803e3d6000fd5b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b600360009054906101000a900460ff1681565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006102d2826102a7565b9050919050565b6102e2816102c7565b82525050565b60006020820190506102fd60008301846102d9565b92915050565b6000819050919050565b61031681610303565b82525050565b6000602082019050610331600083018461030d565b92915050565b60008115159050919050565b61034c81610337565b82525050565b60006020820190506103676000830184610343565b92915050565b600082825260208201905092915050565b7f4f6e6c7920636c69656e742063616e2072656c656173652066756e6473000000600082015250565b60006103b4601d8361036d565b91506103bf8261037e565b602082019050919050565b600060208201905081810360008301526103e3816103a7565b9050919050565b7f416c72656164792072656c656173656400000000000000000000000000000000600082015250565b600061042060108361036d565b915061042b826103ea565b602082019050919050565b6000602082019050818103600083015261044f81610413565b905091905056fea26469706673582212204e2fb19e0ce9aac189103b7d59da4410193ff21cdd9778435cc462cf3e12f16264736f6c634300081c0033",
78-
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c8063109e94cf1461005c57806369d895751461007a578063a37dda2c14610084578063aa8c217c146100a2578063b2fa1c9e146100c0575b600080fd5b6100646100de565b60405161007191906102e8565b60405180910390f35b610082610102565b005b61008c610268565b60405161009991906102e8565b60405180910390f35b6100aa61028e565b6040516100b7919061031c565b60405180910390f35b6100c8610294565b6040516100d59190610352565b60405180910390f35b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610190576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610187906103ca565b60405180910390fd5b600360009054906101000a900460ff16156101e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101d790610436565b60405180910390fd5b6001600360006101000a81548160ff021916908315150217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6002549081150290604051600060405180830381858888f19350505050158015610265573d6000803e3d6000fd5b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b600360009054906101000a900460ff1681565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006102d2826102a7565b9050919050565b6102e2816102c7565b82525050565b60006020820190506102fd60008301846102d9565b92915050565b6000819050919050565b61031681610303565b82525050565b6000602082019050610331600083018461030d565b92915050565b60008115159050919050565b61034c81610337565b82525050565b60006020820190506103676000830184610343565b92915050565b600082825260208201905092915050565b7f4f6e6c7920636c69656e742063616e2072656c656173652066756e6473000000600082015250565b60006103b4601d8361036d565b91506103bf8261037e565b602082019050919050565b600060208201905081810360008301526103e3816103a7565b9050919050565b7f416c72656164792072656c656173656400000000000000000000000000000000600082015250565b600061042060108361036d565b915061042b826103ea565b602082019050919050565b6000602082019050818103600083015261044f81610413565b905091905056fea26469706673582212204e2fb19e0ce9aac189103b7d59da4410193ff21cdd9778435cc462cf3e12f16264736f6c634300081c0033",
164+
"bytecode": "0x60e06040526040516108573803806108578339818101604052810190610025919061021d565b6000341161005f576040517f8995622d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036100c5576040517f1f8d813d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508073ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff16815250503460c0818152505060008060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167ff0d0e99cae184d0187b093b48894117462462379674a6e11d89c3fbb618e96b0346040516101ac9190610263565b60405180910390a35061027e565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006101ea826101bf565b9050919050565b6101fa816101df565b811461020557600080fd5b50565b600081519050610217816101f1565b92915050565b600060208284031215610233576102326101ba565b5b600061024184828501610208565b91505092915050565b6000819050919050565b61025d8161024a565b82525050565b60006020820190506102786000830184610254565b92915050565b60805160a05160c0516105806102d7600039600081816101090152818161025801528181610305015261040701526000818161012d015281816102ce01526103af015260008181610159015261018e01526105806000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806301619d3d1461006757806311a5ab691461008557806312065fe0146100a3578063313b9204146100c15780633888e836146100df57806369d89575146100fd575b600080fd5b61006f610107565b60405161007c9190610457565b60405180910390f35b61008d61012b565b60405161009a91906104b3565b60405180910390f35b6100ab61014f565b6040516100b89190610457565b60405180910390f35b6100c9610157565b6040516100d691906104b3565b60405180910390f35b6100e761017b565b6040516100f491906104e9565b60405180910390f35b61010561018c565b005b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b600047905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b60008054906101000a900460ff1681565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610211576040517f469a509500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008054906101000a900460ff1615610256576040517f3f0096e300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000004710156102b0576040517f4b71d25500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60016000806101000a81548160ff02191690831515021790555060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000060405161033090610535565b60006040518083038185875af1925050503d806000811461036d576040519150601f19603f3d011682016040523d82523d6000602084013e610372565b606091505b50509050806103ad576040517ffddc092300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f221c08a06b07a64803b3787861a3f276212fcccb51c2e6234077a9b8cb13047a7f00000000000000000000000000000000000000000000000000000000000000006040516104339190610457565b60405180910390a250565b6000819050919050565b6104518161043e565b82525050565b600060208201905061046c6000830184610448565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061049d82610472565b9050919050565b6104ad81610492565b82525050565b60006020820190506104c860008301846104a4565b92915050565b60008115159050919050565b6104e3816104ce565b82525050565b60006020820190506104fe60008301846104da565b92915050565b600081905092915050565b50565b600061051f600083610504565b915061052a8261050f565b600082019050919050565b600061054082610512565b915081905091905056fea2646970667358221220a1e332674672cbd8d02b0dd1b137e66f8312adcc6a038d777d9754802c8be0a464736f6c634300081c0033",
165+
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c806301619d3d1461006757806311a5ab691461008557806312065fe0146100a3578063313b9204146100c15780633888e836146100df57806369d89575146100fd575b600080fd5b61006f610107565b60405161007c9190610457565b60405180910390f35b61008d61012b565b60405161009a91906104b3565b60405180910390f35b6100ab61014f565b6040516100b89190610457565b60405180910390f35b6100c9610157565b6040516100d691906104b3565b60405180910390f35b6100e761017b565b6040516100f491906104e9565b60405180910390f35b61010561018c565b005b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b600047905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b60008054906101000a900460ff1681565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610211576040517f469a509500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008054906101000a900460ff1615610256576040517f3f0096e300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000004710156102b0576040517f4b71d25500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60016000806101000a81548160ff02191690831515021790555060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000060405161033090610535565b60006040518083038185875af1925050503d806000811461036d576040519150601f19603f3d011682016040523d82523d6000602084013e610372565b606091505b50509050806103ad576040517ffddc092300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f221c08a06b07a64803b3787861a3f276212fcccb51c2e6234077a9b8cb13047a7f00000000000000000000000000000000000000000000000000000000000000006040516104339190610457565b60405180910390a250565b6000819050919050565b6104518161043e565b82525050565b600060208201905061046c6000830184610448565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061049d82610472565b9050919050565b6104ad81610492565b82525050565b60006020820190506104c860008301846104a4565b92915050565b60008115159050919050565b6104e3816104ce565b82525050565b60006020820190506104fe60008301846104da565b92915050565b600081905092915050565b50565b600061051f600083610504565b915061052a8261050f565b600082019050919050565b600061054082610512565b915081905091905056fea2646970667358221220a1e332674672cbd8d02b0dd1b137e66f8312adcc6a038d777d9754802c8be0a464736f6c634300081c0033",
79166
"linkReferences": {},
80167
"deployedLinkReferences": {}
81-
}
168+
}

client/src/components/GlobalSearch.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { Button } from "@/components/ui/button";
44
import { Card, CardContent } from "@/components/ui/card";
55
import { Badge } from "@/components/ui/badge";
66
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
7+
import { Spinner } from '@/components/ui/spinner';
8+
import { LoadingSpinner } from '@/components/ui/spinner';
79
import {
810
Search,
911
Users,
@@ -198,21 +200,22 @@ const GlobalSearch: React.FC<GlobalSearchProps> = ({ isOpen, onClose }) => {
198200
<div className="max-h-96 overflow-y-auto">
199201
{isLoading ? (
200202
<div className="p-8 text-center">
201-
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto"></div>
202-
<p className="text-sm text-muted-foreground mt-2">
203-
Searching...
204-
</p>
203+
<div className="flex flex-col items-center space-y-3">
204+
<Spinner variant="faded" size="md" />
205+
<p className="text-sm text-foreground">
206+
Searching...
207+
</p>
208+
</div>
205209
</div>
206210
) : results.length > 0 ? (
207211
<div className="py-2">
208212
{results.map((result, index) => (
209213
<div
210214
key={result.id}
211-
className={`px-4 py-3 cursor-pointer transition-colors flex items-center gap-3 ${
212-
selectedIndex === index
215+
className={`px-4 py-3 cursor-pointer transition-colors flex items-center gap-3 ${selectedIndex === index
213216
? "bg-gray-100"
214217
: "hover:bg-gray-50"
215-
}`}
218+
}`}
216219
onClick={() => handleResultClick(result)}
217220
>
218221
<div className="flex-shrink-0">

client/src/components/LoadingStates.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import React from 'react';
33
import { Card, CardContent, CardHeader } from '@/components/ui/card';
44
import { Skeleton } from '@/components/ui/skeleton';
5+
import { PageLoader, InlineLoader } from '@/components/ui/spinner';
56

67
export const GigCardSkeleton: React.FC = () => (
78
<Card className="animate-pulse">
@@ -103,16 +104,8 @@ export const DashboardSkeleton: React.FC = () => (
103104
</div>
104105
);
105106

106-
export const PageLoadingSpinner: React.FC<{ message?: string }> = ({
107-
message = "Loading..."
107+
export const PageLoadingSpinner: React.FC<{ message?: string }> = ({
108+
message = "Loading..."
108109
}) => (
109-
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-purple-50 via-blue-50 to-cyan-50">
110-
<div className="text-center">
111-
<div className="relative">
112-
<div className="animate-spin rounded-full h-16 w-16 border-4 border-primary/20 border-t-primary mx-auto"></div>
113-
<div className="animate-ping absolute inset-0 rounded-full h-16 w-16 border-4 border-primary/10"></div>
114-
</div>
115-
<p className="text-muted-foreground mt-4 font-medium">{message}</p>
116-
</div>
117-
</div>
110+
<PageLoader message={message} variant="faded" />
118111
);

0 commit comments

Comments
 (0)