diff --git a/web/sidebar/community-creation/community-creation-modal.css b/web/sidebar/community-creation/community-creation-modal.css new file mode 100644 index 000000000..7b1ffe3a6 --- /dev/null +++ b/web/sidebar/community-creation/community-creation-modal.css @@ -0,0 +1,7 @@ +div.modal_body { + display: flex; + flex-direction: column; + width: 383px; + height: 560px; + overflow: hidden; +} diff --git a/web/sidebar/community-creation/community-creation-modal.react.js b/web/sidebar/community-creation/community-creation-modal.react.js new file mode 100644 index 000000000..b201777ca --- /dev/null +++ b/web/sidebar/community-creation/community-creation-modal.react.js @@ -0,0 +1,24 @@ +// @flow + +import * as React from 'react'; + +import { useModalContext } from 'lib/components/modal-provider.react.js'; + +import css from './community-creation-modal.css'; +import Modal from '../../modals/modal.react.js'; + +function CommunityCreationModal(): React.Node { + const modalContext = useModalContext(); + + return ( + +
+
+ ); +} + +export default CommunityCreationModal; diff --git a/web/sidebar/community-picker.react.js b/web/sidebar/community-picker.react.js index 76e2ef849..cec4f72f9 100644 --- a/web/sidebar/community-picker.react.js +++ b/web/sidebar/community-picker.react.js @@ -1,106 +1,113 @@ // @flow import classNames from 'classnames'; import * as React from 'react'; import { useDispatch } from 'react-redux'; +import { useModalContext } from 'lib/components/modal-provider.react.js'; import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; +import CommunityCreationModal from './community-creation/community-creation-modal.react.js'; import CommunityDrawer from './community-drawer.react.js'; import css from './community-picker.css'; import { clearCalendarCommunityFilter, updateNavInfoActionType, } from '../redux/action-types.js'; import { useSelector } from '../redux/redux-utils.js'; function CommunityPicker(): React.Node { const dispatch = useDispatch(); + const modalContext = useModalContext(); const openAccountSettings = React.useCallback( (event: SyntheticEvent) => { event.preventDefault(); dispatch({ type: updateNavInfoActionType, payload: { tab: 'settings', settingsSection: 'account' }, }); }, [dispatch], ); const isCalendarOpen = useSelector(state => state.navInfo.tab === 'calendar'); const onPressInbox = React.useCallback( (event: SyntheticEvent) => { event.preventDefault(); if (isCalendarOpen) { dispatch({ type: clearCalendarCommunityFilter, }); } else { dispatch({ type: updateNavInfoActionType, payload: { tab: 'chat' }, }); } }, [dispatch, isCalendarOpen], ); const inboxButtonTitle = isCalendarOpen ? 'All communities' : 'Inbox'; const isInboxOpen = useSelector( state => state.navInfo.tab === 'chat' || state.navInfo.tab === 'calendar', ); const isSettingsOpen = useSelector(state => state.navInfo.tab === 'settings'); const sideLineInbox = classNames({ [css.sideLine]: true, [css.sideLineActive]: isInboxOpen, }); const sideLineSettings = classNames({ [css.sideLine]: true, [css.sideLineActive]: isSettingsOpen, }); + const onPressCommunityCreationButton = React.useCallback(() => { + modalContext.pushModal(); + }, [modalContext]); + const isCommunityCreationButtonEnabled = false; let communityCreationButton; if (isCommunityCreationButtonEnabled) { communityCreationButton = ( - +
Create community
); } return (
{communityCreationButton}
); } export default CommunityPicker;