diff --git a/src/components/spaces/AboutSpace.tsx b/src/components/spaces/AboutSpace.tsx index 60bc9802e..fb8f69ea9 100644 --- a/src/components/spaces/AboutSpace.tsx +++ b/src/components/spaces/AboutSpace.tsx @@ -5,12 +5,11 @@ import config from 'src/config' import { getInitialPropsWithRedux } from 'src/rtk/app' import { SpaceContent } from 'src/types' import { PageContent } from '../main/PageWrapper' -import { ProfilePreviewByAccountId } from '../profiles/address-views' +import AuthorCard from '../profiles/address-views/AuthorCard' import { InfoPanel } from '../profiles/address-views/InfoSection' import { aboutSpaceUrl } from '../urls' import { DfMd } from '../utils/DfMd' import Section from '../utils/Section' -import Segment from '../utils/Segment' import ViewTags from '../utils/ViewTags' import { SpaceNotFountPage, useIsUnlistedSpace } from './helpers' import { loadSpaceOnNextReq } from './helpers/loadSpaceOnNextReq' @@ -24,7 +23,6 @@ type Props = ViewSpaceProps export const InnerAboutSpacePage: NextPage = ({ spaceData }) => { const { struct: space } = spaceData! - const { ownerId: spaceOwnerAddress } = space const [content] = useState(spaceData?.content || ({} as SpaceContent)) const { name, about, image, tags, links = [], email } = content @@ -68,9 +66,7 @@ export const InnerAboutSpacePage: NextPage = ({ spaceData }) => {
- - - +
diff --git a/src/components/spaces/SpaceCard.tsx b/src/components/spaces/SpaceCard.tsx index 1b3119143..a7af3b3c3 100644 --- a/src/components/spaces/SpaceCard.tsx +++ b/src/components/spaces/SpaceCard.tsx @@ -8,6 +8,7 @@ import { DfMd } from '../utils/DfMd' import FollowSpaceButton from '../utils/FollowSpaceButton' import MyEntityLabel from '../utils/MyEntityLabel' import { OfficialSpaceStatus, SpaceAvatar, useIsMySpace } from './helpers' +import { StakeButton } from './ViewSpace' import ViewSpaceLink from './ViewSpaceLink' export interface SpaceCardProps @@ -55,9 +56,10 @@ export default function SpaceCard({ spaceId, ...props }: SpaceCardProps) { ) } subtitle={} - buttons={[ - spaceData && - (isMySpace ? ( + buttons={ + spaceData && [ + , + isMySpace ? ( ) : ( - )), - ]} + ), + ] + } /> ) } diff --git a/src/components/spaces/SpacePreview.tsx b/src/components/spaces/SpacePreview.tsx index 7359d180b..90bc3c202 100644 --- a/src/components/spaces/SpacePreview.tsx +++ b/src/components/spaces/SpacePreview.tsx @@ -10,7 +10,7 @@ type PreviewProps = { } export const SpacePreview = ({ space }: PreviewProps) => ( - + ) type PublicSpacePreviewByIdProps = { diff --git a/src/components/spaces/ViewSpace.tsx b/src/components/spaces/ViewSpace.tsx index ed3f64a79..d01ace014 100644 --- a/src/components/spaces/ViewSpace.tsx +++ b/src/components/spaces/ViewSpace.tsx @@ -1,12 +1,13 @@ import { EditOutlined } from '@ant-design/icons' import { isEmptyStr, newLogger, nonEmptyStr } from '@subsocial/utils' +import clsx from 'clsx' import dynamic from 'next/dynamic' import React, { MouseEvent, useCallback, useState } from 'react' -import { Donate } from 'src/components/donate' import { ButtonLink } from 'src/components/utils/CustomLinks' import { Segment } from 'src/components/utils/Segment' import { LARGE_AVATAR_SIZE } from 'src/config/Size.config' import { SpaceContent, SpaceId, SpaceWithSomeDetails } from 'src/types' +import config from '../../config' import { useSelectProfileSpace } from '../../rtk/features/profiles/profilesHooks' import { useSelectSpace } from '../../rtk/features/spaces/spacesHooks' import { useMyAddress } from '../auth/MyAccountsContext' @@ -58,6 +59,14 @@ export const SpaceNameAsLink = React.memo(({ space, ...props }: SpaceNameAsLinkP return }) +export const StakeButton = ({ spaceId }: { spaceId: SpaceId }) => { + return config.creatorIds?.includes(spaceId) ? ( + + Stake + + ) : null +} + export const InnerViewSpace = (props: Props) => { const { spaceData: initialSpaceData, @@ -69,7 +78,7 @@ export const InnerViewSpace = (props: Props) => { withFollowButton = true, withStats = true, withTags = true, - withTipButton = true, + withStakeButton = true, showFullAbout = false, dropdownPreview = false, @@ -187,7 +196,7 @@ export const InnerViewSpace = (props: Props) => { Edit ) : ( - withTipButton && + withStakeButton && ))} {withFollowButton && } diff --git a/src/components/spaces/ViewSpaceProps.ts b/src/components/spaces/ViewSpaceProps.ts index 9f37a9dbe..4bccc87b3 100644 --- a/src/components/spaces/ViewSpaceProps.ts +++ b/src/components/spaces/ViewSpaceProps.ts @@ -10,7 +10,7 @@ export type ViewSpaceOptsProps = { withFollowButton?: boolean withTags?: boolean withStats?: boolean - withTipButton?: boolean + withStakeButton?: boolean showFullAbout?: boolean imageSize?: number } diff --git a/src/components/spaces/helpers/SpaceDropdownMenu.tsx b/src/components/spaces/helpers/SpaceDropdownMenu.tsx index 49f8a963a..37af6b1b3 100644 --- a/src/components/spaces/helpers/SpaceDropdownMenu.tsx +++ b/src/components/spaces/helpers/SpaceDropdownMenu.tsx @@ -53,19 +53,18 @@ export const SpaceDropdownMenu = (props: SpaceDropDownProps) => { )} - {!isMySpace || - (!isUsingEmail && ( - - ( - - Tip - - )} - /> - - ))} + {!isMySpace && ( + + ( + + Tip + + )} + /> + + )} {!canCreatePost || isHidden(struct) ? null : ( diff --git a/src/config/app/polkaverse/index.ts b/src/config/app/polkaverse/index.ts index e1d222bbb..83eb26c83 100644 --- a/src/config/app/polkaverse/index.ts +++ b/src/config/app/polkaverse/index.ts @@ -23,6 +23,7 @@ const index: AppConfig = { claimedSpaceIds: ['1', '2', '3', '4', '5'], recommendedSpaceIds: polkaverseSpaces, suggestedTlds: ['sub', 'polka'], + creatorIds: ['11414', '4809', '4777', '6953', '10132', '6283', '11581', '7366', '11157', '11566'], } export default index diff --git a/src/config/types.ts b/src/config/types.ts index 5718932a1..4d628480f 100644 --- a/src/config/types.ts +++ b/src/config/types.ts @@ -100,6 +100,7 @@ export type AppConfig = { claimedSpaceIds: SpaceId[] recommendedSpaceIds: SpaceId[] suggestedTlds?: string[] + creatorIds?: string[] } export type CommonSubsocialFeatures = {