Skip to content

Commit

Permalink
Show reward account for channel on studio
Browse files Browse the repository at this point in the history
  • Loading branch information
WRadoslaw committed Oct 2, 2023
1 parent b9fc1b4 commit 2aba7ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export type MemberDropdownProps = {
export const MemberDropdown = forwardRef<HTMLDivElement, MemberDropdownProps>(
({ publisher, isActive, closeDropdown, onChannelChange }, ref) => {
const navigate = useNavigate()
const { channelId, activeMembership, memberships, setActiveChannel } = useUser()
const { channelId, activeMembership, memberships, setActiveChannel, activeChannel } = useUser()
const { handleLogout } = useAuth()
const {
actions: { setAuthModalOpenName },
Expand Down Expand Up @@ -169,6 +169,7 @@ export const MemberDropdown = forwardRef<HTMLDivElement, MemberDropdownProps>(
channelBalance={channelBalance}
lockedAccountBalance={lockedAccountBalance}
activeMembership={activeMembership}
activeChannel={activeChannel}
hasOneMember={hasOneMember}
onSwitchToList={(type) => handleSwitch(type, true)}
onCloseDropdown={closeDropdown}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type MemberDropdownNavProps = {
onSignOut: () => void
onShowFundsDialog: () => void
activeMembership?: FullMembershipFieldsFragment | null
activeChannel?: FullMembershipFieldsFragment['channels'][number] | null
hasOneMember?: boolean
channelId: string | null
accountBalance?: BN
Expand All @@ -78,6 +79,7 @@ export const MemberDropdownNav: FC<MemberDropdownNavProps> = ({
lockedAccountBalance,
channelBalance,
isInDebt,
activeChannel,
}) => {
const selectedChannel = activeMembership?.channels.find((chanel) => chanel.id === channelId)
const { urls: memberAvatarUrls, isLoadingAsset: memberAvatarLoading } = getMemberAvatar(activeMembership)
Expand Down Expand Up @@ -173,7 +175,11 @@ export const MemberDropdownNav: FC<MemberDropdownNavProps> = ({
</BalanceContainer>
</div>
<AddressContainer>
<CopyAddressButton address={activeMembership?.controllerAccount ?? ''} size="big" truncate />
<CopyAddressButton
address={(type === 'member' ? activeMembership?.controllerAccount : activeChannel?.rewardAccount) ?? ''}
size="big"
truncate
/>
</AddressContainer>
</AvatarContainer>
</MemberInfoContainer>
Expand Down

0 comments on commit 2aba7ab

Please sign in to comment.