diff --git a/web/sidebar/community-creation/community-creation-modal.css b/web/sidebar/community-creation/community-creation-modal.css --- a/web/sidebar/community-creation/community-creation-modal.css +++ b/web/sidebar/community-creation/community-creation-modal.css @@ -13,7 +13,6 @@ .formContainer { display: flex; flex-direction: column; - padding: 20px; } div.formTitle { @@ -63,12 +62,6 @@ padding-bottom: 20px; } -div.createCommunityButtonContainer { - display: flex; - flex-direction: column; - margin-top: 20px; -} - div.createCommunityButtonContent { display: flex; justify-content: center; diff --git a/web/sidebar/community-creation/community-creation-modal.react.js b/web/sidebar/community-creation/community-creation-modal.react.js --- a/web/sidebar/community-creation/community-creation-modal.react.js +++ b/web/sidebar/community-creation/community-creation-modal.react.js @@ -39,6 +39,8 @@ }, ]; +const communityCreationKeyserverLabel = ; + const createNewCommunityLoadingStatusSelector = createLoadingStatusSelector(newThreadActionTypes); @@ -135,28 +137,50 @@ const createNewCommunityLoadingStatus: LoadingStatus = useSelector( createNewCommunityLoadingStatusSelector, ); - let buttonContent; - if (createNewCommunityLoadingStatus === 'loading') { - buttonContent = ( - - ); - } else if (errorMessage) { - buttonContent = errorMessage; - } else { - buttonContent = 'Create community'; - } + + const buttonContent = React.useMemo(() => { + if (createNewCommunityLoadingStatus === 'loading') { + return ( + + ); + } else if (errorMessage) { + return errorMessage; + } else { + return 'Create community'; + } + }, [createNewCommunityLoadingStatus, errorMessage]); + + const button = React.useMemo( + () => ( + + ), + [ + buttonContent, + createNewCommunity, + createNewCommunityLoadingStatus, + errorMessage, + ], + ); return (
- {avatarNode}
@@ -186,20 +210,6 @@ type="checkbox" />
-
- -