Skip to content

Commit fb9c2b8

Browse files
Format phase 87 web refactor
1 parent 9142dae commit fb9c2b8

33 files changed

Lines changed: 117 additions & 123 deletions

src/lib/feedStageStats.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ export function getFeedPoolStats(poolPage: PoolProposalPageDto) {
2121
poolPage.upvoteFloor > 0 ? poolPage.upvotes / poolPage.upvoteFloor : 0,
2222
) * upvoteFloorFractionPercent,
2323
);
24-
const meetsAttention =
25-
engaged / activeGovernors >= poolPage.attentionQuorum;
24+
const meetsAttention = engaged / activeGovernors >= poolPage.attentionQuorum;
2625
const meetsUpvoteFloor = poolPage.upvotes >= poolPage.upvoteFloor;
2726
const engagedNeeded = Math.ceil(poolPage.attentionQuorum * activeGovernors);
2827

@@ -48,9 +47,7 @@ export function getFeedChamberStats(chamberPage: ChamberProposalPageDto) {
4847
const totalVotes = yesTotal + noTotal + abstainTotal;
4948

5049
const engaged = chamberPage.engagedGovernors;
51-
const quorumNeeded = Math.ceil(
52-
activeGovernors * chamberPage.attentionQuorum,
53-
);
50+
const quorumNeeded = Math.ceil(activeGovernors * chamberPage.attentionQuorum);
5451
const quorumPercent = Math.round((engaged / activeGovernors) * 100);
5552
const quorumNeededPercent = Math.round(chamberPage.attentionQuorum * 100);
5653
const yesPercentOfQuorum =
@@ -82,9 +79,7 @@ export function getFeedChamberStats(chamberPage: ChamberProposalPageDto) {
8279
};
8380
}
8481

85-
export function getFeedFormationStats(
86-
formationPage: FormationProposalPageDto,
87-
) {
82+
export function getFeedFormationStats(formationPage: FormationProposalPageDto) {
8883
const progressRaw = Number.parseInt(
8984
formationPage.progress.replace("%", ""),
9085
10,

src/lib/humanNodesUi.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ export type HumanNodesTierFilter =
1515
| "legate"
1616
| "consul"
1717
| "citizen";
18-
export type HumanNodesStatusFilter =
19-
| "all"
20-
| "governor"
21-
| "human"
22-
| "inactive";
18+
export type HumanNodesStatusFilter = "all" | "governor" | "human" | "inactive";
2319
export type HumanNodesCmRange = "all" | "0-50" | "50-200" | "200+";
2420

2521
export type HumanNodesFilters = {
@@ -60,8 +56,7 @@ export function filterHumanNodes(input: {
6056
.filter((node) => {
6157
const factionName =
6258
factionsById[node.factionId]?.name?.toLowerCase() ?? "";
63-
const chamberName =
64-
chambersById[node.chamber]?.name?.toLowerCase() ?? "";
59+
const chamberName = chambersById[node.chamber]?.name?.toLowerCase() ?? "";
6560
const matchesTerm =
6661
node.name.toLowerCase().includes(term) ||
6762
node.role.toLowerCase().includes(term) ||
@@ -135,7 +130,9 @@ export function getHumanNodeVisibleHeroStats(
135130
});
136131
}
137132

138-
export function getHumanNodeCmTotals(heroStats: HumanNodeProfileDto["heroStats"]) {
133+
export function getHumanNodeCmTotals(
134+
heroStats: HumanNodeProfileDto["heroStats"],
135+
) {
139136
return heroStats.reduce(
140137
(acc, stat) => {
141138
const label = stat.label.trim().toUpperCase();

src/lib/myGovernanceUi.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ export type GoverningStatus =
99

1010
export type TierProgress = NonNullable<GetMyGovernanceResponse["tier"]>;
1111

12-
export type TierKey = "Nominee" | "Ecclesiast" | "Legate" | "Consul" | "Citizen";
12+
export type TierKey =
13+
| "Nominee"
14+
| "Ecclesiast"
15+
| "Legate"
16+
| "Consul"
17+
| "Citizen";
1318

1419
export const proposalRightsByTier: Record<TierKey, string[]> = {
1520
Nominee: ["Basic proposals"],

src/pages/factions/Faction.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ import { Link, useParams } from "react-router";
22

33
import { PageHint } from "@/components/PageHint";
44
import { Button } from "@/components/primitives/button";
5-
import {
6-
Card,
7-
CardContent,
8-
} from "@/components/primitives/card";
5+
import { Card, CardContent } from "@/components/primitives/card";
96
import {
107
apiFactionChannelCreate,
118
apiFactionChannelLock,

src/pages/factions/components/FactionEditCard.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ export function FactionEditCard({
9393
<Button
9494
size="sm"
9595
disabled={
96-
mutating || name.trim().length < 2 || description.trim().length < 2
96+
mutating ||
97+
name.trim().length < 2 ||
98+
description.trim().length < 2
9799
}
98100
onClick={onSave}
99101
>

src/pages/factions/components/FactionHero.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ export const FactionHero: React.FC<FactionHeroProps> = ({
8888
</Badge>
8989
</div>
9090
) : null}
91-
{viewerJoinRequest?.status === "pending" && !viewerMembershipActive ? (
91+
{viewerJoinRequest?.status === "pending" &&
92+
!viewerMembershipActive ? (
9293
<div className="mt-3">
9394
<Badge variant="outline">
9495
Private faction join request pending

src/pages/factions/components/FactionInitiativeDetailCard.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ import { Select } from "@/components/primitives/select";
1010
import { formatDateTime } from "@/lib/dateTime";
1111
import type { FactionDto } from "@/types/api";
1212

13-
type FactionInitiative = NonNullable<
14-
FactionDto["initiativesDetailed"]
15-
>[number];
13+
type FactionInitiative = NonNullable<FactionDto["initiativesDetailed"]>[number];
1614

1715
type FactionInitiativeStatus =
1816
| "draft"

src/pages/factions/components/FactionInitiativeListCard.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ import {
1111
import { formatDateTime } from "@/lib/dateTime";
1212
import type { FactionDto } from "@/types/api";
1313

14-
type FactionInitiative = NonNullable<
15-
FactionDto["initiativesDetailed"]
16-
>[number];
14+
type FactionInitiative = NonNullable<FactionDto["initiativesDetailed"]>[number];
1715

1816
type FactionInitiativeListCardProps = {
1917
activeInitiativeId?: string;

src/pages/factions/components/FactionInitiativesSection.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ import {
1010
} from "@/components/primitives/card";
1111
import type { FactionDto } from "@/types/api";
1212

13-
type FactionInitiative = NonNullable<
14-
FactionDto["initiativesDetailed"]
15-
>[number];
13+
type FactionInitiative = NonNullable<FactionDto["initiativesDetailed"]>[number];
1614

1715
type FactionInitiativesSectionProps = {
1816
factionId: string;

src/pages/factions/components/FactionMembersSection.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ type FactionMembersSectionProps = {
1818
canManageMembers: boolean;
1919
memberships: FactionMember[];
2020
mutating: boolean;
21-
onRoleSet: (
22-
address: string,
23-
role: "founder" | "steward" | "member",
24-
) => void;
21+
onRoleSet: (address: string, role: "founder" | "steward" | "member") => void;
2522
viewerAddress: string | null;
2623
};
2724

0 commit comments

Comments
 (0)