1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-01-17 06:08:36 +01:00

Discoverable option selection

This commit is contained in:
Kamran Ahmed 2023-10-09 23:27:49 +01:00
parent dcf740e275
commit cb56e85651
5 changed files with 7 additions and 1 deletions

View File

@ -29,6 +29,7 @@ export interface RoadmapDocument {
description?: string;
creatorId: string;
teamId?: string;
isDiscoverable: boolean;
type: AllowedCustomRoadmapType;
visibility: AllowedRoadmapVisibility;
sharedFriendIds?: string[];

View File

@ -60,6 +60,7 @@ export function PersonalRoadmapList(props: PersonalRoadmapListType) {
const shareSettingsModal = selectedRoadmap && (
<ShareOptionsModal
isDiscoverable={selectedRoadmap.isDiscoverable}
description={selectedRoadmap.description}
visibility={selectedRoadmap.visibility}
sharedFriendIds={selectedRoadmap.sharedFriendIds}

View File

@ -24,6 +24,7 @@ export function ResourceProgressStats(props: ResourceProgressStatsProps) {
<>
{isSharing && $canManageCurrentRoadmap && $currentRoadmap && (
<ShareOptionsModal
isDiscoverable={$currentRoadmap.isDiscoverable}
description={$currentRoadmap?.description}
visibility={$currentRoadmap?.visibility}
teamId={$currentRoadmap?.teamId}

View File

@ -121,6 +121,7 @@ export function RoadmapHeader(props: RoadmapHeaderProps) {
<div className="flex items-center gap-2">
{isSharing && $currentRoadmap && (
<ShareOptionsModal
isDiscoverable={$currentRoadmap.isDiscoverable}
description={$currentRoadmap?.description}
visibility={$currentRoadmap?.visibility}
teamId={$currentRoadmap?.teamId}

View File

@ -24,6 +24,7 @@ export type OnShareSettingsUpdate = (options: {
type ShareOptionsModalProps = {
onClose: () => void;
visibility: AllowedRoadmapVisibility;
isDiscoverable?: boolean;
sharedFriendIds?: string[];
sharedTeamMemberIds?: string[];
teamId?: string;
@ -37,6 +38,7 @@ export function ShareOptionsModal(props: ShareOptionsModalProps) {
const {
roadmapId,
onClose,
isDiscoverable: defaultIsDiscoverable = false,
visibility: defaultVisibility,
sharedTeamMemberIds: defaultSharedMemberIds = [],
sharedFriendIds: defaultSharedFriendIds = [],
@ -57,7 +59,7 @@ export function ShareOptionsModal(props: ShareOptionsModalProps) {
const membersCache = useMemo(() => new Map<string, TeamMemberList[]>(), []);
const [visibility, setVisibility] = useState(defaultVisibility);
const [isDiscoverable, setIsDiscoverable] = useState(false);
const [isDiscoverable, setIsDiscoverable] = useState(defaultIsDiscoverable);
const [sharedTeamMemberIds, setSharedTeamMemberIds] = useState<string[]>(
defaultSharedMemberIds
);