Walk Create Community through the Figma screens and restore a chosen logo after reload, so a guest can leave without saving until they reach the email step.
This commit is contained in:
1 parent
ca1f58a50c
commit
2348a9e94f
61 files changed
+1110
-421
No files matched your search
@@ -23,12 +23,34 @@ const DEFAULT_FOOTER_LABEL_BY_STEP: ReadonlyMap<
|
||||
["community-size", "confirmSize"],
|
||||
]);
|
||||
|
||||
function hasNonEmptyId(ids: readonly string[] | undefined): boolean {
|
||||
return (ids ?? []).some((id) => id.length > 0);
|
||||
}
|
||||
|
||||
export function isCommunityNameStepBlocked(
|
||||
step: CreateFlowStep | null | undefined,
|
||||
title: string | undefined,
|
||||
): boolean {
|
||||
if (step !== "community-name") return false;
|
||||
return typeof title !== "string" || title.trim().length === 0;
|
||||
}
|
||||
|
||||
export function isCommunityStructureStepBlocked(
|
||||
step: CreateFlowStep | null | undefined,
|
||||
selectedOrganizationTypeIds: readonly string[] | undefined,
|
||||
selectedMaturityIds: readonly string[] | undefined,
|
||||
): boolean {
|
||||
if (step !== "community-structure") return false;
|
||||
const mainKind = (selectedOrganizationTypeIds ?? []).find((id) => id.length > 0);
|
||||
return !mainKind || !hasNonEmptyId(selectedMaturityIds);
|
||||
}
|
||||
|
||||
export function isCommunitySizeStepBlocked(
|
||||
step: CreateFlowStep | null | undefined,
|
||||
selectedCommunitySizeIds: readonly string[] | undefined,
|
||||
): boolean {
|
||||
if (step !== "community-size") return false;
|
||||
return !(selectedCommunitySizeIds ?? []).some((id) => id.length > 0);
|
||||
return !hasNonEmptyId(selectedCommunitySizeIds);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user