-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added transaction and balance in basboard (#3352)
* feat(dashboard): added transaction and balance in basboard * fix(dashboard): added BUCK back * chore(dashboard): linux EOL * fix(dashboard): pnpm out of sync rebase * fix(dashboard): fix formatting * chore: address pr feedback * feat: misc Ui changes * chore(feat): address pr feedback, Ui changes rebase * chore: remove logo from public * chore: misc changes * chore: address pr feedback * chore: address pr feedback * chore: sync pnpm --------- Co-authored-by: Siddharth <[email protected]>
- Loading branch information
1 parent
c570942
commit 5562bc6
Showing
41 changed files
with
4,722 additions
and
1,622 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# REPLACE THIS IT IS FOR TESTING | ||
NEXTAUTH_URL=https://c890-2405-201-301c-5b67-89d6-bd56-6afb-6294.ngrok-free.app | ||
PORT=3001 | ||
NEXTAUTH_SECRET="thisismysecret" | ||
# 2db7666c39074da4b399e8b5116ef2c6 | ||
# 2cc1869e52ad47df848a6519b63bb4f4 |
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 |
---|---|---|
|
@@ -33,3 +33,7 @@ yarn-error.log* | |
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
|
||
|
||
.env.local |
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
Binary file not shown.
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,3 +1,43 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
:root { | ||
--transparent: rgba(0, 0, 0, 0); | ||
--white: #ffffff; | ||
--black: #000000; | ||
--lightGrey: #cfd9e2; | ||
--lighterGrey: #e6ebef; | ||
--lightBlue: #3553ff; | ||
--darkGrey: #1d1d1d; | ||
--blue: #3050c4; | ||
--orange: #ff7e1c; | ||
--sky: #c3ccff; | ||
--primary: #fc5805; | ||
--primary3: #fd800b; | ||
--primary4: #fe990d; | ||
--primary5: #ffad0d; | ||
--blue5: #4453e2; | ||
--grey0: #3a3c51; | ||
--grey1: #61637a; | ||
--grey2: #9292a0; | ||
--grey3: #aeaeb8; | ||
--grey4: #e2e2e4; | ||
--grey5: #f2f2f4; | ||
--loaderForeground: #ecebeb; | ||
--loaderBackground: #f3f3f3; | ||
--green: #00a700; | ||
--error: #dc2626; | ||
--error9: #fee2e2; | ||
--warning: #f59e0b; | ||
} | ||
|
||
[data-joy-color-scheme="light"] { | ||
--inputColor: var(--black); | ||
--primaryColor: var(--primary); | ||
} | ||
|
||
[data-joy-color-scheme="dark"] { | ||
--inputColor: var(--white); | ||
--primaryColor: var(--primary4); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { CircularProgress } from "@mui/joy"; | ||
import React from "react"; | ||
|
||
function Loading() { | ||
return ( | ||
<div className="flex justify-center items-center min-h-screen"> | ||
<CircularProgress /> | ||
</div> | ||
); | ||
} | ||
|
||
export default Loading; |
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,39 +1,18 @@ | ||
import { NextRequest } from "next/server"; | ||
import { getServerSession } from "next-auth"; | ||
import { authOptions } from "./api/auth/[...nextauth]/route"; | ||
import { apollo } from "../services/graphql"; | ||
import Link from "next/link"; | ||
import PriceContainer from "@/components/price-container/price-container"; | ||
import { Container } from "@mui/material"; | ||
import ContentContainer from "@/components/content-container"; | ||
|
||
export default async function Home(req: NextRequest) { | ||
export default async function Home() { | ||
const session = await getServerSession(authOptions); | ||
const isAuthed = session?.sub ?? false; | ||
if (!isAuthed) { | ||
return ( | ||
<> | ||
<p>not logged in</p> | ||
<a href="/api/auth/signin">Sign in</a> | ||
</> | ||
); | ||
} | ||
|
||
const AccountDetails = session.userData.data.me.defaultAccount.wallets; | ||
const DefaultAccountId = session.userData.data.me.defaultAccount.id; | ||
const walletDetails = | ||
session?.userData?.data?.me?.defaultAccount?.wallets || []; | ||
|
||
return ( | ||
<main> | ||
{isAuthed && ( | ||
<Container> | ||
<PriceContainer | ||
DefaultAccountId={DefaultAccountId} | ||
AccountDetails={AccountDetails} | ||
></PriceContainer> | ||
<p>logged in </p> | ||
<p>UserId: {session.sub}</p> | ||
<Link href={`/transaction`}>transactions</Link> | ||
</Container> | ||
)} | ||
<ContentContainer> | ||
<PriceContainer walletDetails={walletDetails}></PriceContainer> | ||
</ContentContainer> | ||
</main> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { getServerSession } from "next-auth"; | ||
import React from "react"; | ||
import { authOptions } from "../api/auth/[...nextauth]/route"; | ||
import TransactionDetails from "@/components/transaction-details/transaction-details-table"; | ||
import ContentContainer from "@/components/content-container"; | ||
import { | ||
fetchFirstTransactions, | ||
fetchPaginatedTransactions, | ||
} from "@/services/graphql/queries/get-transactions"; | ||
import TransactionCard from "@/components/transaction-details/transaction-card-item"; | ||
import PageNumber from "@/components/transaction-details/page-number"; | ||
|
||
interface TransactionDetailsSearchParams { | ||
cursor: string; | ||
direction: "next" | "previous"; | ||
} | ||
|
||
export default async function page({ | ||
searchParams, | ||
}: { | ||
searchParams: TransactionDetailsSearchParams; | ||
}) { | ||
const { cursor, direction } = searchParams; | ||
const session = await getServerSession(authOptions); | ||
const token = session?.accessToken; | ||
if (!token || typeof token !== "string") { | ||
throw new Error("invalid token"); | ||
} | ||
|
||
const numberOfTransactions = 50; | ||
let response; | ||
if (cursor && direction) { | ||
response = await fetchPaginatedTransactions( | ||
token, | ||
direction, | ||
cursor, | ||
numberOfTransactions, | ||
); | ||
} else { | ||
response = await fetchFirstTransactions(token, numberOfTransactions); | ||
} | ||
|
||
const rows = response?.edges?.map((edge) => ({ node: edge.node })) ?? []; | ||
const pageInfo = response?.pageInfo; | ||
return ( | ||
<ContentContainer> | ||
{rows.length > 0 ? ( | ||
<> | ||
<TransactionDetails rows={rows} /> | ||
<TransactionCard rows={rows} /> | ||
<PageNumber pageInfo={pageInfo}></PageNumber> | ||
</> | ||
) : ( | ||
<span>No Transactions Found</span> | ||
)} | ||
</ContentContainer> | ||
); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
interface UrlInfo { | ||
title: string; | ||
protected: boolean; | ||
} | ||
|
||
export const URLS: Record<string, UrlInfo> = { | ||
"/": { title: "Home", protected: true }, | ||
"/transactions": { title: "Transactions", protected: true }, | ||
}; |
2 changes: 1 addition & 1 deletion
2
apps/dashboard/components/colot-toggle.tsx → apps/dashboard/components/color-toggle.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
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { Box } from "@mui/joy"; | ||
import React from "react"; | ||
|
||
interface ContentContainerProps { | ||
children: React.ReactNode; | ||
} | ||
|
||
function ContentContainer({ children }: ContentContainerProps) { | ||
return ( | ||
<Box | ||
component="main" | ||
className="MainContent" | ||
sx={{ | ||
px: { | ||
xs: 2, | ||
md: 6, | ||
}, | ||
pt: { | ||
xs: 3, | ||
sm: 3, | ||
md: 3, | ||
}, | ||
pb: { | ||
xs: 2, | ||
sm: 2, | ||
md: 3, | ||
}, | ||
flex: 1, | ||
display: "flex", | ||
flexDirection: "column", | ||
minWidth: 0, | ||
gap: 1, | ||
}} | ||
> | ||
{children} | ||
</Box> | ||
); | ||
} | ||
|
||
export default ContentContainer; |
Oops, something went wrong.