Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/Header/AppSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ function AppSidebar() {

{loginAddress && fellows.map((fellow) => fellow.address).includes(loginAddress) && (
<LinkWithNetwork
className='mb-5 flex cursor-pointer items-center justify-center gap-1 rounded-3xl bg-rankRequestBtn px-3 py-2 text-xs font-medium leading-[21px]'
// eslint-disable-next-line prettier/prettier
className='bg-rankRequestBtn mb-5 flex cursor-pointer items-center justify-center gap-1 rounded-3xl px-3 py-2 text-xs font-medium leading-[21px]'
href={`/address/${loginAddress}/create-rank-request`}
>
<Image
Expand Down
66 changes: 35 additions & 31 deletions src/components/Profile/AddressDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import React, { useEffect, useMemo, useState } from 'react';
import Identicon from '@polkadot/react-identicon';
import { useApiContext } from '@/contexts';
import { useApiContext, useUserDetailsContext } from '@/contexts';
import RANK_CONSTANTS from '@/global/constants/rankConstants';
import Image from 'next/image';
import midTruncateText from '@/utils/midTruncateText';
Expand Down Expand Up @@ -44,6 +44,8 @@ function ProfileAddressDetails(props: Props) {
const [activeStatus, setActiveStatus] = useState<ActiveStatus | null>(null);
const [isActiveFormModalOpen, setIsActiveFormModalOpen] = useState(false);
const [statusToSet, setStatusToSet] = useState<ActiveStatus>(ActiveStatus.ACTIVE);
const { loginAddress } = useUserDetailsContext();
const routeSubstrateAddress = getSubstrateAddress(address || '');

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const [onChainIdentity, setOnChainIdentity] = useState<any>();
Expand Down Expand Up @@ -142,37 +144,39 @@ function ProfileAddressDetails(props: Props) {
}}
/>
</div>
<div>
{activeStatus !== null && (
<Dropdown>
<DropdownTrigger>
<Button
variant='solid'
className='flex h-auto items-center justify-between border-none bg-primary p-0 px-2 py-0.5 text-white'
{fellows.find((fellow) => fellow.address === routeSubstrateAddress) && loginAddress === routeSubstrateAddress && (
<div>
{activeStatus !== null && (
<Dropdown>
<DropdownTrigger>
<Button
variant='solid'
className='flex h-auto items-center justify-between border-none bg-primary p-0 px-2 py-0.5 text-white'
>
<span className='text-xs font-normal leading-[18px] tracking-[0.33px]'>{activeStatus}</span>
<Image
alt='down chevron'
src='/icons/chevron-white.svg'
width={12}
height={12}
className='rounded-full'
/>
</Button>
</DropdownTrigger>

<DropdownMenu
variant='bordered'
aria-label='Network selection dropdown'
onAction={(key) => handleActiveStatusChange(key as ActiveStatus)}
>
<span className='text-xs font-normal leading-[18px] tracking-[0.33px]'>{activeStatus}</span>
<Image
alt='down chevron'
src='/icons/chevron-white.svg'
width={12}
height={12}
className='rounded-full'
/>
</Button>
</DropdownTrigger>

<DropdownMenu
variant='bordered'
aria-label='Network selection dropdown'
onAction={(key) => handleActiveStatusChange(key as ActiveStatus)}
>
{activeStates.map((s) => (
<DropdownItem key={s.key}>{s.name}</DropdownItem>
))}
</DropdownMenu>
</Dropdown>
)}
</div>
{activeStates.map((s) => (
<DropdownItem key={s.key}>{s.name}</DropdownItem>
))}
</DropdownMenu>
</Dropdown>
)}
</div>
)}
</article>
</section>
</Card>
Expand Down