Skip to content

Commit

Permalink
added all, updated members page
Browse files Browse the repository at this point in the history
  • Loading branch information
Megha-Dev-19 committed Apr 5, 2024
1 parent 455f56e commit c46c912
Show file tree
Hide file tree
Showing 4 changed files with 270 additions and 309 deletions.
11 changes: 6 additions & 5 deletions apps/astraplusplus/widget/CreateDAO/Step4.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ for (const role of initialAnswers.policy.roles) {
const initialState = {
roles: initialAnswers.policy.roles.length
? initialAnswers.policy.roles.map((r) => r.name)
: ["council"],
: ["council", "all"],
members: initialMembers.length
? initialMembers
: [{ role: "council", name: accountId }]
Expand Down Expand Up @@ -219,9 +219,10 @@ return (
<div>
<h3 className="h6 fw-bold">Add Groups</h3>
<p className="text-black-50 fw-light small">
Adding groups to DAO during creation is not supported using web
based wallets. Anyway, you can add more groups later in DAO
settings
You can add members and assign them various roles, with
permissions customizable in the next step. The 'All' group
includes everyone; you can remove it if you wish to limit
interactions to selected individuals within your DAO.
</p>
</div>
<Widget
Expand Down Expand Up @@ -367,7 +368,7 @@ return (
placeholder: "Role",
size: "lg",
options: state.answers.roles
.filter((r) => r !== null && r !== "")
.filter((r) => r !== null && r !== "" && r !== "all")
.map((r) => ({
title: r,
value: r
Expand Down
12 changes: 7 additions & 5 deletions apps/astraplusplus/widget/CreateDAO/Step6.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,13 @@ return (
}}
/>
</div>
{state.members.Group && Array.isArray(state.members.Group)
? state.members.Group.map((i) => (
<div className="border-bottom p-2">{i}</div>
))
: state.members}
<div className="text-truncate w-100">
{state.members.Group && Array.isArray(state.members.Group)
? state.members.Group.map((i) => (
<div className="border-bottom p-2">{i}</div>
))
: state.members}
</div>
</div>
<div
className="d-flex flex-column gap-2 p-4 flex-1"
Expand Down
76 changes: 17 additions & 59 deletions apps/astraplusplus/widget/DAO/Members/MembersGroup.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const data = props.data;
const policy = props.policy;
const currentPage = props.page ?? 1;
const resPerPage = props.resPerPage ?? 20;
const resPerPage = props.resPerPage ?? 21;
const isCongressDaoID = props.isCongressDaoID ?? false;
const isVotingBodyDao = props.isVotingBodyDao ?? false;
const accountId = props.accountId ?? context.accountId;
Expand Down Expand Up @@ -375,10 +375,10 @@ const Table = ({ title, tableData, showExpand }) => {
Spam Votes
<i class="bi bi-arrow-down"></i>
</th>
<th>
{/* <th>
Proposals <br />
Accepted/ Created
</th>
</th> */}
</tr>
</thead>
<tbody style={{ position: "relative" }}>
Expand All @@ -389,14 +389,16 @@ const Table = ({ title, tableData, showExpand }) => {
{tableData?.map((item) => {
return (
<tr className={isCongressDaoID && "opacity-low"}>
<td>
<Widget
src="mob.near/widget/Profile.ShortInlineBlock"
props={{
accountId: item.account,
tooltip: true
}}
/>
<td style={{ maxWidth: "300px" }}>
<div className="text-truncate w-100">
<Widget
src="mob.near/widget/Profile.ShortInlineBlock"
props={{
accountId: item.account,
tooltip: true
}}
/>
</div>
</td>
{state.selectedView === viewTypes.LIST && (
<td className="role-tag-td">
Expand All @@ -407,33 +409,13 @@ const Table = ({ title, tableData, showExpand }) => {
<td> {item.approve}</td>
<td> {item.rejected}</td>
<td>{item.spamVotes ?? 0}</td>
<td>
{/* <td>
{item.acceptedProposals} / {item.totalProposals}
</td>
</td> */}
<td className="d-flex gap-2 align-items-center">
<Widget
src="nearui.near/widget/Input.Button"
props={{
children: (
<a
href={`#//*__@appAccount__*//widget/home?page=votinghistory`}
target="_blank"
rel="noopener noreferrer"
style={{
color: "rgb(68, 152, 224)"
}}
>
<i class="bi bi-clock-history"></i>
</a>
),
size: "sm",
variant: "icon info outline"
}}
/>
{/* we don't show propose to mint and remove for congress dao */}
{!isCongressDaoID && !isVotingBodyDao && (
<div className="d-flex gap-2 align-items-center">
<ProposeToMintSBT itemDetails={item} />
<ProposeToRemove user={item.account} />
</div>
)}
Expand Down Expand Up @@ -928,35 +910,11 @@ return (
}}
></div>
{!isCongressDaoID && !isVotingBodyDao && (
<div className="d-flex justify-content-between">
<ProposeToMintSBT itemDetails={item} />
<div className="d-flex justify-content-center">
{/* <ProposeToMintSBT itemDetails={item} /> */}
<ProposeToRemove user={item.account} />
</div>
)}
<Widget
src="nearui.near/widget/Input.Button"
props={{
buttonProps: {
style: {
width: "inherit"
}
},
children: (
<a
href={`#//*__@appAccount__*//widget/home?page=votinghistory`}
target="_blank"
rel="noopener noreferrer"
style={{
color: "rgb(68, 152, 224)"
}}
>
View Voting History
</a>
),
variant: "info outline",
size: "sm"
}}
/>
</div>
);
})}
Expand Down
Loading

0 comments on commit c46c912

Please sign in to comment.