diff --git a/app/[leaflet_id]/Footer.tsx b/app/[leaflet_id]/Footer.tsx index 42e06fb1..82e67bef 100644 --- a/app/[leaflet_id]/Footer.tsx +++ b/app/[leaflet_id]/Footer.tsx @@ -37,24 +37,19 @@ export function LeafletFooter(props: { entityID: string }) { /> ) : entity_set.permissions.write ? ( - pub?.publications && - identity?.atp_did && - pub.publications.identity_did === identity.atp_did ? ( - + + {pub?.publications && + identity?.atp_did && + pub.publications.identity_did === identity.atp_did ? ( - - - - - - ) : ( - + ) : ( - - - - - ) + )} + + + + + ) : (
diff --git a/app/[leaflet_id]/actions/PublishButton.tsx b/app/[leaflet_id]/actions/PublishButton.tsx index b2c719bf..1b7f82d2 100644 --- a/app/[leaflet_id]/actions/PublishButton.tsx +++ b/app/[leaflet_id]/actions/PublishButton.tsx @@ -29,7 +29,7 @@ export const PublishButton = () => { let params = useParams(); let router = useRouter(); - if (!pub) return ; + if (!pub) return ; if (!pub?.doc) return ( { ); }; -const PublishToPublication = () => { +const PublishToPublicationButton = () => { let { identity } = useIdentityData(); - let params = useParams(); - let router = useRouter(); + let isMobile = useIsMobile(); - let hasPubs = - identity && identity.atp_did && identity.publications.length > 0; + identity && identity.atp_did && identity.publications.length > 0; + let [selectedPub, setSelectedPub] = useState(undefined); return ( {
- +

Save as Draft - Next + + Next{selectedPub === "create" && ": Create Pub!"} +
)} @@ -154,6 +159,8 @@ const PostDetailsForm = () => { }; const PubSelector = (props: { + selectedPub: string | undefined; + setSelectedPub: (s: string) => void; publications: { identity_did: string; indexed_at: string; @@ -163,15 +170,13 @@ const PubSelector = (props: { }[]; }) => { // HEY STILL TO DO - // copy over the menuItem styles and apply them if the option has been selected // test out logged out, logged in but no pubs, and pubbed up flows - let [selectedPub, setSelectedPub] = useState(undefined); return (
Publish to…
{props.publications.length === 0 || props.publications === undefined ? ( -
+
@@ -197,10 +202,10 @@ const PubSelector = (props: {
) : ( -
+
setSelectedPub("looseleaf")} + selected={props.selectedPub === "looseleaf"} + onSelect={() => props.setSelectedPub("looseleaf")} > Publish as Looseleaf @@ -210,8 +215,8 @@ const PubSelector = (props: { let pubRecord = p.record as PubLeafletPublication.Record; return ( setSelectedPub(p.uri)} + selected={props.selectedPub === p.uri} + onSelect={() => props.setSelectedPub(p.uri)} > <> @@ -221,8 +226,8 @@ const PubSelector = (props: { ); })} setSelectedPub("create")} + selected={props.selectedPub === "create"} + onSelect={() => props.setSelectedPub("create")} > <> Create New Publication @@ -241,7 +246,7 @@ const PubOption = (props: { }) => { return (