-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2047 from daostack/dev
Sprint 28
- Loading branch information
Showing
55 changed files
with
1,306 additions
and
738 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/pages/OldCommon/components/CommonDetailContainer/MembershipRequestModal/helpers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { StepProgressItem } from "@/shared/components"; | ||
import { ProposalsTypes } from "@/shared/constants"; | ||
import { Governance } from "@/shared/models"; | ||
import { STEPS, MembershipRequestStep } from "./constants"; | ||
|
||
export const shouldShowRulesStep = (governance: Governance): boolean => | ||
governance.unstructuredRules.length > 0; | ||
|
||
export const shouldShowPaymentStep = (governance: Governance): boolean => | ||
Boolean( | ||
governance.proposals[ProposalsTypes.MEMBER_ADMITTANCE]?.limitations | ||
.paymentMustGoThrough, | ||
); | ||
|
||
export const getSteps = (governance: Governance): StepProgressItem[] => { | ||
const stepsToExclude: MembershipRequestStep[] = []; | ||
|
||
if (!shouldShowRulesStep(governance)) { | ||
stepsToExclude.push(MembershipRequestStep.Rules); | ||
} | ||
|
||
if (!shouldShowPaymentStep(governance)) { | ||
stepsToExclude.push(MembershipRequestStep.Payment); | ||
} | ||
|
||
return STEPS.filter( | ||
({ title }) => !stepsToExclude.includes(title as MembershipRequestStep), | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.