fix modals
This commit is contained in:
parent
903884b732
commit
c9b94f4e55
|
@ -1,5 +1,5 @@
|
||||||
const Label = ({ text, optional }: { text: string; optional?: boolean }) => (
|
const Label = ({ text, optional }: { text: string; optional?: boolean }) => (
|
||||||
<p className="mb-2 text-sm text-th-fgd-3">
|
<p className="mb-2 text-left text-sm text-th-fgd-3">
|
||||||
{text}{' '}
|
{text}{' '}
|
||||||
{optional ? (
|
{optional ? (
|
||||||
<span className="ml-1 text-xs text-th-fgd-4">(Optional)</span>
|
<span className="ml-1 text-xs text-th-fgd-4">(Optional)</span>
|
||||||
|
|
|
@ -74,15 +74,13 @@ const DelegateModal = ({ isOpen, onClose }: ModalProps) => {
|
||||||
<div className="flex h-full flex-col justify-between">
|
<div className="flex h-full flex-col justify-between">
|
||||||
<div className="pb-4">
|
<div className="pb-4">
|
||||||
<h2 className="mb-1">{t('delegate-account')}</h2>
|
<h2 className="mb-1">{t('delegate-account')}</h2>
|
||||||
<p className="mb-4">
|
<p className="mb-4">{t('delegate-desc')}</p>
|
||||||
Delegate your Mango account to another wallet address.{' '}
|
<Label text={t('wallet-address')} />
|
||||||
</p>
|
|
||||||
<Label text={'Wallet address'} />
|
|
||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
name="name"
|
name="name"
|
||||||
id="name"
|
id="name"
|
||||||
placeholder="Enter a wallet address to delegate to"
|
placeholder={t('delegate-placeholder')}
|
||||||
value={delegateAddress}
|
value={delegateAddress}
|
||||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||||
setDelegateAddress(e.target.value)
|
setDelegateAddress(e.target.value)
|
||||||
|
|
|
@ -2,7 +2,6 @@ import { Dialog } from '@headlessui/react'
|
||||||
import { XMarkIcon } from '@heroicons/react/20/solid'
|
import { XMarkIcon } from '@heroicons/react/20/solid'
|
||||||
|
|
||||||
type ModalProps = {
|
type ModalProps = {
|
||||||
title?: string
|
|
||||||
children: React.ReactNode
|
children: React.ReactNode
|
||||||
disableOutsideClose?: boolean
|
disableOutsideClose?: boolean
|
||||||
isOpen: boolean
|
isOpen: boolean
|
||||||
|
@ -11,7 +10,6 @@ type ModalProps = {
|
||||||
}
|
}
|
||||||
|
|
||||||
function Modal({
|
function Modal({
|
||||||
title = '',
|
|
||||||
children,
|
children,
|
||||||
disableOutsideClose = false,
|
disableOutsideClose = false,
|
||||||
isOpen,
|
isOpen,
|
||||||
|
@ -31,7 +29,7 @@ function Modal({
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
/>
|
/>
|
||||||
<div className="fixed inset-0 flex items-center justify-center px-4 text-center">
|
<div className="fixed inset-0 flex items-center justify-center px-4 text-center">
|
||||||
<Dialog.Panel className="relative max-w-md rounded-lg border border-th-bkg-3 bg-th-bkg-1 p-6">
|
<Dialog.Panel className="relative w-full max-w-md rounded-lg border border-th-bkg-3 bg-th-bkg-1 p-6">
|
||||||
{!hideClose ? (
|
{!hideClose ? (
|
||||||
<button
|
<button
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
|
@ -40,11 +38,7 @@ function Modal({
|
||||||
<XMarkIcon className={`h-6 w-6`} />
|
<XMarkIcon className={`h-6 w-6`} />
|
||||||
</button>
|
</button>
|
||||||
) : null}
|
) : null}
|
||||||
{/* <div className="my-8 w-full p-6 text-left align-middle shadow-xl"> */}
|
<div>{children}</div>
|
||||||
<div>
|
|
||||||
<Dialog.Title>{title}</Dialog.Title>
|
|
||||||
{children}
|
|
||||||
</div>
|
|
||||||
</Dialog.Panel>
|
</Dialog.Panel>
|
||||||
</div>
|
</div>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
"clear-all": "Clear All",
|
"clear-all": "Clear All",
|
||||||
"close-account": "Close Account",
|
"close-account": "Close Account",
|
||||||
"close-account-desc": "Are you sure? Closing your account is irreversible.",
|
"close-account-desc": "Are you sure? Closing your account is irreversible",
|
||||||
"closing-account": "Closing your account...",
|
"closing-account": "Closing your account...",
|
||||||
"collateral-value": "Collateral Value",
|
"collateral-value": "Collateral Value",
|
||||||
"connect": "Connect",
|
"connect": "Connect",
|
||||||
|
@ -41,6 +41,8 @@
|
||||||
"date-from": "Date From",
|
"date-from": "Date From",
|
||||||
"date-to": "Date To",
|
"date-to": "Date To",
|
||||||
"delegate-account": "Delegate Account",
|
"delegate-account": "Delegate Account",
|
||||||
|
"delegate-desc": "Delegate your Mango account to another wallet address",
|
||||||
|
"delegate-placeholder": "Enter a wallet address to delegate to",
|
||||||
"deposit": "Deposit",
|
"deposit": "Deposit",
|
||||||
"deposit-more-sol": "Deposit more SOL to your wallet before creating an account.",
|
"deposit-more-sol": "Deposit more SOL to your wallet before creating an account.",
|
||||||
"deposit-rate": "Deposit Rate (APR)",
|
"deposit-rate": "Deposit Rate (APR)",
|
||||||
|
@ -106,6 +108,7 @@
|
||||||
"updating-account-name": "Updating Account Name...",
|
"updating-account-name": "Updating Account Name...",
|
||||||
"utilization": "Utilization",
|
"utilization": "Utilization",
|
||||||
"value": "Value",
|
"value": "Value",
|
||||||
|
"wallet-address": "Wallet Address",
|
||||||
"wallet-balance": "Wallet Balance",
|
"wallet-balance": "Wallet Balance",
|
||||||
"wallet-disconnected": "Disconnected from wallet",
|
"wallet-disconnected": "Disconnected from wallet",
|
||||||
"withdraw": "Withdraw",
|
"withdraw": "Withdraw",
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
"clear-all": "Clear All",
|
"clear-all": "Clear All",
|
||||||
"close-account": "Close Account",
|
"close-account": "Close Account",
|
||||||
"close-account-desc": "Are you sure? Closing your account is irreversible.",
|
"close-account-desc": "Are you sure? Closing your account is irreversible",
|
||||||
"closing-account": "Closing your account...",
|
"closing-account": "Closing your account...",
|
||||||
"collateral-value": "Collateral Value",
|
"collateral-value": "Collateral Value",
|
||||||
"connect": "Connect",
|
"connect": "Connect",
|
||||||
|
@ -41,6 +41,8 @@
|
||||||
"date-from": "Date From",
|
"date-from": "Date From",
|
||||||
"date-to": "Date To",
|
"date-to": "Date To",
|
||||||
"delegate-account": "Delegate Account",
|
"delegate-account": "Delegate Account",
|
||||||
|
"delegate-desc": "Delegate your Mango account to another wallet address",
|
||||||
|
"delegate-placeholder": "Enter a wallet address to delegate to",
|
||||||
"deposit": "Deposit",
|
"deposit": "Deposit",
|
||||||
"deposit-more-sol": "Deposit more SOL to your wallet before creating an account.",
|
"deposit-more-sol": "Deposit more SOL to your wallet before creating an account.",
|
||||||
"deposit-rate": "Deposit Rate (APR)",
|
"deposit-rate": "Deposit Rate (APR)",
|
||||||
|
@ -106,6 +108,7 @@
|
||||||
"updating-account-name": "Updating Account Name...",
|
"updating-account-name": "Updating Account Name...",
|
||||||
"utilization": "Utilization",
|
"utilization": "Utilization",
|
||||||
"value": "Value",
|
"value": "Value",
|
||||||
|
"wallet-address": "Wallet Address",
|
||||||
"wallet-balance": "Wallet Balance",
|
"wallet-balance": "Wallet Balance",
|
||||||
"wallet-disconnected": "Disconnected from wallet",
|
"wallet-disconnected": "Disconnected from wallet",
|
||||||
"withdraw": "Withdraw",
|
"withdraw": "Withdraw",
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
"clear-all": "Clear All",
|
"clear-all": "Clear All",
|
||||||
"close-account": "Close Account",
|
"close-account": "Close Account",
|
||||||
"close-account-desc": "Are you sure? Closing your account is irreversible.",
|
"close-account-desc": "Are you sure? Closing your account is irreversible",
|
||||||
"closing-account": "Closing your account...",
|
"closing-account": "Closing your account...",
|
||||||
"collateral-value": "Collateral Value",
|
"collateral-value": "Collateral Value",
|
||||||
"connect": "Connect",
|
"connect": "Connect",
|
||||||
|
@ -35,12 +35,14 @@
|
||||||
"copy-address-success": "Copied address: {{pk}}",
|
"copy-address-success": "Copied address: {{pk}}",
|
||||||
"create-account": "Create Account",
|
"create-account": "Create Account",
|
||||||
"creating-account": "Creating Account...",
|
"creating-account": "Creating Account...",
|
||||||
"cumulative-interest-value": "Cumulative Interest Value",
|
"cumulative-interest-value": "Cumulative Interest Earned",
|
||||||
"daily-volume": "24h Volume",
|
"daily-volume": "24h Volume",
|
||||||
"date": "Date",
|
"date": "Date",
|
||||||
"date-from": "Date From",
|
"date-from": "Date From",
|
||||||
"date-to": "Date To",
|
"date-to": "Date To",
|
||||||
"delegate-account": "Delegate Account",
|
"delegate-account": "Delegate Account",
|
||||||
|
"delegate-desc": "Delegate your Mango account to another wallet address",
|
||||||
|
"delegate-placeholder": "Enter a wallet address to delegate to",
|
||||||
"deposit": "Deposit",
|
"deposit": "Deposit",
|
||||||
"deposit-more-sol": "Deposit more SOL to your wallet before creating an account.",
|
"deposit-more-sol": "Deposit more SOL to your wallet before creating an account.",
|
||||||
"deposit-rate": "Deposit Rate (APR)",
|
"deposit-rate": "Deposit Rate (APR)",
|
||||||
|
@ -79,7 +81,6 @@
|
||||||
"rates": "Rates (APR)",
|
"rates": "Rates (APR)",
|
||||||
"remove": "Remove",
|
"remove": "Remove",
|
||||||
"rolling-change": "24h Change",
|
"rolling-change": "24h Change",
|
||||||
"russian": "Русский",
|
|
||||||
"save": "Save",
|
"save": "Save",
|
||||||
"select-token": "Select Token",
|
"select-token": "Select Token",
|
||||||
"sell": "Sell",
|
"sell": "Sell",
|
||||||
|
@ -107,6 +108,7 @@
|
||||||
"updating-account-name": "Updating Account Name...",
|
"updating-account-name": "Updating Account Name...",
|
||||||
"utilization": "Utilization",
|
"utilization": "Utilization",
|
||||||
"value": "Value",
|
"value": "Value",
|
||||||
|
"wallet-address": "Wallet Address",
|
||||||
"wallet-balance": "Wallet Balance",
|
"wallet-balance": "Wallet Balance",
|
||||||
"wallet-disconnected": "Disconnected from wallet",
|
"wallet-disconnected": "Disconnected from wallet",
|
||||||
"withdraw": "Withdraw",
|
"withdraw": "Withdraw",
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
"clear-all": "Clear All",
|
"clear-all": "Clear All",
|
||||||
"close-account": "Close Account",
|
"close-account": "Close Account",
|
||||||
"close-account-desc": "Are you sure? Closing your account is irreversible.",
|
"close-account-desc": "Are you sure? Closing your account is irreversible",
|
||||||
"closing-account": "Closing your account...",
|
"closing-account": "Closing your account...",
|
||||||
"collateral-value": "Collateral Value",
|
"collateral-value": "Collateral Value",
|
||||||
"connect": "Connect",
|
"connect": "Connect",
|
||||||
|
@ -41,6 +41,8 @@
|
||||||
"date-from": "Date From",
|
"date-from": "Date From",
|
||||||
"date-to": "Date To",
|
"date-to": "Date To",
|
||||||
"delegate-account": "Delegate Account",
|
"delegate-account": "Delegate Account",
|
||||||
|
"delegate-desc": "Delegate your Mango account to another wallet address",
|
||||||
|
"delegate-placeholder": "Enter a wallet address to delegate to",
|
||||||
"deposit": "Deposit",
|
"deposit": "Deposit",
|
||||||
"deposit-more-sol": "Deposit more SOL to your wallet before creating an account.",
|
"deposit-more-sol": "Deposit more SOL to your wallet before creating an account.",
|
||||||
"deposit-rate": "Deposit Rate (APR)",
|
"deposit-rate": "Deposit Rate (APR)",
|
||||||
|
@ -106,6 +108,7 @@
|
||||||
"updating-account-name": "Updating Account Name...",
|
"updating-account-name": "Updating Account Name...",
|
||||||
"utilization": "Utilization",
|
"utilization": "Utilization",
|
||||||
"value": "Value",
|
"value": "Value",
|
||||||
|
"wallet-address": "Wallet Address",
|
||||||
"wallet-balance": "Wallet Balance",
|
"wallet-balance": "Wallet Balance",
|
||||||
"wallet-disconnected": "Disconnected from wallet",
|
"wallet-disconnected": "Disconnected from wallet",
|
||||||
"withdraw": "Withdraw",
|
"withdraw": "Withdraw",
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
"clear-all": "Clear All",
|
"clear-all": "Clear All",
|
||||||
"close-account": "Close Account",
|
"close-account": "Close Account",
|
||||||
"close-account-desc": "Are you sure? Closing your account is irreversible.",
|
"close-account-desc": "Are you sure? Closing your account is irreversible",
|
||||||
"closing-account": "Closing your account...",
|
"closing-account": "Closing your account...",
|
||||||
"collateral-value": "Collateral Value",
|
"collateral-value": "Collateral Value",
|
||||||
"connect": "Connect",
|
"connect": "Connect",
|
||||||
|
@ -41,6 +41,8 @@
|
||||||
"date-from": "Date From",
|
"date-from": "Date From",
|
||||||
"date-to": "Date To",
|
"date-to": "Date To",
|
||||||
"delegate-account": "Delegate Account",
|
"delegate-account": "Delegate Account",
|
||||||
|
"delegate-desc": "Delegate your Mango account to another wallet address",
|
||||||
|
"delegate-placeholder": "Enter a wallet address to delegate to",
|
||||||
"deposit": "Deposit",
|
"deposit": "Deposit",
|
||||||
"deposit-more-sol": "Deposit more SOL to your wallet before creating an account.",
|
"deposit-more-sol": "Deposit more SOL to your wallet before creating an account.",
|
||||||
"deposit-rate": "Deposit Rate (APR)",
|
"deposit-rate": "Deposit Rate (APR)",
|
||||||
|
@ -84,8 +86,8 @@
|
||||||
"sell": "Sell",
|
"sell": "Sell",
|
||||||
"settings": "Settings",
|
"settings": "Settings",
|
||||||
"show-zero-balances": "Show Zero Balances",
|
"show-zero-balances": "Show Zero Balances",
|
||||||
"spot": "Spot",
|
|
||||||
"solana-tps": "Solana TPS",
|
"solana-tps": "Solana TPS",
|
||||||
|
"spot": "Spot",
|
||||||
"stats": "Stats",
|
"stats": "Stats",
|
||||||
"swap": "Swap",
|
"swap": "Swap",
|
||||||
"time": "Time",
|
"time": "Time",
|
||||||
|
@ -106,6 +108,7 @@
|
||||||
"updating-account-name": "Updating Account Name...",
|
"updating-account-name": "Updating Account Name...",
|
||||||
"utilization": "Utilization",
|
"utilization": "Utilization",
|
||||||
"value": "Value",
|
"value": "Value",
|
||||||
|
"wallet-address": "Wallet Address",
|
||||||
"wallet-balance": "Wallet Balance",
|
"wallet-balance": "Wallet Balance",
|
||||||
"wallet-disconnected": "Disconnected from wallet",
|
"wallet-disconnected": "Disconnected from wallet",
|
||||||
"withdraw": "Withdraw",
|
"withdraw": "Withdraw",
|
||||||
|
|
Loading…
Reference in New Issue