Skip to content

Commit

Permalink
Merge pull request #150 from dappforce/deploy/creators-link
Browse files Browse the repository at this point in the history
Make stake button for creators go directly to the related stakers
  • Loading branch information
olehmell authored Dec 20, 2023
2 parents a17a8f8 + 5ba53c6 commit 7912814
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/spaces/SpaceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default function SpaceCard({ spaceId, ...props }: SpaceCardProps) {
subtitle={<DfMd className='ColorCurrentColor' source={spaceData?.content?.about} />}
buttons={
spaceData && [
<StakeButton key={'stake'} spaceId={spaceData.id} />,
<StakeButton key={'stake'} spaceStruct={spaceData.struct} />,
isMySpace ? (
<ButtonLink
href={'/[spaceId]/edit'}
Expand Down
17 changes: 11 additions & 6 deletions src/components/spaces/ViewSpace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import React, { MouseEvent, useCallback, useState } from 'react'
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 { SpaceContent, SpaceId, SpaceStruct, 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'
import MakeAsProfileModal from '../profiles/address-views/utils/MakeAsProfileModal'
import { useIsMobileWidthOrDevice } from '../responsive'
import { editSpaceUrl } from '../urls'
import { editSpaceUrl, spaceUrl } from '../urls'
import { DfMd } from '../utils/DfMd'
import { EntityStatusGroup, PendingSpaceOwnershipPanel } from '../utils/EntityStatusPanels'
import { SummarizeMd } from '../utils/md'
Expand Down Expand Up @@ -59,9 +59,14 @@ export const SpaceNameAsLink = React.memo(({ space, ...props }: SpaceNameAsLinkP
return <ViewSpaceLink space={space.struct} title={spaceName} {...props} />
})

export const StakeButton = ({ spaceId }: { spaceId: SpaceId }) => {
return config.creatorIds?.includes(spaceId) ? (
<ButtonLink type='primary' href={'https://sub.id/creators'} className={clsx('mr-2')}>
export const StakeButton = ({ spaceStruct }: { spaceStruct: SpaceStruct }) => {
return config.creatorIds?.includes(spaceStruct.id) ? (
<ButtonLink
type='primary'
target='_blank'
href={`https://sub.id/creators/${spaceUrl(spaceStruct)}`}
className={clsx('mr-2')}
>
Stake
</ButtonLink>
) : null
Expand Down Expand Up @@ -196,7 +201,7 @@ export const InnerViewSpace = (props: Props) => {
<EditOutlined /> Edit
</ButtonLink>
) : (
withStakeButton && <StakeButton spaceId={space.id} />
withStakeButton && <StakeButton spaceStruct={space} />
))}

{withFollowButton && <FollowSpaceButton space={space} />}
Expand Down
18 changes: 17 additions & 1 deletion src/config/app/polkaverse/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,23 @@ 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'],
creatorIds: [
'11414',
'4809',
'4777',
'6953',
'10132',
'6283',
'11581',
'7366',
'11157',
'11566',
'10124',
'11581',
'1573',
'1238',
'11844',
],
}

export default index

0 comments on commit 7912814

Please sign in to comment.