-
Notifications
You must be signed in to change notification settings - Fork 422
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3ef8ccb
commit e26bbf9
Showing
4 changed files
with
87 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/ui/views/Approval/components/NoActionAlert/NoActionBody.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { noop } from '@/ui/utils'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { ReactComponent as IconEmail } from '@/ui/assets/add-chain/email.svg'; | ||
import React from 'react'; | ||
import { Loading3QuartersOutlined } from '@ant-design/icons'; | ||
import { Spin } from 'antd'; | ||
import clsx from 'clsx'; | ||
|
||
interface Props { | ||
isRequested?: boolean; | ||
requestedCount: number; | ||
isRequesting?: boolean; | ||
handleRequest(): void; | ||
} | ||
export const NoActionBody: React.FC<Props> = ({ | ||
isRequested, | ||
requestedCount, | ||
isRequesting, | ||
handleRequest, | ||
}) => { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<> | ||
<div className="h-[0.5px] bg-r-neutral-line w-full my-12" /> | ||
<div className="leading-[16px]"> | ||
{isRequested ? ( | ||
<div className="text-r-neutral-foot"> | ||
{requestedCount > 1 | ||
? t('page.switchChain.requestsReceivedPlural', { | ||
count: requestedCount, | ||
}) | ||
: t('page.switchChain.requestsReceived')} | ||
</div> | ||
) : ( | ||
<div | ||
className={clsx( | ||
'gap-x-6 flex items-center justify-center', | ||
'cursor-pointer hover:opacity-70', | ||
isRequesting && 'opacity-70' | ||
)} | ||
onClick={isRequesting ? noop : handleRequest} | ||
> | ||
{isRequesting ? ( | ||
<Spin | ||
indicator={ | ||
<Loading3QuartersOutlined style={{ fontSize: 16 }} spin /> | ||
} | ||
/> | ||
) : ( | ||
<IconEmail className="w-16" /> | ||
)} | ||
<span className="text-r-blue-default"> | ||
{t('page.switchChain.requestRabbyToSupport')} | ||
</span> | ||
</div> | ||
)} | ||
</div> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters