@@ -21,7 +21,8 @@ import Loading from "app/components/Loading";
2121import { useSidebar } from "app/components/Sidebar/Context" ;
2222import { NavigationConfirmModal } from 'react-router-navigation-confirm' ;
2323
24- import { PageTitle , Controls , Box , Grid , PageDescription } from "styles/common" ;
24+ import { PageTitle , Controls , Box , Grid } from "styles/common" ;
25+ import SwitchInput from "app/components/FormFields/SwitchInput" ;
2526
2627const PackForm : React . FC < PackFormSpecs . Props > = ( { history, packId, getPack, exportItems, getItems, createPack, updatePack, user } ) => {
2728 const [ loading , setLoading ] = React . useState < boolean > ( true ) ;
@@ -119,7 +120,8 @@ const PackForm: React.FC<PackFormSpecs.Props> = ({ history, packId, getPack, exp
119120 duration_unit : packData ? packData . duration_unit : undefined ,
120121 temp_range : packData ? packData . temp_range : '' ,
121122 season : packData ? packData . season : '' ,
122- gender : packData ? packData . gender : undefined
123+ gender : packData ? packData . gender : undefined ,
124+ public : packData ? packData . public : false
123125 } }
124126 validationSchema = { Yup . object ( ) . shape ( {
125127 title : Yup . string ( ) . required ( "Trail name or location is required." )
@@ -244,6 +246,13 @@ const PackForm: React.FC<PackFormSpecs.Props> = ({ history, packId, getPack, exp
244246 />
245247 </ Col >
246248 </ Row >
249+ < SwitchInput label = "Pack Privacy"
250+ checked = { values . public }
251+ checkedText = "Public"
252+ uncheckedText = "Private"
253+ onChange = { v => setFieldValue ( 'public' , v ) }
254+ tip = "When public, the pack will be viewable by anyone with a link"
255+ > </ SwitchInput >
247256 </ div >
248257 </ Grid >
249258 </ Box >
0 commit comments