Changes
Page history
Update Entwicklerdokumentation
authored
Jul 21, 2024
by
s88999
Show whitespace changes
Inline
Side-by-side
Entwicklerdokumentation.md
View page @
353796d7
...
...
@@ -214,3 +214,31 @@ contract DEX is ERC20Base {
payable(msg.sender).transfer(ethBought);
}
}
## Frontend-Entwicklung
Das Frontend von DEXWeb ist mit React und Next.js gebaut und verwendet das Thirdweb SDK. Es befindet sich im
`frontend`
Verzeichnis.
### Hauptkomponenten
-
**Pages**
: Enthält die Hauptseiten der Anwendung.
-
**components/**
: Enthält wiederverwendbare UI-Komponenten.
### Beispielcode für die Thirdweb-Integration
```
jsx
import
{
ThirdwebProvider
}
from
'
@thirdweb-dev/react
'
;
function
MyApp
({
Component
,
pageProps
})
{
const
API_KEY
=
process
.
env
.
NEXT_PUBLIC_API_KEY
||
''
;
const
activeChain
=
'
mumbai
'
;
return
(
<
ThirdwebProvider
supportedChains
=
{
[
activeChain
]
}
apiKey
=
{
API_KEY
}
>
<
Component
{
...
pageProps
}
/>
</
ThirdwebProvider
>
);
}
export
default
MyApp
;