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

Dev #471

Draft
wants to merge 241 commits into
base: main
Choose a base branch
from
Draft

Dev #471

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
241 commits
Select commit Hold shift + click to select a range
6c7816f
Merge remote-tracking branch 'origin/Batch-fix' into beta
Corantin Sep 12, 2024
b38e22e
Fix coucil safe not seeing buttons
Corantin Sep 13, 2024
7b69f79
Merge branch 'Batch-fix' into beta
Mati0x Sep 13, 2024
9e33a59
fix-pool-form-conviction-growth-not-converted
Corantin Sep 11, 2024
c1e6a91
Merge branch 'gnosis-deploy-0.0.4' into beta
Corantin Sep 16, 2024
c39a314
Merge branch 'dev' into beta
Corantin Sep 16, 2024
6d24e74
Merge remote-tracking branch 'origin/dev' into beta
Corantin Sep 18, 2024
e97fbf8
Merge branch 'fix-not-loading-when-wrong-network' into beta
Corantin Sep 18, 2024
117cc94
Merge branch 'tooltip-not-visible' into beta
Corantin Sep 18, 2024
f49c0f5
Merge remote-tracking branch 'origin/dev' into beta
Corantin Sep 18, 2024
47cfd8b
Merge branch 'mobile-connect-button' into beta
Corantin Sep 24, 2024
db584ed
Merge branch 'gnosis-deploy-0.0.4' into beta
Corantin Sep 26, 2024
6255684
Use sub version v4
Corantin Sep 26, 2024
29c47b2
Merge remote-tracking branch 'origin/magic-number' into beta
Corantin Sep 26, 2024
648e2f6
:recycle: Refactored daily job route for multi-chain support
Corantin Oct 11, 2024
c2f68ab
Merge branch 'dev' into beta
Corantin Oct 15, 2024
cef6c57
Merge branch 'dev' into beta
Corantin Oct 15, 2024
1f20af2
Merge branch 'dev' into beta
Corantin Oct 15, 2024
b8ed4dc
Merge branch 'dev' into beta
Corantin Oct 15, 2024
8135990
Merge branch 'dev' into beta
Corantin Oct 16, 2024
6bad13b
Merge branch 'dev' into beta
Corantin Oct 16, 2024
3f398f5
Merge branch 'dev' into beta
Corantin Oct 16, 2024
fdb9067
Merge branch 'dev' into beta
Corantin Oct 16, 2024
a279142
Merge branch 'dev' into beta
Corantin Oct 16, 2024
5358dc2
:arrow_up: Bump production version
Corantin Oct 17, 2024
de83129
Initial commit for registry and CV logic changes
kafann Oct 17, 2024
43200e6
Fixed tests, new to add tests for setCommunityParams func
kafann Oct 17, 2024
908bea2
:recycle: Refactored subgraph URL generation
Corantin Oct 18, 2024
c825532
Merge branch 'dev' into plug-subgraph-protocol
Corantin Oct 18, 2024
5880de8
:recycle: Updated subgraph URL retrieval method
Corantin Oct 18, 2024
78dad7c
Merge remote-tracking branch 'origin/plug-subgraph-protocol' into plu…
Corantin Oct 18, 2024
35617c6
Merge branch 'dev' into beta
Corantin Oct 18, 2024
3b3664f
:art: Refactor button and dispute components
Corantin Oct 18, 2024
8c2534b
Merge branch 'main' into dev
Corantin Oct 18, 2024
19c9c88
Merge branch 'dev' into beta
Corantin Oct 18, 2024
0e101cd
:recycle: Improved address display and button conditions
Corantin Oct 18, 2024
11ce525
Merge remote-tracking branch 'origin/dev' into dev
Corantin Oct 18, 2024
97db6fa
Merge branch 'dev' into beta
Corantin Oct 18, 2024
d54da4a
:recycle: Refactored dispute button and pool form components
Corantin Oct 18, 2024
2ea917e
Merge branch 'dev' into beta
Corantin Oct 18, 2024
2c2f138
:art: Adjusted CSS classes in garden pages
Corantin Oct 18, 2024
47082be
Merge branch 'dev' into beta
Corantin Oct 18, 2024
40154d5
:sparkles: Enhanced TooltipIfOverflow component
Corantin Oct 18, 2024
da78c22
Merge branch 'dev' into beta
Corantin Oct 18, 2024
aa1f63d
:ambulance: Fix contract emptied the allowlist when setPoolParams cal…
Corantin Oct 19, 2024
0f189c8
Merge branch 'dev' into beta
Corantin Oct 19, 2024
d776819
:ambulance: Fix member stake not reset in pool when deactivating
Corantin Oct 20, 2024
095cd5a
Merge branch 'dev' into beta
Corantin Oct 20, 2024
fbd8775
:art: Improved UI responsiveness
Corantin Oct 20, 2024
0577ecf
Merge branch 'dev' into beta
Corantin Oct 20, 2024
77bb5b2
:bug: :ambulance: Remove bypass to trigger auto-repair
Corantin Oct 20, 2024
de865ee
Merge branch 'dev' into beta
Corantin Oct 20, 2024
e1da13d
:art: Enhanced Ethereum address display
Corantin Oct 20, 2024
3d0f36c
Merge branch 'dev' into beta
Corantin Oct 20, 2024
15f3145
:recycle: Removed unused imports and debug logs
Corantin Oct 20, 2024
c24da41
Merge branch 'dev' into beta
Corantin Oct 20, 2024
85b45d9
Merge branch 'dev' into plug-subgraph-protocol
Corantin Oct 20, 2024
54b3ca0
Merge pull request #470 from 1Hive/plug-subgraph-protocol
Corantin Oct 20, 2024
15d5709
order garden cards by communities length from most to least
Mati0x Oct 21, 2024
5bcb025
Bump subgraph to v0.1.2
Corantin Oct 22, 2024
be15239
order garden card by communities length from most to least
Mati0x Oct 22, 2024
be7e332
order garden card by comm from most to least
Mati0x Oct 22, 2024
9829a09
addt garden card by members when comm length is equal
Mati0x Oct 22, 2024
a8cb885
fix membership stake amount decimals
Lucianosc Oct 23, 2024
edf496e
fix fund pool check balance
Lucianosc Oct 23, 2024
2b1839e
foundry minor fix
Lucianosc Oct 23, 2024
27e9556
Merge remote-tracking branch 'origin/fix/membership-stake-amount-deci…
Mati0x Oct 23, 2024
bad46fc
Merge pull request #474 from 1Hive/fix/membership-stake-amount-decimals
Corantin Oct 23, 2024
e4517eb
Merge branch 'dev' into current-fixes
Mati0x Oct 23, 2024
f14dff5
Merge pull request #473 from 1Hive/current-fixes
Mati0x Oct 23, 2024
6093679
Fix subgraphs with 0.1.4
Corantin Oct 23, 2024
8a506c4
Fix create-pool not loading
Corantin Oct 23, 2024
859a39a
Removed console.log
Corantin Oct 23, 2024
f38699d
Merge branch 'dev' into beta
Corantin Oct 23, 2024
587329e
:fire: Fix Passport Scorer
Corantin Oct 23, 2024
b4f5a63
Merge branch 'dev' into beta
Corantin Oct 23, 2024
23b63ce
Merge remote-tracking branch 'origin/dev' into fix/fund-pool-check-ba…
Lucianosc Oct 24, 2024
69c7003
fix html tags
Lucianosc Oct 24, 2024
e90154c
fix funding amount not updating
Lucianosc Oct 24, 2024
d51496b
Added test and logic for setPendingCouncilSafe
kafann Oct 25, 2024
7ee45fe
Merge branch 'dev' into fix/fund-pool-check-balance
Mati0x Oct 27, 2024
b44f0be
add sharp suggested next img optimizer
Lucianosc Oct 28, 2024
b147772
Merge pull request #476 from 1Hive/fix/fund-pool-check-balance
Mati0x Oct 28, 2024
d70a23b
fix pool header
Mati0x Oct 29, 2024
19b7dac
add display threshold required to pass
Lucianosc Oct 30, 2024
2658458
Merge remote-tracking branch 'origin/dev' into proposalForm/display-t…
Lucianosc Oct 30, 2024
459a030
add validate input when user changes focus
Lucianosc Oct 31, 2024
8b219cf
fix: remove proposal and funds statistic from pool in review
Mati0x Oct 31, 2024
59f5d82
fix: pool form token address
Mati0x Oct 31, 2024
0d500b9
Auto stash before merge of "dev" and "origin/dev"
Corantin Nov 1, 2024
b036e68
Merge branch 'dev' into open-creation
Corantin Nov 1, 2024
862400a
Merge branch 'dev' into open-creation
Corantin Nov 1, 2024
c69d5dd
Fix contracts with coucilsafe transfer, Adapt UI with new contract, l…
Corantin Nov 2, 2024
1923471
Add isMember check + index handleCommunityFeeUpdated
Corantin Nov 2, 2024
c6a6353
add onBlur input validation
Lucianosc Nov 4, 2024
0090bc2
fix eth addr validation
Lucianosc Nov 4, 2024
3e776dc
Merge branch 'dev' into beta
Corantin Nov 5, 2024
14e3159
rename allocate button into "Submit allocation"
Mati0x Nov 5, 2024
2171e2f
Fix min threshold
Corantin Nov 6, 2024
1ff03b3
Fix calculateThreshold cannot divide by zero + subgraph missing Fee…
Corantin Nov 7, 2024
b1ccbf1
Run latest
Corantin Nov 7, 2024
d2cca78
feat: Commit: rename allocation button and update proposal page chart
Mati0x Nov 7, 2024
7074e4d
fix: remove minimum conviction from pool edit settings + remove defau…
Mati0x Nov 7, 2024
f7da6ed
Adjust `PoolCard` height based on content and rename "id" into "pool …
Mati0x Nov 7, 2024
92d87bb
Covenant signature pushed to onchain events
Corantin Nov 8, 2024
2916c23
New subgraph for covenant
Corantin Nov 8, 2024
d689b9f
Cherry pick covenant sig
Corantin Nov 8, 2024
5db4ef8
Cleanup sub mapping registry
Corantin Nov 8, 2024
bbab264
Subgraph fix community covenant sig
Corantin Nov 8, 2024
1973b3c
Subgraph fix community covenant sig
Corantin Nov 8, 2024
d280313
Subgraph fix community covenant sig
Corantin Nov 8, 2024
87425a6
Subgraph fix community covenant sig
Corantin Nov 8, 2024
5da99d0
Merge remote-tracking branch 'origin/dev' into dev
Corantin Nov 8, 2024
a023d0c
Fix registry member added
Corantin Nov 8, 2024
00aa527
Fix registry member added
Corantin Nov 8, 2024
d591413
Fixed allocate points
Corantin Nov 9, 2024
d0e95d2
Make passport and arbitrator proxy upgreadable
Corantin Nov 9, 2024
fafbdf2
Merge branch 'dev' into open-creation
Corantin Nov 9, 2024
47a7deb
Fix build
Corantin Nov 9, 2024
09208bc
Merge pull request #489 from 1Hive/open-creation
Corantin Nov 9, 2024
e5c3f73
Merge branch 'main' into dev
Corantin Nov 9, 2024
456175c
Error fallback
Corantin Nov 10, 2024
16a4047
Merge remote-tracking branch 'origin/dev' into dev
Corantin Nov 10, 2024
167f76f
New deploy + subgraph 0.2.0
Corantin Nov 10, 2024
f6f0ab3
Fix register skipping token expenditure
Corantin Nov 10, 2024
75e6b30
Fix Fund pool buggy allowance
Corantin Nov 10, 2024
5b0e9ed
Fix pool metric null ref
Corantin Nov 10, 2024
36b08b6
Fix subgraph build client
Corantin Nov 11, 2024
0c23363
Merge remote-tracking branch 'origin/dev' into fixing-beta-v2
Mati0x Nov 11, 2024
dd7223c
fix: upgarde `ProposalCard` + small tweks
Mati0x Nov 11, 2024
af1d6a3
Merge remote-tracking branch 'origin/dev' into proposalForm/display-t…
Mati0x Nov 11, 2024
3a68083
upgrade description
Mati0x Nov 11, 2024
f5a7fa2
fix lint
Mati0x Nov 11, 2024
9671abc
Fix lint
Corantin Nov 11, 2024
72bf3c3
Merge remote-tracking branch 'origin/dev' into fixing-beta-v2
kafann Nov 11, 2024
52873f9
Fix build contracts
Corantin Nov 11, 2024
92d2d8d
Merge remote-tracking branch 'origin/dev' into fixing-beta-v2
kafann Nov 11, 2024
34d5c5b
Merge branch 'dev' into proposalForm/display-threshold
Mati0x Nov 12, 2024
814d4ee
Merge pull request #478 from 1Hive/proposalForm/display-threshold
Mati0x Nov 12, 2024
8d846de
minor fix for very long proposal names - `ProposalCard`
Mati0x Nov 12, 2024
3c40ddc
fix: remove pool id from `PoolHeader`
Mati0x Nov 12, 2024
6f4b40f
enhance manage support overview section
Mati0x Nov 13, 2024
68c28bd
Fixed wrong token + Access proposal support from proposal Details page
kafann Nov 14, 2024
6459232
enhance manage support button in proposalId page
Mati0x Nov 14, 2024
b0eed41
Upgrade contracts artefacts
Corantin Nov 15, 2024
4f8d959
Merge branch 'dev' into fixing-beta-v2
Corantin Nov 15, 2024
18d1de4
Finished token fix in pools, and finish adding manage support access …
kafann Nov 15, 2024
138492d
Fix linter
Corantin Nov 15, 2024
00c31d4
Merge branch 'dev' into upgrade-support-overview
Corantin Nov 15, 2024
522a606
Merge branch 'dev' into fixing-beta-v2
Corantin Nov 15, 2024
de17778
fix text
Mati0x Nov 15, 2024
164a26b
Merge pull request #493 from 1Hive/upgrade-support-overview
Corantin Nov 15, 2024
f4e2c78
Merge branch 'dev' into fixing-beta-v2
Corantin Nov 15, 2024
27cb081
Fix Allocations problems
Corantin Nov 16, 2024
1dda65a
Add support for view function CalculateProposalConviction
Corantin Nov 17, 2024
b454a1c
minor layout fix
Mati0x Nov 18, 2024
2279125
Merge branch 'dev' into fixing-beta-v2
Mati0x Nov 18, 2024
1f31225
Merge pull request #491 from 1Hive/fixing-beta-v2
Mati0x Nov 18, 2024
3f1d709
Cleanup
Corantin Nov 20, 2024
2ca52af
fix stake in community in `Pool Governance`
Mati0x Nov 21, 2024
1547ddd
feat: add Pool staked cap amount in capped pool types
Mati0x Nov 21, 2024
ac1f627
feat: add warning infoBox component in `PoolHeader` when min Threshol…
Mati0x Nov 21, 2024
cfec7a9
Last upgrade
Corantin Nov 22, 2024
5c4982d
minor `Pool Header` upgrade
Mati0x Nov 23, 2024
7394d01
New subgraph with passport fix
Corantin Nov 23, 2024
d1e4bd5
feat: disable Dispute Modal button and Manage Support Button in Propo…
Mati0x Nov 24, 2024
664f782
New deploy
Corantin Nov 24, 2024
eeb8ad2
New deploy
Corantin Nov 26, 2024
09c7c91
Subgraph 0.2.4
Corantin Nov 26, 2024
bbe6e99
Merge branch 'dev' into beta
Corantin Nov 26, 2024
dab5216
Merge branch 'dev' into fixing-dev
Mati0x Nov 26, 2024
59100ec
Merge branch 'fixing-dev' into dev
Mati0x Nov 26, 2024
b7bc6e2
Merge branch 'fixing-dev' into beta
Mati0x Nov 26, 2024
c10c742
fix label naming
Mati0x Nov 26, 2024
1735112
fix `ProposalForm`: now showing max amount requested and threshold ne…
Mati0x Nov 27, 2024
2a59f4d
Update apps/web/components/Forms/ProposalForm.tsx
Mati0x Nov 27, 2024
b88ec3a
Fix staked token undefined when no stakes
Corantin Nov 27, 2024
fbbb192
Merge remote-tracking branch 'origin/dev' into dev
Corantin Nov 27, 2024
2aad96b
Merge pull request #498 from 1Hive/fixing-dev-2
Corantin Nov 27, 2024
1ea0888
Fix stkedToken of undefined
Corantin Nov 27, 2024
382e5a6
Merge remote-tracking branch 'origin/dev' into dev
Corantin Nov 27, 2024
8e8c1a2
Merge branch 'dev' into beta
Corantin Nov 27, 2024
4764c01
New deploy with fix for arbitrum
Corantin Nov 27, 2024
967f5d8
reject pool done, need to confirm when we want it or not before merge…
kafann Nov 28, 2024
7e09636
Subgraph done and contract write + relocation done
kafann Nov 29, 2024
40758e1
Use bigint for allocation computations to avoid number conversion error
Corantin Nov 30, 2024
fd516aa
Changed onSuccess for onConfirm, transaction completed toast wasnt sh…
kafann Nov 30, 2024
a99c5a9
Fix typing
Corantin Dec 2, 2024
cca052c
Merge pull request #499 from 1Hive/fix-quadratic-allocation
Corantin Dec 2, 2024
6b7d40f
Change subgraph id
Corantin Dec 2, 2024
2625248
Merge remote-tracking branch 'origin/dev' into dev
Corantin Dec 2, 2024
d8d048e
Merge remote-tracking branch 'origin/dev' into dev
Corantin Dec 2, 2024
89d8ff2
Merge remote-tracking branch 'origin/dev' into dev
Corantin Dec 2, 2024
f3a6eb7
Merge branch 'dev' into beta
Corantin Dec 2, 2024
74f5d98
Add is Owner to safe abi
Corantin Dec 2, 2024
da57297
Add is Owner to safe abi
Corantin Dec 2, 2024
0942e84
Fix build
Corantin Dec 2, 2024
50e4132
Try fix
Corantin Dec 2, 2024
9336538
Merge branch 'dev' into beta
Corantin Dec 2, 2024
1ed4460
Pushed old account for arbsep
Corantin Dec 6, 2024
76850b8
Pushed old account for arbsep
Corantin Dec 6, 2024
3bf2605
fix buttons disable state in pool page
Mati0x Dec 6, 2024
6aef390
fix slider in `ProposalCard`
Mati0x Dec 6, 2024
6d89d21
fix minimun conviction input in `PoolForm` to allow 0 value
Mati0x Dec 6, 2024
5475e15
Fix infinite proposal loading
Corantin Dec 6, 2024
e4305a1
Merge remote-tracking branch 'origin/dev' into dev
Corantin Dec 6, 2024
df21908
Merge branch 'dev' into beta
Corantin Dec 6, 2024
fe1e369
upgrade subgraph endpoint + create query `getProposalSupporter`s + fe…
Mati0x Dec 6, 2024
6dd634e
Merge branch 'dev' into small-fixes
Corantin Dec 7, 2024
f5fe1e6
fix manage support button disable state
Mati0x Dec 7, 2024
f00f43e
Merge remote-tracking branch 'origin/dev' into reject-pool
Corantin Dec 7, 2024
6b2312e
Merge remote-tracking branch 'origin/dev' into reject-pool
Corantin Dec 7, 2024
9388363
Cleanup reject pool UX
Corantin Dec 7, 2024
3aec24d
Merge pull request #500 from 1Hive/reject-pool
Corantin Dec 7, 2024
833ad7d
Merge remote-tracking branch 'origin/dev' into beta
Corantin Dec 7, 2024
766e663
Merge remote-tracking branch 'origin/beta' into dev
Corantin Dec 7, 2024
a585605
add filtered data
Mati0x Dec 7, 2024
034f35a
feat: add `ProposalSupportersTable`
Mati0x Dec 7, 2024
bd17249
feat: add role info in `ProposalSupportersTable` + add total support …
Mati0x Dec 9, 2024
7970af4
small fix
Mati0x Dec 9, 2024
bf3a648
Merge branch 'dev' into small-fixes
Corantin Dec 9, 2024
1caf5ac
feat: add tooltip for ended proposals
Mati0x Dec 10, 2024
67c651c
upgrade `ProposalSupporters`
Mati0x Dec 10, 2024
2c73a08
feat: update proposalData query to add council safe addres
Mati0x Dec 10, 2024
6c1e56d
add variable to query
Mati0x Dec 10, 2024
f55544e
remove coucill safe is member logic for `ProposalSupportersTable`
Mati0x Dec 11, 2024
57242e3
fix safePrefix for council safe inks
Mati0x Dec 11, 2024
effe34f
New reset 0.3.0
Corantin Dec 11, 2024
3239afe
Merge branch 'dev' into small-fixes
Corantin Dec 11, 2024
582021b
Merge branch 'dev' into proposal-supporters
Mati0x Dec 12, 2024
7124d8d
Merge branch 'proposal-supporters' into dev
Mati0x Dec 12, 2024
b5501eb
Merge branch 'small-fixes' into dev
Mati0x Dec 12, 2024
90dbedd
add text error for "voting protection" input in `PoolForm`
Mati0x Dec 17, 2024
6f2eec7
Add way to skip published subgraphj
Corantin Dec 18, 2024
0c49706
Better force subgraph published
Corantin Dec 18, 2024
98d5055
Have a way show archived pools
Corantin Dec 18, 2024
cb34f08
Have a way show archived pools
Corantin Dec 18, 2024
af22c74
Subgraph queries for always retun archived
Corantin Dec 18, 2024
7f00d77
New upgrade for strategies
Corantin Dec 18, 2024
4867fcc
Make proposal in archived pool cancellable
Corantin Dec 18, 2024
877a08f
quick fix
Mati0x Dec 20, 2024
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
  •  
  •  
  •  

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function Page({
}) {
const { data } = useSubgraphQuery<getPoolDataQuery>({
query: getPoolDataDocument,
variables: { poolId: poolId, garden: garden },
variables: { poolId: poolId, garden: garden.toLowerCase() },
});
const strategyObj = data?.cvstrategies?.[0];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { useEffect } from "react";
import { useEffect, useRef } from "react";
import { Address } from "viem";
import { useToken } from "wagmi";
import {
Expand All @@ -27,10 +27,11 @@ export default function Page({
params: { chain: string; poolId: number; garden: string };
}) {
const searchParams = useCollectQueryParams();
const proposalSectionRef = useRef<HTMLDivElement>(null);

const { data, refetch, error } = useSubgraphQuery<getPoolDataQuery>({
query: getPoolDataDocument,
variables: { poolId: poolId, garden: garden },
variables: { poolId: poolId, garden: garden.toLowerCase() },
changeScope: [
{
topic: "pool",
Expand All @@ -55,7 +56,6 @@ export default function Page({
},
],
});

const strategyObj = data?.cvstrategies?.[0];
const poolTokenAddr = strategyObj?.token as Address;
const proposalType = strategyObj?.config.proposalType;
Expand Down Expand Up @@ -105,6 +105,23 @@ export default function Page({

const tokenGarden = data?.tokenGarden;

const maxAmount = strategyObj?.config?.maxAmount ?? 0;

useEffect(() => {
if (
searchParams[QUERY_PARAMS.poolPage.allocationView] !== undefined &&
proposalSectionRef.current
) {
const elementTop =
proposalSectionRef.current.getBoundingClientRect().top + window.scrollY;
window.scrollTo({
top: elementTop - 130,
behavior: "smooth",
});
}
// setAllocationView(searchParams[QUERY_PARAMS.poolPage.allocationView]);
}, [proposalSectionRef.current, searchParams]);

if (!tokenGarden || (!poolToken && PoolTypes[proposalType] === "funding")) {
return (
<div className="mt-96">
Expand Down Expand Up @@ -133,7 +150,7 @@ export default function Page({
poolId={poolId}
ipfsResult={ipfsResult}
isEnabled={isEnabled}
chainId={chain}
maxAmount={maxAmount}
/>
{isEnabled && (
<>
Expand All @@ -147,6 +164,10 @@ export default function Page({
chainId={chain}
/>
)}
</>
)}
{strategyObj && isEnabled && (
<section ref={proposalSectionRef}>
<Proposals
poolToken={poolToken}
strategy={strategyObj}
Expand All @@ -155,7 +176,7 @@ export default function Page({
createProposalUrl={`/gardens/${chain}/${garden}/${communityAddress}/${poolId}/create-proposal`}
proposalType={proposalType}
/>
</>
</section>
)}
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ export default function Page({
}) {
const { data: result } = useSubgraphQuery<getPoolCreationDataQuery>({
query: getPoolCreationDataDocument,
variables: { communityAddr: community, tokenAddr: garden },
variables: {
communityAddr: community.toLowerCase(),
tokenAddr: garden.toLowerCase(),
},
});
let token = result?.tokenGarden;
let alloAddr = result?.allos[0]?.id as Address;
Expand Down
113 changes: 85 additions & 28 deletions apps/web/app/(app)/gardens/[chain]/[garden]/[community]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
"use client";

import React, { useEffect, useRef, useState } from "react";
import React, { Fragment, useEffect, useRef, useState } from "react";
import {
CurrencyDollarIcon,
PlusIcon,
RectangleGroupIcon,
UserGroupIcon,
} from "@heroicons/react/24/outline";
import { Dnum } from "dnum";
import { Dnum, multiply } from "dnum";
import Image from "next/image";
import Link from "next/link";
import { Address } from "viem";
import { useAccount, useToken } from "wagmi";
import { useAccount, useContractRead, useToken } from "wagmi";
import {
getCommunityDocument,
getCommunityQuery,
Expand All @@ -38,10 +38,10 @@ import { QUERY_PARAMS } from "@/constants/query-params";
import { useCollectQueryParams } from "@/contexts/collectQueryParams.context";
import { useDisableButtons } from "@/hooks/useDisableButtons";
import { useSubgraphQuery } from "@/hooks/useSubgraphQuery";
import { safeABI } from "@/src/generated";
import { PoolTypes } from "@/types";
import { fetchIpfs } from "@/utils/ipfsUtils";
import {
dn,
parseToken,
SCALE_PRECISION,
SCALE_PRECISION_DECIMALS,
Expand All @@ -66,15 +66,29 @@ export default function Page({
refetch,
} = useSubgraphQuery<getCommunityQuery>({
query: getCommunityDocument,
variables: { communityAddr: communityAddr, tokenAddr: tokenAddr },
variables: {
communityAddr: communityAddr.toLowerCase(),
tokenAddr: tokenAddr.toLowerCase(),
},
changeScope: [
{ topic: "community", id: communityAddr },
{ topic: "member", containerId: communityAddr },
],
});

const registryCommunity = result?.registryCommunity;

const { data: isCouncilMember } = useContractRead({
address: registryCommunity?.councilSafe as Address,
abi: safeABI,
functionName: "isOwner",
chainId: Number(chain),
enabled: !!accountAddress,
args: [accountAddress as Address],
onError: () => {
console.error("Error reading isOwner from Coucil Safe");
},
});

let {
communityName,
members,
Expand Down Expand Up @@ -143,7 +157,35 @@ export default function Page({
);
const activePools = strategies?.filter((strategy) => strategy?.isEnabled);

const poolsInReview = strategies.filter((strategy) => !strategy.isEnabled);
const poolsInReview = strategies.filter(
(strategy) => !strategy.isEnabled && !strategy.archived,
);

const poolsArchived = strategies.filter((strategy) => strategy.archived);

// const [tokenDataArray, setTokenDataArray] = useState([]);

// useEffect(() => {
// // Initialize an empty array for holding token data for each pool
// const newTokenDataArray = fundingPools.map((pool) => ({
// poolId: pool.poolId,
// tokenData: null ,
// }));

// // Iterate over each pool and use `useToken` to get token data
// fundingPools.forEach((pool, index) => {
// const { data } = useToken({
// address: pool.token as Address,
// chainId: +chain,
// });

// // Update the tokenData in the array for this specific pool
// newTokenDataArray[index].tokenData = data;
// });

// // Once data is fetched, update the state
// setTokenDataArray(newTokenDataArray);
// }, [fundingPools, chain]);

useEffect(() => {
const newPoolId = searchParams[QUERY_PARAMS.communityPage.newPool];
Expand Down Expand Up @@ -188,17 +230,17 @@ export default function Page({
const membership = [
BigInt(registerStakeAmount),
Number(tokenGarden!.decimals),
] as dn.Dnum;
] as Dnum;
const feePercentage = [
BigInt(communityFee),
SCALE_PRECISION_DECIMALS, // adding 2 decimals because 1% == 10.000 == 1e4
] as dn.Dnum;
] as Dnum;

return dn.multiply(membership, feePercentage);
return multiply(membership, feePercentage);
} catch (err) {
console.error(err);
}
return [0n, 0] as dn.Dnum;
return [0n, 0] as Dnum;
};

const registrationAmount = [
Expand Down Expand Up @@ -238,7 +280,11 @@ export default function Page({
<div className="flex flex-1 flex-col gap-2">
<div>
<h2>{communityName}</h2>
<EthAddress icon={false} address={communityAddr as Address} />
<EthAddress
icon={false}
address={communityAddr as Address}
label="Community address"
/>
</div>
<div className="flex flex-col gap-2">
<Statistic
Expand Down Expand Up @@ -311,14 +357,9 @@ export default function Page({
</h4>
<div className="flex flex-row flex-wrap gap-10">
{fundingPools.map((pool) => (
<PoolCard
key={pool.poolId}
tokenGarden={{
decimals: tokenGarden?.decimals ?? 18,
symbol: tokenGarden?.symbol ?? "",
}}
pool={pool}
/>
<Fragment key={pool.poolId}>
<PoolCard token={pool.token} chainId={chain} pool={pool} />
</Fragment>
))}
</div>
</div>
Expand All @@ -330,10 +371,8 @@ export default function Page({
{signalingPools.map((pool) => (
<PoolCard
key={pool.poolId}
tokenGarden={{
symbol: tokenGarden?.symbol ?? "",
decimals: tokenGarden?.decimals ?? 18,
}}
token={pool.token}
chainId={chain}
pool={pool}
/>
))}
Expand All @@ -347,15 +386,33 @@ export default function Page({
{poolsInReview.map((pool) => (
<PoolCard
key={pool.poolId}
tokenGarden={{
decimals: tokenGarden?.decimals ?? 18,
symbol: tokenGarden?.symbol ?? "",
}}
token={pool.token}
chainId={chain}
pool={pool}
/>
))}
</div>
</div>
{(!!isCouncilMember ||
accountAddress?.toLowerCase() ===
registryCommunity.councilSafe?.toLowerCase() ||
localStorage.getItem("showArchived") === "true") && (
<div className="flex flex-col gap-4">
<h4 className="text-secondary-content">
Pools archived ({poolsArchived.length})
</h4>
<div className="flex flex-row flex-wrap gap-10">
{poolsArchived.map((pool) => (
<PoolCard
key={pool.poolId}
token={pool.token}
chainId={chain}
pool={pool}
/>
))}
</div>
</div>
)}
</section>
<section ref={covenantSectionRef} className="section-layout">
<h2 className="mb-4">Covenant</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function Page({
const { data: result, error: getCommunityCreationDataQueryError } =
useSubgraphQuery<getCommunityCreationDataQuery>({
query: getCommunityCreationDataDocument,
variables: { addr: garden },
variables: { addr: garden.toLowerCase() },
});

useEffect(() => {
Expand Down
26 changes: 21 additions & 5 deletions apps/web/app/(app)/gardens/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,26 @@ export default function Page() {
return (
<>
{tokenGardens
.sort(
(a, b) =>
(a.communities?.length ?? 0) - (b.communities?.length ?? 0),
)
.sort((a, b) => {
const communitiesDiff =
(b.communities?.length ?? 0) - (a.communities?.length ?? 0);

if (communitiesDiff === 0) {
const aTotalMembers =
a.communities?.reduce(
(sum, community) => sum + (community.members?.length ?? 0),
0,
) ?? 0;
const bTotalMembers =
b.communities?.reduce(
(sum, community) => sum + (community.members?.length ?? 0),
0,
) ?? 0;
return bTotalMembers - aTotalMembers;
}

return communitiesDiff;
})
.map((garden) => (
<div key={garden.id}>
<GardenCard garden={garden} />
Expand Down Expand Up @@ -81,7 +97,7 @@ export default function Page() {
return (
<>
<div className="flex flex-col items-center justify-center gap-8 relative">
<header className="flex flex-col items-center gap-8 2xl:mt-20">
<header className="flex flex-col items-center gap-8">
<div className="flex items-center text-center">
<div className="relative flex-1">
<Image src={clouds1} alt="clouds" width={205} height={205} />
Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import { redirect } from "next/navigation";

export default function Page() {
redirect("/gardens");
}
}
7 changes: 3 additions & 4 deletions apps/web/components/ActivatePoints.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import useCheckAllowList from "@/hooks/useCheckAllowList";
import { useContractWriteWithConfirmations } from "@/hooks/useContractWriteWithConfirmations";
import { ConditionObject, useDisableButtons } from "@/hooks/useDisableButtons";
import { cvStrategyABI } from "@/src/generated";
import { abiWithErrors } from "@/utils/abi";
import { useErrorDetails } from "@/utils/getErrorName";

type ActiveMemberProps = {
Expand Down Expand Up @@ -40,7 +39,7 @@ export function ActivatePoints({
chainId,
address: strategy.id as Address,
contractName: "CV Strategy",
abi: abiWithErrors(cvStrategyABI),
abi: cvStrategyABI,
functionName: "activatePoints",
fallbackErrorMessage: "Error activating points, please report a bug.",
onConfirmations: () => {
Expand All @@ -58,7 +57,7 @@ export function ActivatePoints({
const { write: writeDeactivatePoints, error: errorDeactivatePoints } =
useContractWriteWithConfirmations({
address: strategy.id as Address,
abi: abiWithErrors(cvStrategyABI),
abi: cvStrategyABI,
contractName: "CV Strategy",
functionName: "deactivatePoints",
fallbackErrorMessage: "Error deactivating points, please report a bug.",
Expand Down Expand Up @@ -117,7 +116,7 @@ export function ActivatePoints({
btnStyle={isMemberActivated ? "outline" : "filled"}
color={isMemberActivated ? "danger" : "primary"}
disabled={missmatchUrl || disableActiveBtn || !isAllowed}
tooltip={String(tooltipMessage)}
tooltip={tooltipMessage}
>
{isMemberActivated ? "Deactivate governance" : "Activate governance"}
</Button>
Expand Down
Loading
Loading