Skip to content

Commit 4368a21

Browse files
authored
Adjust Loading Background Speed (#76)
1 parent 46d5110 commit 4368a21

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

packages/nextjs/components/RandomLoadingBackground.tsx

+16-3
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,41 @@ const ADDRESSES = [
1010
"0xa63Bfd6492Ed2098e417fe2A7dE30d39d9CbC102",
1111
"0xb5C23229fB8462c1658F40d97a11D94feB57e223",
1212
"0x9E9be8440794f28Ac08e13ec290B688520a5D824",
13+
"0xf1eBd160b9751632DfFB647d871685885ABDe22D",
14+
"0xBF791a193565F80276D26962A25b429043aE6253",
15+
"0xA55bBD4Ddf0C03C53c3F3b6964328c996F0f893d",
16+
"0xE3F3Acda31De82C4bC3d3070F519906bDFc497e4",
1317
];
1418

1519
export const RandomLoadingBackground = ({ isLoading = false }: { isLoading: boolean }) => {
1620
const [count, setCount] = useState(0);
21+
const [time, setTime] = useState(150);
1722

1823
useEffect(() => {
1924
// When there is a loading state, cycle through the ADDRESSES above
2025
// to mimic a burner wallet being generated.
2126
const interval = setInterval(() => {
2227
if (isLoading) {
23-
if (count === 3) {
28+
if (count === 7) {
2429
setCount(0);
2530
return;
2631
}
2732

33+
if (count === 2) {
34+
setTime(350);
35+
}
36+
37+
if (count === 4) {
38+
setTime(600);
39+
}
40+
2841
setCount(count + 1);
2942
}
30-
}, 500);
43+
}, time);
3144

3245
// Clear the interval
3346
return () => clearInterval(interval);
34-
}, [count, isLoading]);
47+
}, [count, isLoading, time]);
3548

3649
const address = ADDRESSES[count];
3750

0 commit comments

Comments
 (0)