diff --git a/src/components/main/HomePage.tsx b/src/components/main/HomePage.tsx index ccf0ce860..9167f86bb 100644 --- a/src/components/main/HomePage.tsx +++ b/src/components/main/HomePage.tsx @@ -156,14 +156,15 @@ const TabsHomePage = ({ }) const isLoadingFollowedIds = followedIds === undefined + const hasFollowers = (followedIds?.length ?? 0) > 0 useEffect(() => { if (!isInitialized || !isSignedIn || isLoadingFollowedIds) return - if (followedIds.length === 0) { + if (!hasFollowers) { setFiltersInUrl(router, 'posts', { type: 'hot' }, { ref: refId }) } else { onChangeKey(tab) } - }, [followedIds, isInitialized]) + }, [hasFollowers, isInitialized]) const handleScroll = () => { const currentScrollPos = window.pageYOffset diff --git a/src/components/onboarding/RecommendedSpacesOnboarding.tsx b/src/components/onboarding/RecommendedSpacesOnboarding.tsx index 091b4e177..b1c764da7 100644 --- a/src/components/onboarding/RecommendedSpacesOnboarding.tsx +++ b/src/components/onboarding/RecommendedSpacesOnboarding.tsx @@ -22,10 +22,12 @@ export default function RecommendedSpacesOnboarding() { const isMobile = useIsMobileWidthOrDevice() const sendEvent = useSendEvent() const isInitializedProxy = useMyAccount(state => state.isInitializedProxy) - const { data: isFinishedOnBoarding, setData: setIsFinishedOnBoarding } = - useBooleanExternalStorage(ON_BOARDING_MODAL_KEY, { + const { getDataForAddress, setData: setIsFinishedOnBoarding } = useBooleanExternalStorage( + ON_BOARDING_MODAL_KEY, + { storageKeyType: 'user', - }) + }, + ) const { setIsOnBoardingSkipped } = useIsOnBoardingSkippedContext() const { api } = useSubsocialApi() @@ -38,8 +40,8 @@ export default function RecommendedSpacesOnboarding() { const [isOpen, setIsOpen] = useState(false) useEffect(() => { - if (isInitializedProxy && !isFinishedOnBoarding && myAddress) setIsOpen(true) - }, [myAddress, isInitializedProxy, isFinishedOnBoarding]) + if (isInitializedProxy && !getDataForAddress(myAddress) && myAddress) setIsOpen(true) + }, [myAddress, isInitializedProxy]) const closeModal = () => { sendEvent('login_space_suggestion_skipped') diff --git a/src/components/posts/share/ShareModal/index.module.sass b/src/components/posts/share/ShareModal/index.module.sass index 7da7b3f8b..fa887f183 100644 --- a/src/components/posts/share/ShareModal/index.module.sass +++ b/src/components/posts/share/ShareModal/index.module.sass @@ -14,3 +14,9 @@ .DfShareModalMdEditor .CodeMirror height: 5rem + +.EditorContainer + padding: $space_small + padding-top: $space_mini + border: 1px solid $color_border + border-radius: $border_radius_normal diff --git a/src/components/posts/share/ShareModal/index.tsx b/src/components/posts/share/ShareModal/index.tsx index 31039da41..9b0d7819f 100644 --- a/src/components/posts/share/ShareModal/index.tsx +++ b/src/components/posts/share/ShareModal/index.tsx @@ -7,6 +7,7 @@ import dynamic from 'next/dynamic' import { useEffect, useState } from 'react' import { Controller, ErrorMessage, useForm } from 'react-hook-form' import { useMyAddress } from 'src/components/auth/MyAccountsContext' +import { htmlToMd } from 'src/components/editor/tiptap' import { TxCallback, TxFailedCallback } from 'src/components/substrate/SubstrateTxButton' import { useCreateReloadPost, @@ -17,9 +18,9 @@ import { IpfsCid, PostId, SharedPostContent, SpaceId } from 'src/types' import { CreateSpaceButton } from '../../../spaces/helpers' import { getNewIdFromEvent, getTxParams } from '../../../substrate' import { useSubsocialApi } from '../../../substrate/SubstrateContext' -import DfMdEditor from '../../../utils/DfMdEditor' import { MyAccountProps } from '../../../utils/MyAccount' import SelectSpacePreview from '../../../utils/SelectSpacePreview' +import HtmlEditor from '../../editor/HtmlEditor' import { buildSharePostValidationSchema } from '../../PostValidation' import { PublicPostPreviewById } from '../../PublicPostPreview' import styles from './index.module.sass' @@ -82,7 +83,7 @@ const InnerSharePostModal = (props: Props) => { disabled={isSubmitting} params={() => getTxParams({ - json: { body } as SharedPostContent, + json: { body: htmlToMd(body) } as SharedPostContent, buildTxParamsCallback: newTxParams, setIpfsCid, ipfs, @@ -138,13 +139,15 @@ const InnerSharePostModal = (props: Props) => {
- } - name={Fields.body} - value={body} - className={`${errors[Fields.body] && 'error'} ${styles.DfShareModalMdEditor}`} - /> +
+ } + name={Fields.body} + value={body} + className={`${errors[Fields.body] && 'error'} ${styles.DfShareModalMdEditor}`} + /> +