File tree Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ interface OverviewSectionProps {
25
25
userProfile ?: any ;
26
26
showShareAction : boolean ;
27
27
handleShare : ( ) => void ;
28
+ isVisibilityEnabled : boolean ;
29
+ handleVisibilityChange : ( ) => void ;
28
30
}
29
31
30
32
const OverviewSection : React . FC < OverviewSectionProps > = ( {
@@ -41,7 +43,9 @@ const OverviewSection: React.FC<OverviewSectionProps> = ({
41
43
fontFamily,
42
44
userProfile,
43
45
showShareAction,
44
- handleShare
46
+ handleShare,
47
+ isVisibilityEnabled,
48
+ handleVisibilityChange
45
49
} ) => {
46
50
return (
47
51
< OverviewContainer >
@@ -64,6 +68,8 @@ const OverviewSection: React.FC<OverviewSectionProps> = ({
64
68
handleCopyUrl = { handleCopyUrl }
65
69
showShareAction = { showShareAction }
66
70
handleShare = { handleShare }
71
+ isVisibilityEnabled = { isVisibilityEnabled }
72
+ handleVisibilityChange = { handleVisibilityChange }
67
73
/>
68
74
</ div >
69
75
< Grid container spacing = { 2 } >
Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ interface RightPanelProps {
28
28
fetchingOrgError : boolean ;
29
29
showShareAction : boolean ;
30
30
handleShare : ( ) => void ;
31
+ isVisibilityEnabled : boolean ;
32
+ handleVisibilityChange : ( ) => void ;
31
33
}
32
34
33
35
const RightPanel : React . FC < RightPanelProps > = ( {
@@ -51,7 +53,9 @@ const RightPanel: React.FC<RightPanelProps> = ({
51
53
orgName,
52
54
fetchingOrgError,
53
55
showShareAction,
54
- handleShare
56
+ handleShare,
57
+ isVisibilityEnabled = false ,
58
+ handleVisibilityChange
55
59
} ) => {
56
60
const cleanedType = type . replace ( 'my-' , '' ) . replace ( / s $ / , '' ) ;
57
61
const { data : userProfile } = useGetUserProfileByIdQuery ( {
@@ -75,6 +79,8 @@ const RightPanel: React.FC<RightPanelProps> = ({
75
79
userProfile = { userProfile }
76
80
showShareAction = { showShareAction }
77
81
handleShare = { handleShare }
82
+ isVisibilityEnabled = { isVisibilityEnabled }
83
+ handleVisibilityChange = { handleVisibilityChange }
78
84
/>
79
85
{ showCaveats && < CaveatsSection details = { details } /> }
80
86
< RelatedDesigns
Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ interface SocialSharePopperProps {
29
29
handleCopyUrl : ( type : string , name : string , id : string ) => void ;
30
30
showShareAction : boolean ;
31
31
handleShare : ( ) => void ;
32
+ isVisibilityEnabled : boolean ;
33
+ handleVisibilityChange : ( ) => void ;
32
34
}
33
35
34
36
const SocialSharePopper : React . FC < SocialSharePopperProps > = ( {
@@ -38,7 +40,9 @@ const SocialSharePopper: React.FC<SocialSharePopperProps> = ({
38
40
title,
39
41
getUrl,
40
42
handleCopyUrl,
41
- handleShare
43
+ handleShare,
44
+ isVisibilityEnabled,
45
+ handleVisibilityChange
42
46
} ) => {
43
47
const theme = useTheme ( ) ;
44
48
const [ anchorEl , setAnchorEl ] = useState < null | HTMLElement > ( null ) ;
@@ -59,8 +63,8 @@ const SocialSharePopper: React.FC<SocialSharePopperProps> = ({
59
63
< CopyShareIconWrapper style = { { marginBottom : '2rem' } } >
60
64
< VisibilityChipMenu
61
65
value = { details ?. visibility as VIEW_VISIBILITY }
62
- onChange = { ( ) => { } }
63
- enabled = { false }
66
+ onChange = { handleVisibilityChange }
67
+ enabled = { isVisibilityEnabled }
64
68
options = { [
65
69
[ VIEW_VISIBILITY . PUBLIC , PublicIcon ] ,
66
70
[ VIEW_VISIBILITY . PRIVATE , LockIcon ]
You can’t perform that action at this time.
0 commit comments