-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2093a8b
commit 2b14666
Showing
11 changed files
with
351 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 48 additions & 1 deletion
49
desktop-app/renderer/pages/exchangeAccounts/[slug]/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,58 @@ | ||
import { | ||
RetreivedExchangeAccount, | ||
getExchangeAccount | ||
} from '@/api/exchangeAccounts/exchangeAccount' | ||
import ContextHeader from '@/components/layout/contextHeader' | ||
import DefaultPageLayout from '@/components/layout/defaultPageLayout' | ||
import { useSearchParams } from 'next/navigation' | ||
import { useRouter } from 'next/router' | ||
import { useEffect, useState } from 'react' | ||
|
||
const defaultExchangeAccount: RetreivedExchangeAccount = { | ||
uuid: '', | ||
name: '', | ||
description: '', | ||
testing: false, | ||
exchange: '' | ||
} | ||
|
||
export default function ExchangeAccount(): JSX.Element { | ||
const router = useRouter() | ||
const searchParams = useSearchParams() | ||
const [exchangeAccount, setExchangeAccount] = | ||
useState<RetreivedExchangeAccount>(defaultExchangeAccount) | ||
|
||
useEffect(() => { | ||
const fetchExchangeAccount = async () => { | ||
try { | ||
const response = await getExchangeAccount( | ||
searchParams, | ||
router.query.slug as string | ||
) | ||
setExchangeAccount(response.data) | ||
} catch (error) { | ||
console.error(error) | ||
setExchangeAccount(defaultExchangeAccount) | ||
} | ||
} | ||
if (searchParams.get('server')) { | ||
fetchExchangeAccount() | ||
} | ||
}, [searchParams, router.query.slug]) | ||
|
||
return ( | ||
<ContextHeader isBot> | ||
<h1>Exchange Account {router.query.slug}</h1> | ||
<DefaultPageLayout | ||
header={ | ||
'Exchange Account' + | ||
(exchangeAccount.name && ' - ' + exchangeAccount.name) | ||
} | ||
description={ | ||
'Here is an overview of your exchange account. An exchange account reprents a connection to an exchange/broker.' | ||
} | ||
> | ||
<div></div> | ||
</DefaultPageLayout> | ||
</ContextHeader> | ||
) | ||
} |
Oops, something went wrong.