Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Good project #3

Open
wants to merge 913 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
913 commits
Select commit Hold shift + click to select a range
e9c8698
Update extraRpcs.js (#1142)
cosminbware Jun 12, 2024
996be79
add default iota evm rpc
realdealshaman Jun 12, 2024
8de72ca
Update extraRpcs.js (#1139)
Danielvul Jun 12, 2024
ff6f40e
Proposal to add GLC rpc's (#1131)
Srikarrao1 Jun 12, 2024
56a8ee5
remove referer urls
0xngmi Jun 12, 2024
8303356
remove spam rpcs
realdealshaman Jun 12, 2024
e7dbff9
use a working rpc for default
realdealshaman Jun 12, 2024
4181a90
Add nal testnet (#1147)
luleigreat Jun 12, 2024
ff19524
new pages to add network to metamask
mintdart Jun 12, 2024
e2d8bba
add lavabuild as default evmos rpc
realdealshaman Jun 12, 2024
7b91245
Update extraRpcs.js - Adding Blast API in IOTA testnet (#1156)
cosminbware Jun 13, 2024
dae031e
update sitemap
mintdart Jun 13, 2024
408b17f
Update extraRpcs.js (#1141)
4everlandorg Jun 13, 2024
65db39f
fix new entries
realdealshaman Jun 13, 2024
127fab8
Update extraRpcs.js (#1158)
4everlandorg Jun 15, 2024
c9fc690
fix syntax
realdealshaman Jun 15, 2024
d0d7522
add sanko
realdealshaman Jun 17, 2024
99efbd2
Update extraRpcs.js (#1168)
DRIgnazGortngschirl Jun 24, 2024
c733a24
update tracking details
realdealshaman Jun 24, 2024
0826b94
Update extraRpcs.js (#1165)
s4njk4n Jun 24, 2024
62874c3
feat: 🎸 Added bArtio testnet RPC (#1164)
codingwithmanny Jun 24, 2024
632a52f
Add RadiumBlock public wss endpoints for Ethereum, Astar/Shiden and M…
radiumb Jun 24, 2024
ef52e09
Added the etherlink mainnet endpoint and removed the etherlink ghosht…
AmardeepSambaru Jun 24, 2024
f9dda03
Update extraRpcs.js (#1161)
4everlandorg Jun 24, 2024
740fb9c
rpc endpoint added (#1159)
Himanityagi27 Jun 24, 2024
da19564
fix syntax
realdealshaman Jun 24, 2024
2f76296
Add Etherlink Network (#1174)
tachyswap Jun 27, 2024
84afec0
Update faucet link for RoninChain (#1172)
huyngopt1994 Jun 27, 2024
4cf4597
Update extraRpcs.js (#1166)
nucash-mining Jun 27, 2024
f25c86e
format
realdealshaman Jun 27, 2024
da9ab65
Update extraRpcs.js (#1178)
AM-979 Jun 28, 2024
2ae63ea
add enuls
realdealshaman Jul 2, 2024
cee8180
Kaia testnet kairos RPC update (#1189)
eseongmoo Jul 8, 2024
6b09ebf
Updated Testnet endpoint and allthatnode urls (#1182)
praveen-kaia Jul 8, 2024
c9423e7
Update extraRpcs.js (#1181)
maradeeym Jul 8, 2024
c50984b
Add PLYR PHI mainnet (#1180)
iamcryptofennec Jul 8, 2024
3512631
fix syntax
realdealshaman Jul 8, 2024
18e06ce
ZetaChain: update RPCs (#1190)
fadeev Jul 9, 2024
3beea93
added Onchain Points Mainnet (#1193)
SwaroopH Jul 11, 2024
1c83c95
remove chain not yet listed on defillama
realdealshaman Jul 11, 2024
04f4292
add privacy policy statement
realdealshaman Jul 11, 2024
53011bb
Add nal mainnet (#1192)
luleigreat Jul 11, 2024
fa8c3e3
add privacy statement
realdealshaman Jul 11, 2024
b3b4055
Add PORTERS Taiko Mainnet public rpc endpoint (#1194)
scermat Jul 15, 2024
a7e34c3
Update Ronin (2020) RPCs (#1204)
dwi Jul 17, 2024
baa8c0d
Update extraRpcs.js (#1201)
ecroxchain Jul 17, 2024
b17e355
🎸 Added Dojima Mainnet and Testnet RPC (#1199)
Mystical94 Jul 17, 2024
0956872
Remove Project Pi PulseChain RPC (#1206)
VandaleCallender Jul 19, 2024
d9994a4
adds Mande rpc (#1157)
prtk418 Jul 19, 2024
573fdb7
add blast logo
realdealshaman Jul 22, 2024
b0022c4
add saakuru
realdealshaman Jul 22, 2024
fd694ed
Tatum RPC Node Changes (#1208)
blockchaingirl1407 Jul 25, 2024
8dcc3f0
Update extraRpcs.js (#1209)
maradeeym Jul 26, 2024
183a067
Just removing our RPCs before we deactivate the servers. Thanks (#1212)
s4njk4n Jul 29, 2024
e0718ba
Update extraRpcs.js (#1210)
maradeeym Jul 29, 2024
a741c9c
add more rpcs
realdealshaman Jul 29, 2024
3853be4
add more chains
realdealshaman Jul 29, 2024
5cf24bd
remove duplicates
realdealshaman Jul 30, 2024
1f5011c
update rpc for jibchain (#1214)
nanthanwa Jul 31, 2024
d282c42
Update extraRpcs.js (#1213)
0xGraffiti Jul 31, 2024
12e74b8
added Zircuit RPC endpoints (#1216)
kbak Jul 31, 2024
2aafed2
update rpc order
realdealshaman Jul 31, 2024
d319d51
Add SX L2 Rollup Mainnet & Toronto RPC (#1217)
akshar Aug 2, 2024
aae3a8e
fix new entry
realdealshaman Aug 2, 2024
3b60c9a
Update extraRpcs.js (#1219)
alxnode Aug 4, 2024
e306337
add network
realdealshaman Aug 6, 2024
c30fcf2
add chain
realdealshaman Aug 6, 2024
5b3a2a1
update chain name
realdealshaman Aug 6, 2024
8f0a8ce
add more chains
realdealshaman Aug 6, 2024
95017b5
update chain name
realdealshaman Aug 6, 2024
e8599b9
fix chain names
realdealshaman Aug 6, 2024
4aba0d7
fix zksync era
realdealshaman Aug 6, 2024
d08d2c3
fix immutable zkevm
realdealshaman Aug 6, 2024
74ef8a8
fix more chain names
realdealshaman Aug 6, 2024
5ab0b1c
fix bitlayer
realdealshaman Aug 6, 2024
af21ecb
add milkomeda c1
realdealshaman Aug 6, 2024
641e0fb
lower case
realdealshaman Aug 6, 2024
0599e6e
add cronos zkevm
realdealshaman Aug 6, 2024
c8d5bc8
add chain
realdealshaman Aug 6, 2024
dfa2e09
add chain
realdealshaman Aug 7, 2024
0782929
update chain
realdealshaman Aug 7, 2024
debbfd7
update slug
realdealshaman Aug 7, 2024
57828c5
add reya
realdealshaman Aug 7, 2024
c0b9dad
fix entry
realdealshaman Aug 7, 2024
640f0e3
fix incorrect chain pages
mintdart Aug 8, 2024
403fedc
update entry
realdealshaman Aug 8, 2024
d5672c2
update entry
realdealshaman Aug 9, 2024
36b77df
fix dupe
realdealshaman Aug 9, 2024
83b8cc3
update kaia icon
realdealshaman Aug 13, 2024
c795092
Vcity rpc added (#1226)
rahulmaske77 Aug 14, 2024
341b3c3
update icon path
realdealshaman Aug 15, 2024
baa7afe
update
realdealshaman Aug 15, 2024
7cad858
format
realdealshaman Aug 16, 2024
456b8f5
add default rpc
realdealshaman Aug 16, 2024
546de59
update rootstock
realdealshaman Aug 16, 2024
f25750f
smol retry
realdealshaman Aug 16, 2024
4f40166
update name
realdealshaman Aug 20, 2024
be1ff32
fix logo
realdealshaman Aug 21, 2024
dc1654e
Add Bifrost Polkadot Mainnet (#1229)
ark930 Aug 21, 2024
442a1ef
Add New Chain - Chang Coin Foundation (5858) (#1228)
earthchie Aug 21, 2024
76641e2
Removed the Pollum rpcs with pollum.services dns (#1233)
jonathanlmd Aug 23, 2024
8e48042
Add HashKey Chain Testnet RPC (#1235)
lyszhang Aug 27, 2024
9e435e6
Update extraRpcs.js (#1239)
maradeeym Aug 28, 2024
164f003
add in default rpcs
realdealshaman Aug 28, 2024
5783e68
Add Soneium Minato Testnet (#1241)
parseb Aug 28, 2024
6f6cdd3
fix new entries
realdealshaman Aug 28, 2024
ace63b0
Update extraRpcs.js (#1245)
maradeeym Aug 30, 2024
c4ab7c9
add default rpc
realdealshaman Aug 30, 2024
4095fda
Update extraRpcs.js (#1244)
maradeeym Aug 30, 2024
57dfcd5
add default
realdealshaman Aug 30, 2024
19f4118
Update extraRpcs.js (#1243)
0xx92 Aug 30, 2024
3e98d60
Fix missing semicolon in extraRpcs.js (#1246)
valamidev Sep 2, 2024
f6f67f8
Update extraRpcs.js (#1252)
simone1999 Sep 7, 2024
7e66d4c
Update extraRpcs.js - Add RPC EVM testnet for Story Protocol (#1251)
ValidatorVN Sep 7, 2024
6702afb
Update extraRpcs.js (#1250)
mrspir Sep 7, 2024
b962ee7
Update extraRpcs.js (#1248)
Danielvul Sep 7, 2024
09ee680
PORTERs endpoints updates (hekla and TOS) (#1256)
scermat Sep 10, 2024
88ca1fc
Update chainIds.json (#1253)
Pumpxy Sep 10, 2024
304936d
Update extraRpcs.js - Add RPC EVM testnet for Story Protocol (Mandrag…
McDaan Sep 11, 2024
53fcbe7
fix: chainIds add scroll (#1258)
lenoteddy Sep 11, 2024
43ac5fb
Update extraRpcs.js (#1257)
Coha05 Sep 11, 2024
c3fb0ef
fix syntax
realdealshaman Sep 11, 2024
966506d
Add dymension to chainIds.json (#1263)
lenoteddy Sep 13, 2024
74d0908
Update extraRpcs.js (#1267)
Josephtran102 Sep 13, 2024
264c054
added BlockHub (#1268)
botxx15 Sep 13, 2024
2b77738
Update extraRpcs.js (#1266)
cougarmaster Sep 13, 2024
e5fccda
add gravity
realdealshaman Sep 13, 2024
16456bf
add etn
realdealshaman Sep 13, 2024
3d77095
added French internationalization key (#1271)
StarryHazex Sep 16, 2024
67b2071
improve Chinese translation (#1270)
BlueMistee Sep 16, 2024
a669d5e
Remove Invalid Blast Chain (#1269)
lenoteddy Sep 16, 2024
1d607f9
Add: itrocket story RPC (#1276)
itrocket-team Sep 17, 2024
e453638
Update extraRpcs.js (#1278)
hubofvalley Sep 18, 2024
baf1c07
add aldebaranode story testnet rpc (#1277)
mrheed Sep 18, 2024
42b3463
Add THAT Mainnet (#1280)
baileynahi Sep 20, 2024
b093683
Remove ws endpoint (#1281)
RogerLamTd Sep 20, 2024
163e7c8
Add Tenderly Node RPCs (#1283)
dzimiks Sep 20, 2024
d74ed86
Update extraRpcs.js (#1282)
mrspir Sep 21, 2024
20e0606
add default rpc
realdealshaman Sep 21, 2024
6b4b688
correct my story rpc ednpoint (#1284)
hubofvalley Sep 21, 2024
fd6f1d8
add Grand Valley 0G evm-rpc (#1286)
hubofvalley Sep 22, 2024
00de042
this rpc returns incorrect timestamps for eg block height 6745450
waynebruce0x Sep 23, 2024
0c77d48
Merge pull request #1288 from DefiLlama/faultyrpc
0xngmi Sep 23, 2024
abca630
add Citrea testnet RPC (#1287)
eyusufatik Sep 23, 2024
379985d
Update extraRpcs.js (#1291)
JoGetBlock Sep 25, 2024
1c92a5d
Update extraRpcs.js (#1290)
Josephtran102 Sep 25, 2024
2c74c49
Introduce callStatic mainnet RPCs (#1294)
Callstatic-Admin Sep 25, 2024
31eb7f6
incorrect block heights
waynebruce0x Sep 27, 2024
dd6454d
more bad rpcs
waynebruce0x Sep 27, 2024
1fcd082
another faulty block height
waynebruce0x Sep 27, 2024
3895c51
check rpc list order
realdealshaman Sep 27, 2024
6b8c295
remove katla
realdealshaman Sep 30, 2024
299412c
Add Lisk Chain ID (#1299)
stellardynamic Sep 30, 2024
300d0f9
Update extraRpcs.js (#1297)
Josephtran102 Sep 30, 2024
ce019b6
add Coha05 rpc (#1295)
Coha05 Sep 30, 2024
d7b8aec
add superposition chain
realdealshaman Sep 30, 2024
638ce47
add iotaevm
realdealshaman Sep 30, 2024
e7bda52
update iota testnet rpcs
realdealshaman Sep 30, 2024
e793602
fix syntax
realdealshaman Sep 30, 2024
eeb76ac
Update callStatic privacy statement (#1304)
Callstatic-Admin Oct 1, 2024
2b89789
add network
realdealshaman Oct 1, 2024
8498b0a
Add Roostock BlastAPI endpoint (#1302)
DefiDebauchery Oct 1, 2024
292f106
fix syntax from new entry
realdealshaman Oct 1, 2024
ad09aea
add chain
realdealshaman Oct 4, 2024
08bc982
add matchain (#1306)
alekswoje Oct 4, 2024
e483c4e
Update extraRpcs.js (#1305)
JoGetBlock Oct 4, 2024
3057ed2
add chain
realdealshaman Oct 5, 2024
6b66f70
Bc Hyper chain rpc added and it's privacy policy declaration (#1307)
akashhalder3 Oct 8, 2024
94fdb03
add Glide Protocol (#1308)
icaksh Oct 8, 2024
1bdf65c
Updated Kaia RPC endpoints (#1311)
praveen-kaia Oct 8, 2024
a7d3dd3
feat: added stakely json-rpc for taiko and fantom (#1312)
trikunai Oct 8, 2024
c2cc3eb
update rsk entry
realdealshaman Oct 9, 2024
73ad8f4
Updated Kaia chain extraRpcs (#1324)
praveen-kaia Oct 14, 2024
b429da4
Update extraRpcs.js (#1323)
Orlanduis Oct 14, 2024
b1ae1c8
add buildbear privacystatement
realdealshaman Oct 14, 2024
d16ad1b
Update extraRpcs.js (#1322)
Orlanduis Oct 14, 2024
257764c
fix the buildbear entry
realdealshaman Oct 14, 2024
6570328
Add CheeseChain RPCs (#1321)
bivsk Oct 14, 2024
238aa31
add default rpc
realdealshaman Oct 14, 2024
69d4538
Added dRPC new endpoints (#1320)
maradeeym Oct 14, 2024
6cb7e3b
update zan rpc url (#1317)
dongjl123 Oct 14, 2024
33ea1f5
Delete OnFinality RPC endpoint for Harmony (#1326)
FiveKG Oct 15, 2024
dd7320e
Update extraRpcs.js (#1328)
BlockRazorinc Oct 16, 2024
79ec28f
fix syntax
realdealshaman Oct 18, 2024
5f3f30a
fix url
realdealshaman Oct 18, 2024
d791137
add aiachain and RPCs (#1330)
moumc Oct 20, 2024
3dc4473
update 48Club rpc url (#1331)
du5 Oct 20, 2024
3f2c212
Fix typo - missed comma before BlockRazor block (#1332)
a10zn8 Oct 20, 2024
23ab5c7
Update extraRpcs.js (#1333)
0xx92 Oct 20, 2024
a90f3c0
Add apechain details (#1335)
409H Oct 22, 2024
66926c3
update name to match icon
realdealshaman Oct 22, 2024
3291ea6
Update extraRpcs.js (#1336)
s3unghyeon Oct 22, 2024
90d5bdf
Added Zeniq Smart Chain (#1337)
nomo-app Oct 22, 2024
0cb2cae
add apechain
realdealshaman Oct 22, 2024
a3efd48
add wc
realdealshaman Oct 23, 2024
d690f7e
add apechain
realdealshaman Oct 23, 2024
8b0b9c6
remove duplicate entry
realdealshaman Oct 23, 2024
b8c8088
Add DreyerX chain (#1338)
billalxcode Oct 23, 2024
99e56b2
build
realdealshaman Oct 23, 2024
45a2fa4
fix chiado list
realdealshaman Oct 23, 2024
5aab159
Add latest Omnia RPCs. (#1340)
dumitrucatalin Oct 28, 2024
7d1942f
Update extraRpcs.js (#1342)
maradeeym Oct 28, 2024
7995560
fix rpc for matchain (#1343)
alekswoje Oct 28, 2024
dc54a4c
add Grand Valley Story Protocol Odyssey testnet rpc (#1344)
hubofvalley Oct 30, 2024
065f260
add spidernode rpc to story odyssey
realdealshaman Oct 30, 2024
ed0cc13
add mandragora story odyssey rpc
realdealshaman Oct 30, 2024
84bcdc3
add story odyssey rpc
realdealshaman Oct 30, 2024
725b6ae
Fix ApeChain
MYKatz Oct 30, 2024
2830121
Merge pull request #1349 from ConstellationCrypto/fix-apechain
0xngmi Oct 30, 2024
5908833
Update extraRpcs.js (#1350)
ValidatorVN Oct 31, 2024
4875441
Add: ITRocket Story RPC (#1352)
itrocket-team Oct 31, 2024
6998226
update aldebaranode rpc
realdealshaman Oct 31, 2024
3fd5bd2
Update extraRpcs.js (#1355)
0xx92 Oct 31, 2024
6f561cc
Update extraRpcs.js (#1356)
botxx15 Oct 31, 2024
4abcb0c
Add Morph mainnet (#1357)
zem007 Oct 31, 2024
a6f5d37
Update extraRpcs.js - adding Sophon networks (#1359)
githubdoramon Oct 31, 2024
2e37363
Add ink sepolia (#1365)
CruzMolina Nov 2, 2024
226673e
added BlockHub's Story Protocol RPC (#1360)
botxx15 Nov 2, 2024
0bbfe01
Update Oasis chains (#1361)
aefhm Nov 2, 2024
80ccff3
Updated extraRpcs.js (#1364)
karloinv Nov 2, 2024
93ad78a
fix oasis after updating routes
realdealshaman Nov 2, 2024
5f25332
chain icon
realdealshaman Nov 2, 2024
04d8159
add sapphire icon
realdealshaman Nov 3, 2024
3337181
revert change
realdealshaman Nov 3, 2024
0c552da
add icon
realdealshaman Nov 4, 2024
f4de303
fix chain
realdealshaman Nov 4, 2024
4d8835f
feat: click and copy rpc (+ minor bug fix) (#1375)
melvinmcrn Nov 5, 2024
230e1e8
Update extraRpcs.js (#1374)
maradeeym Nov 5, 2024
8dead81
include default rpc
realdealshaman Nov 5, 2024
15ac8f0
Update extraRpcs.js (#1376)
karloinv Nov 5, 2024
0668669
Update extraRpcs.js (#1377)
karloinv Nov 5, 2024
6eab43a
Update extraRpcs.js (#1378)
karloinv Nov 6, 2024
66cd1f8
Update extraRpcs.js (#1380)
111STAVR111 Nov 6, 2024
3551a92
update privacy policy for bctech
realdealshaman Nov 6, 2024
f64237c
Adding Story RPC from Rawaki (#1383)
rawakinode Nov 8, 2024
e7c619a
remove assert
0xngmi Nov 11, 2024
2596e44
post-export fixes
0xngmi Nov 11, 2024
683e93e
fix imports
0xngmi Nov 11, 2024
04b593a
Add dexrouting Canto RPC (#1384)
0xQuarkus Nov 11, 2024
6073526
Lava (#1366)
LudiSistemas Nov 12, 2024
266e0e4
remove extra key
realdealshaman Nov 12, 2024
3408d8d
[ADD]: add redbelly mainnet rpc (#1390)
callylab520 Nov 15, 2024
3a309fb
add rbn
realdealshaman Nov 18, 2024
219487a
Update extraRpcs.js with Vanar RPCs (#1393)
Qasim-Khan-Bim Nov 22, 2024
bfd9415
add two iotex rpc (#1387)
chaishiqi Nov 22, 2024
839d09e
remove zeeve etherlink rpc
realdealshaman Nov 22, 2024
96b499e
Update extraRpcs.js (#1400)
jbuice Nov 26, 2024
fc40e51
Update extraRpcs.js (#1401)
0xAshcry Nov 26, 2024
9f34910
feat: added corn maizenet and testnet (#1403)
sajanrajdev Nov 28, 2024
9580626
Histori MultiNode RPC urls (#1399)
mikirov Nov 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ yarn-error.log*

# vercel
.vercel

# others
build.log
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ You can start editing the page by modifying `pages/index.js`. The page auto-upda

## Adding your RPC

If you wish to add your RPC, please follow the [PR template](https://github.com/DefiLlama/chainlist/blob/main/pull_request_template.md)
If you wish to add your RPC, please follow this [PR template](https://github.com/DefiLlama/chainlist/blob/main/pull_request_template.md)
162 changes: 162 additions & 0 deletions components/AdBanner/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
import { useEffect, useRef, useState } from "react";

import { Native, NativeMediaContent, NativeLink } from "hypelab-react";
import { HYPELAB_NATIVE_PLACEMENT_SLUG } from "../../constants/hypelab";

export const AdBanner = () => {
return (
<Native placement={HYPELAB_NATIVE_PLACEMENT_SLUG}>
{function (ad) {
if (ad.icon !== "") {
return <NativeWrapper ad={ad} />;
}
}}
</Native>
);
};

const NativeWrapper = ({ ad }) => {
const imageRef = useRef(null);
const [isSquare, setIsSquare] = useState(false);
const [hideNativeTextContent, setHideNativeTextContent] = useState(true);

useEffect(() => {
const resizeObserver = new ResizeObserver((entries) => {
for (const entry of entries) {
if (entry.contentRect.width > 0 && entry.contentRect.height > 0) {
setIsSquare(entry.contentRect.width == entry.contentRect.height);
setHideNativeTextContent(entry.contentRect.height > 220);
}
}
});

const container = imageRef.current;

if (container) {
resizeObserver.observe(container);
}

return () => {
if (container) {
resizeObserver.unobserve(container);
}
};
}, [imageRef]);

return (
<div className="flex flex-col w-full h-full items-center justify-center">
<div
className={`flex flex-col w-fit max-w-full bg-white dark:bg-[#0D0D0D] rounded-[10px] shadow overflow-hidden ${
isSquare ? "max-w-[260px] lg:max-w-[290px]" : ""
}`}
>
<div className="flex">
<NativeLink>
<div className="relative" ref={imageRef}>
<NativeMediaContent />

<HypeLabOverlay />
</div>
</NativeLink>
</div>
{isSquare || hideNativeTextContent ? "" : <NativeTextContent ad={ad} />}
</div>
</div>
);
};

const NativeTextContent = ({ ad }) => {
const containerRef = useRef(null);
const [width, setWidth] = useState(0);

useEffect(() => {
const resizeObserver = new ResizeObserver((entries) => {
for (const entry of entries) {
setWidth(entry.contentRect.width);
}
});

const container = containerRef.current;

if (container) {
resizeObserver.observe(container);
}

return () => {
if (container) {
resizeObserver.unobserve(container);
}
};
}, [containerRef]);

return (
<div className="flex items-center justify-center px-3 py-3 w-full h-full" id="ctaContainer" ref={containerRef}>
<AdvertiserIcon ad={ad} small={width < 300} />
<div className="grow flex items-center justify-between overflow-hidden">
<div className="grow truncate">
<AdvertiserName ad={ad} small={width < 300} />
</div>
<div className="flex-none ml-4">
<AdvertiserCta ad={ad} small={width < 300} />
</div>
</div>
</div>
);
};

const AdvertiserIcon = ({ ad, small = false }) => {
return (
<div className="flex-none mr-2">
<NativeLink>
<img className={`${small ? "w-8" : "w-10"} rounded-full`} alt={ad.icon} src={ad.icon} />
</NativeLink>
</div>
);
};

const AdvertiserName = ({ ad, small = false }) => {
return (
<div
className={`${
small ? "text-sm" : ""
} font-semibold overflow-hidden text-ellipsis relative top-[1px] dark:text-[#B3B3B3]`}
>
<NativeLink>{ad.advertiser}</NativeLink>
</div>
);
};

const AdvertiserCta = ({ ad, small = false }) => {
return (
<div className="flex-none">
<NativeLink>
<div
data-cy="ctaText"
className={`${
small ? "text-sm px-2 py-1" : "px-4 py-2"
} border dark:border-[#171717] border-[#EAEAEA] text-center rounded-[50px] dark:text-[#2F80ED] text-[#2F80ED] dark:hover:text-black hover:text-white dark:hover:bg-[#2F80ED] hover:bg-[#2F80ED] truncate`}
>
{ad.ctaText}
</div>
</NativeLink>
</div>
);
};

const HypeLabOverlay = () => {
const iconStyle = {
width: "18px",
height: "18px",
backgroundSize: "15px 15px",
backgroundPosition: "center",
backgroundRepeat: "no-repeat",
backgroundImage: `url("data:image/svg+xml,%3Csvg width='436' height='660' viewBox='0 0 436 660' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M406.851 295.413C422.472 311.034 422.472 336.36 406.851 351.981L160.171 598.661C152.694 606.138 142.561 610.35 131.988 610.376L89.6175 610.483C67.4476 610.539 49.4613 592.552 49.5171 570.382L49.6237 528.012C49.6503 517.439 53.8625 507.306 61.3393 499.829L308.019 253.149C323.64 237.528 348.966 237.528 364.587 253.149L406.851 295.413Z' fill='url(%23paint0_linear_302_3)'/%3E%3Cpath d='M40.7391 354.979C25.1181 339.358 25.1181 314.031 40.7391 298.41L279.222 59.927C286.703 52.4462 296.843 48.2336 307.422 48.2113L347.024 48.1279C369.181 48.0812 387.155 66.0549 387.108 88.2121L387.024 127.814C387.002 138.393 382.79 148.533 375.309 156.014L136.826 394.497C121.205 410.118 95.8782 410.118 80.2572 394.497L40.7391 354.979Z' fill='url(%23paint1_linear_302_3)'/%3E%3Cdefs%3E%3ClinearGradient id='paint0_linear_302_3' x1='-1.91062' y1='918.002' x2='34.7376' y2='209.271' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='white'/%3E%3Cstop offset='1' stop-color='%2300FF85'/%3E%3C/linearGradient%3E%3ClinearGradient id='paint1_linear_302_3' x1='622.605' y1='-507.064' x2='360.234' y2='489.074' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0.0001' stop-color='%233BE160'/%3E%3Cstop offset='1' stop-color='%23D7FF35'/%3E%3C/linearGradient%3E%3C/defs%3E%3C/svg%3E%0A")`,
};

return (
<div className="flex flex-row absolute top-0 right-0 bg-black/30 items-center pr-2 hover:translate-x-0 translate-x-[calc(100%-18px)] duration-500 transition-transform">
<div style={iconStyle}></div>
<div className="text-white text-xs h-[15px]">Ads by HypeLab</div>
</div>
);
};
59 changes: 54 additions & 5 deletions components/Layout/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,34 @@
import * as React from "react";
import { useEffect } from "react";
import Header from "../header";
// import { useTranslations } from "next-intl";
import { notTranslation as useTranslations } from "../../utils";
import Logo from "./Logo";
import { useRouter } from "next/router";

const toggleTheme = (e) => {
e.preventDefault();
const element = document.body;
document.getElementById("theme-toggle-dark-icon").classList.toggle("hidden");
document.getElementById("theme-toggle-light-icon").classList.toggle("hidden");
const result = element.classList.toggle("dark");
localStorage.setItem("theme", result ? "dark" : "light");
};

const initTheme = () => {
const element = document.body;
if (element.classList.contains("dark")) {
document.getElementById("theme-toggle-light-icon").classList.remove("hidden");
} else {
document.getElementById("theme-toggle-dark-icon").classList.remove("hidden");
}
};

export default function Layout({ children, lang }) {
useEffect(() => {
initTheme();
}, []);

const t = useTranslations("Common", lang);

const router = useRouter();
Expand All @@ -16,7 +39,7 @@ export default function Layout({ children, lang }) {

return (
<div className="grid grid-cols-1 lg:grid-cols-[40vw,_auto]">
<div className="relative h-full">
<div className="dark:text-[#B3B3B3] text-black dark:bg-[#0D0D0D] bg-white relative h-full">
<div className="p-5 sticky top-0 bottom-0 m-auto flex flex-col items-center gap-8 justify-center h-screen max-w-[480px] mx-auto">
<figure className="lg:mr-auto">
<Logo />
Expand All @@ -27,7 +50,7 @@ export default function Layout({ children, lang }) {

<div className="flex flex-col gap-4 w-full">
<a
className="flex items-center justify-center mx-auto lg:ml-0 gap-2 rounded-[50px] max-w-[16.25rem] font-medium py-[18px] px-6 shadow-lg w-full bg-[#2F80ED] text-white"
className="flex items-center justify-center mx-auto lg:ml-0 gap-2 rounded-[50px] max-w-[16.25rem] font-medium py-[18px] px-6 shadow-lg w-full dark:bg-[#2F80ED] bg-[#2F80ED] dark:text-black text-white"
href="https://github.com/ethereum-lists/chains"
target="_blank"
rel="noopener noreferrer"
Expand All @@ -46,7 +69,7 @@ export default function Layout({ children, lang }) {
</a>

<a
className="flex items-center justify-center mx-auto lg:ml-0 gap-2 rounded-[50px] max-w-[16.25rem] font-medium py-[17px] px-6 w-full bg-white text-[#2F80ED] border border-[#EAEAEA]"
className="flex items-center justify-center mx-auto lg:ml-0 gap-2 rounded-[50px] max-w-[16.25rem] font-medium py-[17px] px-6 w-full dark:bg-[#0D0D0D] bg-white dark:text-[#2F80ED] text-[#2F80ED] border dark:border-[#171717] border-[#EAEAEA]"
href="https://github.com/DefiLlama/chainlist/blob/main/constants/extraRpcs.js"
target="_blank"
rel="noopener noreferrer"
Expand Down Expand Up @@ -79,10 +102,36 @@ export default function Layout({ children, lang }) {
</svg>
<span className="text-base font-medium">{t("view-source-code")}</span>
</a>

<a className="flex items-center gap-2 mx-auto lg:ml-0" href="#" onClick={toggleTheme} id="theme-toggle">
<svg
id="theme-toggle-dark-icon"
className="w-5 h-5 hidden"
fill="#2F80ED"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"></path>
</svg>
<svg
id="theme-toggle-light-icon"
className="w-5 h-5 hidden"
fill="#2F80ED"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z"
fillRule="evenodd"
clipRule="evenodd"
></path>
</svg>
<span className="text-base font-medium">{t("toggle-theme")}</span>
</a>
</div>
</div>
<div className="bg-[#f3f3f3] p-5 relative flex flex-col gap-5">
<Header lang={lang} chainName={chainName} key={chainName} />
<div className="dark:bg-[#181818] bg-[#f3f3f3] p-5 relative flex flex-col gap-5">
<Header lang={lang} chainName={chainName} key={chainName + "header"} />

{children}
</div>
Expand Down
Loading