diff --git a/invenio_communities/assets/semantic-ui/js/invenio_communities/community/header/RequestMembershipButton.js b/invenio_communities/assets/semantic-ui/js/invenio_communities/community/header/RequestMembershipButton.js new file mode 100644 index 000000000..42c85e39f --- /dev/null +++ b/invenio_communities/assets/semantic-ui/js/invenio_communities/community/header/RequestMembershipButton.js @@ -0,0 +1,104 @@ +/* + * This file is part of Invenio. + * Copyright (C) 2024 CERN. + * Copyright (C) 2024 Northwestern University. + * + * Invenio is free software; you can redistribute it and/or modify it + * under the terms of the MIT License; see LICENSE file for more details. + */ + +import { i18next } from "@translations/invenio_communities/i18next"; +import { Formik } from "formik"; +import PropTypes from "prop-types"; +import React, { useState } from "react"; +import { TextAreaField } from "react-invenio-forms"; +import { Button, Form, Modal } from "semantic-ui-react"; + +export function RequestMembershipModal(props) { + const { isOpen, onClose } = props; + + const onSubmit = async (values, { setSubmitting, setFieldError }) => { + // TODO: implement me + console.log("RequestMembershipModal.onSubmit(args) called"); + console.log("TODO: implement me", arguments); + }; + + let confirmed = true; + + return ( + + {({ values, isSubmitting, handleSubmit }) => ( + + {i18next.t("Request Membership")} + +
+ + +
+ + + + +
+ )} +
+ ); +} + +RequestMembershipModal.propTypes = { + isOpen: PropTypes.bool.isRequired, + onClose: PropTypes.func.isRequired, +}; + +export function RequestMembershipButton(props) { + const [isModalOpen, setModalOpen] = useState(false); + + const handleClick = () => { + setModalOpen(true); + }; + + const handleClose = () => { + setModalOpen(false); + }; + + return ( + <> +