Discoverable option selection

pull/4576/head
Kamran Ahmed 1 year ago
parent dcf740e275
commit cb56e85651
  1. 1
      src/components/CustomRoadmap/CreateRoadmap/CreateRoadmapModal.tsx
  2. 1
      src/components/CustomRoadmap/PersonalRoadmapList.tsx
  3. 1
      src/components/CustomRoadmap/ResourceProgressStats.tsx
  4. 1
      src/components/CustomRoadmap/RoadmapHeader.tsx
  5. 4
      src/components/ShareOptions/ShareOptionsModal.tsx

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

@ -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}

@ -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}

@ -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}

@ -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
);

Loading…
Cancel
Save