Skip to content

Commit

Permalink
feat(governance): add no motions UI with message
Browse files Browse the repository at this point in the history
  • Loading branch information
fedosov committed Jan 7, 2025
1 parent 5a6fda6 commit 1a57961
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 10 additions & 1 deletion app/routes/governance.motions.client.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, useEffect, useRef } from "react";
import { useTranslation } from "react-i18next";
import { Card, Elevation, Spinner, Switch, Classes } from "@blueprintjs/core";
import { Card, Elevation, Spinner, Switch, Classes, Icon } from "@blueprintjs/core";
import { useApi, useAccounts } from "app/components/Api";
import { DeriveCollectiveProposal } from "@polkadot/api-derive/types";
import useToaster from "app/hooks/useToaster";
Expand Down Expand Up @@ -274,6 +274,15 @@ export default function GovernanceMotions() {
return <Spinner />;
}

if (motions.length === 0) {
return (
<div className="flex flex-col items-center justify-center h-full py-20 text-center text-gray-500">
<Icon icon="inbox" iconSize={50} className="mb-4" />
<div className="text-lg">{t("governance.no_motions")}</div>
</div>
);
}

const isSelectedCouncilMember = selectedAddress ? isCouncilMember(selectedAddress) : false;

return (
Expand Down
3 changes: 2 additions & 1 deletion app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@
"bounty_next_action_active": "Waiting for bounty completion",
"bounty_next_action_update_overdue": "Update from curator is overdue",
"bounty_next_action_pending_payout": "Waiting for payout",
"bounty_next_action_claim_payout": "Claim payout"
"bounty_next_action_claim_payout": "Claim payout",
"no_motions": "No motions available."
}
}
}

0 comments on commit 1a57961

Please sign in to comment.