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

Reimplement wallet bindings & Introduce performance optimizations #332

Merged
merged 90 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
0e5c65f
taking out validation from effects file
Jikugodwill Jan 15, 2025
7c6d45e
updated design to use react-hook-form instead
Jikugodwill Jan 15, 2025
2efe5c7
Added more refinement to the hook
Jikugodwill Jan 16, 2025
6e367f6
taking out redux code and replacing with rhf
Jikugodwill Jan 16, 2025
3469a04
Reverting back some old code for testing
Jikugodwill Jan 16, 2025
977cafd
Added param to hook
Jikugodwill Jan 16, 2025
7704dd5
more rhf updates
Jikugodwill Jan 16, 2025
02407c0
commented errors out
Jikugodwill Jan 16, 2025
f2818ec
wip
carina-akaia Jan 19, 2025
900a0b9
wip
carina-akaia Jan 19, 2025
239e6ab
Disable SSR
carina-akaia Jan 19, 2025
1b463ed
Stop using localStorage cache
carina-akaia Jan 19, 2025
86884c9
wip
carina-akaia Jan 19, 2025
d7e474f
wip
carina-akaia Jan 20, 2025
6efcfdc
wip
carina-akaia Jan 20, 2025
fb17162
Merge branch 'main' of https://github.com/PotLock/potlock-nextjs-app …
Jikugodwill Jan 20, 2025
b11b488
updated for addFundingSources schema object
Jikugodwill Jan 20, 2025
3c35305
wip
carina-akaia Jan 20, 2025
4056429
Updated components to completely use react-hook-form
Jikugodwill Jan 21, 2025
dcfdb28
Removed unused imports from the hook and reverted saveProject()
Jikugodwill Jan 21, 2025
eeaace8
reverted saveProject() in effects
Jikugodwill Jan 21, 2025
ba80a26
Merge branch 'main' of https://github.com/PotLock/potlock-nextjs-app …
carina-akaia Jan 21, 2025
995ad3e
updated input value to the more reactive "values"
Jikugodwill Jan 21, 2025
3d0acf6
updating to the more recent useSession
Jikugodwill Jan 21, 2025
aec392f
updated hook
Jikugodwill Jan 21, 2025
2eb8ba4
removed unused code and imports
Jikugodwill Jan 21, 2025
58641dd
wip
carina-akaia Jan 21, 2025
a44510f
wip
carina-akaia Jan 21, 2025
5053e32
wip
carina-akaia Jan 21, 2025
149969c
wip
carina-akaia Jan 21, 2025
4fc4a76
added project isEdit check
Jikugodwill Jan 21, 2025
7f0d02a
wip
carina-akaia Jan 22, 2025
e90a2ae
wip
carina-akaia Jan 22, 2025
9a5a5fa
wip
carina-akaia Jan 22, 2025
e715b2e
wip
carina-akaia Jan 22, 2025
fd24c6b
Merge branch 'main' of https://github.com/PotLock/potlock-nextjs-app …
carina-akaia Jan 22, 2025
45f4ce0
wip
carina-akaia Jan 22, 2025
8e19d89
wip
carina-akaia Jan 23, 2025
2ebc8e6
wip
carina-akaia Jan 23, 2025
9f182a8
wip
carina-akaia Jan 23, 2025
0519f57
wip
carina-akaia Jan 23, 2025
80d3aad
wip
carina-akaia Jan 23, 2025
1885953
wip
carina-akaia Jan 23, 2025
71d85e9
wip
carina-akaia Jan 23, 2025
8e19ec4
wip
carina-akaia Jan 23, 2025
7f1086e
wip
carina-akaia Jan 23, 2025
66c9e10
wip
carina-akaia Jan 23, 2025
097e6c2
wip
carina-akaia Jan 23, 2025
c93b188
wip
carina-akaia Jan 23, 2025
6ee1777
Remove MyNearWallet support
carina-akaia Jan 23, 2025
f2930f5
Fix: remove reference to a non-existent model
carina-akaia Jan 24, 2025
62c9d53
Merge branch '317-bug-fix-project-registration-fllow' of https://gith…
carina-akaia Jan 27, 2025
d54d643
Merge branch 'main' of https://github.com/PotLock/potlock-nextjs-app …
carina-akaia Jan 27, 2025
de7c71d
wip
carina-akaia Jan 27, 2025
cc59ebb
wip
carina-akaia Jan 27, 2025
5144e59
wip
carina-akaia Jan 27, 2025
0ea2d09
wip
carina-akaia Jan 27, 2025
d31ab98
wip
carina-akaia Jan 27, 2025
2f7ca6a
wip
carina-akaia Jan 27, 2025
ef5e8f4
wip
carina-akaia Jan 27, 2025
2a989fa
wip
carina-akaia Jan 27, 2025
abc31dd
wip
carina-akaia Jan 27, 2025
80d547e
wip
carina-akaia Jan 27, 2025
cafbd10
wip
carina-akaia Jan 27, 2025
81a4995
Fix cover image size
carina-akaia Jan 29, 2025
3daea57
wip
carina-akaia Jan 29, 2025
68a9213
wip
carina-akaia Jan 29, 2025
fd201be
wip
carina-akaia Jan 29, 2025
56f4bf4
Implement DAO representative session bindings
carina-akaia Jan 29, 2025
6f4840d
wip
carina-akaia Jan 29, 2025
5717a0c
wip
carina-akaia Jan 29, 2025
a4d87f2
Fix hydration error
carina-akaia Jan 29, 2025
5863701
Remove deprecated hook
carina-akaia Jan 29, 2025
7134d59
Require sign in explicitly
carina-akaia Jan 29, 2025
efeb202
Hide sybil resistance warning if not signed in
carina-akaia Jan 29, 2025
e775673
Bump app version
carina-akaia Jan 31, 2025
f2d89fd
wip
carina-akaia Jan 31, 2025
2b0a982
wip
carina-akaia Jan 31, 2025
58ac1e6
Reorganize common hierarchy
carina-akaia Jan 31, 2025
c71ba96
Decouple status types
carina-akaia Jan 31, 2025
9fdc561
Fix pot configuration editor issues
carina-akaia Feb 3, 2025
13825c0
Done with Lists fixes for mainnet (#338)
Ebube111 Feb 3, 2025
3303b16
Merge branch '19012025-wallet-context' of https://github.com/PotLock/…
carina-akaia Feb 3, 2025
ba61641
Fix pot application flow issues
carina-akaia Feb 3, 2025
1db7daa
Fix pot application flow issues
carina-akaia Feb 3, 2025
a28b919
Fix pot application flow issues
carina-akaia Feb 3, 2025
b5ffb8f
Temporarily freeze profile setup on production
carina-akaia Feb 3, 2025
a09eb08
chore: Update CSpell dictionary
carina-akaia Feb 3, 2025
270d093
Adjust registration flow
carina-akaia Feb 3, 2025
dfdbd3b
Update CSpell dictionary
carina-akaia Feb 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"naumovs.color-highlight",
"usernamehw.errorlens",
"eamodio.gitlens",
"dbaeumer.vscode-eslint"
"dbaeumer.vscode-eslint",
"rambit.highlight-counter"
]
}
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"errorLens.warningGutterIconColor": "#ff942f",
"cSpell.words": [
"amichaeltest",
"Aptos",
"Attributify",
"bitget",
"builddao",
Expand All @@ -57,15 +58,20 @@
"data-testid",
"datetime",
"defi",
"deployers",
"dontcare",
"Elrond",
"extralight",
"fastnear",
"foodbank",
"formkit",
"graylisted",
"hookform",
"Injective",
"intear",
"Jikugodwill",
"kubb",
"Linea",
"linktree",
"METAPOOL",
"mpdao",
Expand All @@ -78,6 +84,7 @@
"openapi",
"overscan",
"partialize",
"Polkadot",
"potfactory",
"POTLOCK",
"precommit",
Expand All @@ -89,11 +96,14 @@
"sessionid",
"shadcn",
"socialdb",
"Solana",
"SOURCECODE",
"stnear",
"svgr",
"=createproject",
"typecheck",
"uidotdev",
"unfollow",
"unocss",
"upvote",
"Upvoted",
Expand All @@ -105,6 +115,7 @@
"wpdas",
"xdefi",
"yearofchef",
"yocto",
"zustand"
]
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@potlock/next",
"description": "Decentralized funding stack for public goods",
"version": "2.0.0",
"version": "2.1.0",
"packageManager": "yarn@1.22.22",
"private": true,
"type": "module",
Expand All @@ -18,6 +18,7 @@
"next:dev": "yarn && next dev",
"build": "yarn generate:css && next build",
"start": "next start",
"preview": "next build && next start",
"test:unit": "vitest run",
"prepare": "husky"
},
Expand Down Expand Up @@ -157,4 +158,4 @@
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^1.6.0"
}
}
}
6 changes: 6 additions & 0 deletions src/common/_config/production.env-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ export const envConfig: EnvConfig = {
},

features: {
[FeatureId.ProfileConfiguration]: {
id: FeatureId.ProfileConfiguration,
name: "Profile configuration",
isEnabled: false,
},

[FeatureId.DirectFtDonation]: {
id: FeatureId.DirectFtDonation,
name: "Direct FT donation",
Expand Down
6 changes: 6 additions & 0 deletions src/common/_config/staging.env-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ export const envConfig: EnvConfig = {
},

features: {
[FeatureId.ProfileConfiguration]: {
id: FeatureId.ProfileConfiguration,
name: "Profile configuration",
isEnabled: true,
},

[FeatureId.DirectFtDonation]: {
id: FeatureId.DirectFtDonation,
name: "Direct FT donation",
Expand Down
6 changes: 6 additions & 0 deletions src/common/_config/test.env-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ export const envConfig: EnvConfig = {
},

features: {
[FeatureId.ProfileConfiguration]: {
id: FeatureId.ProfileConfiguration,
name: "Profile configuration",
isEnabled: true,
},

[FeatureId.DirectFtDonation]: {
id: FeatureId.DirectFtDonation,
name: "Direct FT donation",
Expand Down
40 changes: 0 additions & 40 deletions src/common/_deprecated/pots.ts

This file was deleted.

32 changes: 0 additions & 32 deletions src/common/_deprecated/useIsHuman.ts

This file was deleted.

47 changes: 0 additions & 47 deletions src/common/_deprecated/useRegistration.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/common/api/coingecko/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const useNativeTokenUsdPrice = (
useSWR(
() => (disabled ? null : ["oneNativeTokenUsdPrice", NATIVE_TOKEN_ID.toLowerCase()]),

([_queryKey, tokenId]) =>
([_queryKeyHead, tokenId]) =>
client
.get(`/simple/price?ids=${tokenId}&vs_currencies=usd`)
.then((response: { data: { [key: string]: { usd: number } } }) =>
Expand Down
44 changes: 23 additions & 21 deletions src/common/api/indexer/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,16 @@ export const useAccountActivePots = ({
* https://test-dev.potlock.io/api/schema/swagger-ui/#/v1/v1_accounts_list_registrations_retrieve
*/
export const useAccountListRegistrations = ({
enabled = true,
accountId,
...params
}: Partial<ByAccountId> & generatedClient.V1AccountsListRegistrationsRetrieveParams) => {
const queryResult = generatedClient.useV1AccountsListRegistrationsRetrieve(
accountId ?? "noop",
params,
{ ...INDEXER_CLIENT_CONFIG, swr: { enabled: Boolean(accountId) } },
);
}: ByAccountId &
generatedClient.V1AccountsListRegistrationsRetrieveParams &
ConditionalActivation) => {
const queryResult = generatedClient.useV1AccountsListRegistrationsRetrieve(accountId, params, {
...INDEXER_CLIENT_CONFIG,
swr: { enabled },
});

return { ...queryResult, data: queryResult.data?.data };
};
Expand Down Expand Up @@ -164,14 +166,14 @@ export const usePotDonations = ({
* https://test-dev.potlock.io/api/schema/swagger-ui/#/v1/v1_accounts_donations_sent_retrieve
*/
export const useAccountDonationsSent = ({
enabled = true,
accountId,
...params
}: ByAccountId & generatedClient.V1AccountsDonationsSentRetrieveParams) => {
const queryResult = generatedClient.useV1AccountsDonationsSentRetrieve(
accountId,
params,
INDEXER_CLIENT_CONFIG,
);
}: ByAccountId & generatedClient.V1AccountsDonationsSentRetrieveParams & ConditionalActivation) => {
const queryResult = generatedClient.useV1AccountsDonationsSentRetrieve(accountId, params, {
...INDEXER_CLIENT_CONFIG,
swr: { enabled },
});

return { ...queryResult, data: queryResult.data?.data };
};
Expand Down Expand Up @@ -239,15 +241,14 @@ export const useRandomListRegistration = ({
* https://test-dev.potlock.io/api/schema/swagger-ui/#/v1/v1_lists_registrations_retrieve
*/
export const useListRegistrations = ({
enabled = true,
listId,
...params
}: Partial<ByListId> & generatedClient.V1ListsRegistrationsRetrieveParams) => {
const queryResult = generatedClient.useV1ListsRegistrationsRetrieve(
listId ?? 0,
params,

{ ...INDEXER_CLIENT_CONFIG, swr: { enabled: Boolean(listId) } },
);
}: ByListId & generatedClient.V1ListsRegistrationsRetrieveParams & ConditionalActivation) => {
const queryResult = generatedClient.useV1ListsRegistrationsRetrieve(listId, params, {
...INDEXER_CLIENT_CONFIG,
swr: { enabled },
});

return { ...queryResult, data: queryResult.data?.data };
};
Expand All @@ -266,12 +267,13 @@ export const useLists = ({ ...params }: generatedClient.V1ListsRetrieveParams =
* https://test-dev.potlock.io/api/schema/swagger-ui/#/v1/v1_accounts_upvoted_lists_retrieve
*/
export const useAccountUpvotedLists = ({
enabled = true,
accountId,
...params
}: { accountId: string } & generatedClient.V1AccountsUpvotedListsRetrieveParams) => {
}: ByAccountId & generatedClient.V1AccountsUpvotedListsRetrieveParams & ConditionalActivation) => {
const queryResult = generatedClient.useV1AccountsUpvotedListsRetrieve(accountId, params, {
...INDEXER_CLIENT_CONFIG,
swr: { enabled: Boolean(accountId) },
swr: { enabled },
});

return {
Expand Down
2 changes: 2 additions & 0 deletions src/common/api/indexer/internal/client.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,8 @@ export interface ListRegistration {
admin_notes?: string | null;
/** Registration id. */
readonly id: number;
/** List registered. */
readonly list_id: number;
registered_by: Account;
registrant: Account;
/**
Expand Down
4 changes: 0 additions & 4 deletions src/common/api/intear-prices/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { ByTokenId, type WithDisabled } from "@/common/types";

import * as generatedClient from "./internal/client.generated";
import { PRICES_REQUEST_CONFIG } from "./internal/config";
import { REQUEST_CONFIG } from "./internal/config";

/**
* https://prices.intear.tech/swagger-ui/#/Token%20Prices/get_get_token_price
*/
export const useTokenUsdPrice = ({ tokenId, disabled = false }: ByTokenId & WithDisabled) => {
const queryResult = generatedClient.useGetSuperPrecisePrice(
{ token_id: tokenId },
{ ...PRICES_REQUEST_CONFIG, swr: { enabled: !disabled } },
{ ...REQUEST_CONFIG, swr: { enabled: !disabled } },
);

return { ...queryResult, data: queryResult.data?.data };
Expand Down
3 changes: 3 additions & 0 deletions src/common/api/intear-token-indexer/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * as intearPricesClient from "./internal/client.generated";
export * as intearTokenIndexerHooks from "./hooks";
export * from "./types";
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { AxiosRequestConfig } from "axios";
/**
* Request config for SWR
*/
export const PRICES_REQUEST_CONFIG: Record<"axios", AxiosRequestConfig> = {
export const REQUEST_CONFIG: Record<"axios", AxiosRequestConfig> = {
axios: { baseURL: "https://prices.intear.tech" },
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import axios from "axios";
import { NETWORK, SOCIAL_DB_CONTRACT_ACCOUNT_ID } from "@/common/_config";
import { ClientConfig } from "@/common/types";

export const client = axios.create({
export const nearSocialIndexerClient = axios.create({
baseURL: "https://api.near.social",
});

Expand Down
Loading
Loading