Skip to content

Commit

Permalink
Merge pull request #37 from zkLinkProtocol/goerli
Browse files Browse the repository at this point in the history
merge testnet modify to mainnet
  • Loading branch information
MickWang authored Mar 17, 2024
2 parents 1afe0f9 + e8feeed commit 1777d82
Show file tree
Hide file tree
Showing 27 changed files with 1,906 additions and 345 deletions.
7 changes: 4 additions & 3 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
VITE_ENV = development
VITE_NODE_TYPE="nexus"
VITE_TWITTER_CLIENT_ID = eGQtUDNsTjIxbktrVWdaUzRzbU86MTpjaQ
VITE_TWITTER_CALLBACK_URL = https://test.app.zklink.io/aggregation-parade
VITE_NODE_TYPE="nexus-goerli"
VITE_TWITTER_CLIENT_ID = QWpDMDlpX0VuZ0hEdUFDdEFTaUY6MTpjaQ
VITE_TWITTER_CALLBACK_URL = https://goerli.app.zklink.io/aggregation-parade
VITE_IS_VALID_TWITTER_ACCESS = 0 # 0: not valid, 1: valid

1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ VITE_ENV = production
VITE_NODE_TYPE="nexus"
VITE_TWITTER_CLIENT_ID = UWlzSnJfQlVzdzlNc1c3ckdpY0U6MTpjaQ,RThINUVuNm9XdGFKVUpvejU1bFU6MTpjaQ,eFVmRGpWTEtMbGxjUGE2Y09KdHM6MTpjaQ
VITE_TWITTER_CALLBACK_URL = https://app.zklink.io/aggregation-parade
VITE_IS_VALID_TWITTER_ACCESS = 1 # 0: not valid, 1: valid

# For: test.app.zklink.io
# VITE_TWITTER_CLIENT_ID = eGQtUDNsTjIxbktrVWdaUzRzbU86MTpjaQ
Expand Down
2 changes: 0 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions public/img/icon-wallet-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/navbar-bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 40 additions & 1 deletion src/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import http from "@/utils/http";
import qs from "qs";

type Response = {
status: string;
Expand All @@ -11,6 +12,7 @@ type Response = {
export const BASE_URL_API = "/api";
export const BASE_URL_POINTS = "/points";
export const BASE_URL_TOKENS = "/tokens";
export const BASE_URL_TWITTER = "/twitter";

export type BindInviteCodeWithAddressParams = {
address: string;
Expand Down Expand Up @@ -193,7 +195,7 @@ export type RegisterAccountParams = {
address: string;
code?: string | null;
siganture: string;
accessToken: string;
accessToken?: string | null;
chainId: string | number;
txHash: string;
};
Expand All @@ -209,3 +211,40 @@ export const registerAccount = (
...data,
});
};

export type AccessTokenParams = {
code: string;
grant_type: string;
client_id: string;
redirect_uri: string;
code_verifier: string;
};
export type AccessTokenResponse = {
token_type: string;
expires_in: number;
access_token: string;
scope: string;
};
export const getTwitterAccessToken = (
params: AccessTokenParams
): Promise<AccessTokenResponse> =>
http.post("/twitter/2/oauth2/token", qs.stringify({ ...params }), {
headers: { "Content-Type": "application/x-www-form-urlencoded" },
});

export type TwitterUserResponse = {
data: {
id: string;
name: string;
username: string;
};
};
export const getTwitterUser = (
accessToken: string
): Promise<TwitterUserResponse> =>
http.get("/twitter/2/users/me", {
headers: {
// "Content-Type": "application/json",
Authorization: `Bearer ${accessToken}`,
},
});
6 changes: 3 additions & 3 deletions src/components/AssetsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ export default function AssetsTable(props: IAssetsTableProps) {
return (
<>
<CardBox className="mt-[2rem] p-[0.38rem] flex justify-between items-center w-full overflow-auto">
<div style={{ maxWidth: "calc(100% - 14rem)", overflow: "auto" }}>
<div className="maxWid">
<TabsBar className="flex items-center gap-[0.5rem]">
{assetTabList.map((item, index) => (
<span
Expand All @@ -439,7 +439,7 @@ export default function AssetsTable(props: IAssetsTableProps) {
</div>
</CardBox>

<TableBox>
<TableBox className="overflow-auto md:overflow-visible">
<Table
removeWrapper
className="table mt-[1.5rem] min-h-[30rem]"
Expand Down Expand Up @@ -553,7 +553,7 @@ export default function AssetsTable(props: IAssetsTableProps) {
isOpen={bridgeModal.isOpen}
onOpenChange={bridgeModal.onOpenChange}
>
<ModalContent>
<ModalContent className="mb-[5.75rem]">
{(onClose) => (
<>
<ModalHeader>Bridge</ModalHeader>
Expand Down
Loading

0 comments on commit 1777d82

Please sign in to comment.