fix modals

This commit is contained in:
saml33 2022-11-17 13:18:50 +11:00
parent 903884b732
commit c9b94f4e55
8 changed files with 28 additions and 22 deletions

View File

@ -1,5 +1,5 @@
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}{' '}
{optional ? (
<span className="ml-1 text-xs text-th-fgd-4">(Optional)</span>

View File

@ -74,15 +74,13 @@ const DelegateModal = ({ isOpen, onClose }: ModalProps) => {
<div className="flex h-full flex-col justify-between">
<div className="pb-4">
<h2 className="mb-1">{t('delegate-account')}</h2>
<p className="mb-4">
Delegate your Mango account to another wallet address.{' '}
</p>
<Label text={'Wallet address'} />
<p className="mb-4">{t('delegate-desc')}</p>
<Label text={t('wallet-address')} />
<Input
type="text"
name="name"
id="name"
placeholder="Enter a wallet address to delegate to"
placeholder={t('delegate-placeholder')}
value={delegateAddress}
onChange={(e: ChangeEvent<HTMLInputElement>) =>
setDelegateAddress(e.target.value)

View File

@ -2,7 +2,6 @@ import { Dialog } from '@headlessui/react'
import { XMarkIcon } from '@heroicons/react/20/solid'
type ModalProps = {
title?: string
children: React.ReactNode
disableOutsideClose?: boolean
isOpen: boolean
@ -11,7 +10,6 @@ type ModalProps = {
}
function Modal({
title = '',
children,
disableOutsideClose = false,
isOpen,
@ -31,7 +29,7 @@ function Modal({
aria-hidden="true"
/>
<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 ? (
<button
onClick={onClose}
@ -40,11 +38,7 @@ function Modal({
<XMarkIcon className={`h-6 w-6`} />
</button>
) : null}
{/* <div className="my-8 w-full p-6 text-left align-middle shadow-xl"> */}
<div>
<Dialog.Title>{title}</Dialog.Title>
{children}
</div>
<div>{children}</div>
</Dialog.Panel>
</div>
</Dialog>

View File

@ -26,7 +26,7 @@
"cancel": "Cancel",
"clear-all": "Clear All",
"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...",
"collateral-value": "Collateral Value",
"connect": "Connect",
@ -41,6 +41,8 @@
"date-from": "Date From",
"date-to": "Date To",
"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-more-sol": "Deposit more SOL to your wallet before creating an account.",
"deposit-rate": "Deposit Rate (APR)",
@ -106,6 +108,7 @@
"updating-account-name": "Updating Account Name...",
"utilization": "Utilization",
"value": "Value",
"wallet-address": "Wallet Address",
"wallet-balance": "Wallet Balance",
"wallet-disconnected": "Disconnected from wallet",
"withdraw": "Withdraw",

View File

@ -26,7 +26,7 @@
"cancel": "Cancel",
"clear-all": "Clear All",
"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...",
"collateral-value": "Collateral Value",
"connect": "Connect",
@ -41,6 +41,8 @@
"date-from": "Date From",
"date-to": "Date To",
"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-more-sol": "Deposit more SOL to your wallet before creating an account.",
"deposit-rate": "Deposit Rate (APR)",
@ -106,6 +108,7 @@
"updating-account-name": "Updating Account Name...",
"utilization": "Utilization",
"value": "Value",
"wallet-address": "Wallet Address",
"wallet-balance": "Wallet Balance",
"wallet-disconnected": "Disconnected from wallet",
"withdraw": "Withdraw",

View File

@ -26,7 +26,7 @@
"cancel": "Cancel",
"clear-all": "Clear All",
"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...",
"collateral-value": "Collateral Value",
"connect": "Connect",
@ -35,12 +35,14 @@
"copy-address-success": "Copied address: {{pk}}",
"create-account": "Create Account",
"creating-account": "Creating Account...",
"cumulative-interest-value": "Cumulative Interest Value",
"cumulative-interest-value": "Cumulative Interest Earned",
"daily-volume": "24h Volume",
"date": "Date",
"date-from": "Date From",
"date-to": "Date To",
"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-more-sol": "Deposit more SOL to your wallet before creating an account.",
"deposit-rate": "Deposit Rate (APR)",
@ -79,7 +81,6 @@
"rates": "Rates (APR)",
"remove": "Remove",
"rolling-change": "24h Change",
"russian": "Русский",
"save": "Save",
"select-token": "Select Token",
"sell": "Sell",
@ -107,6 +108,7 @@
"updating-account-name": "Updating Account Name...",
"utilization": "Utilization",
"value": "Value",
"wallet-address": "Wallet Address",
"wallet-balance": "Wallet Balance",
"wallet-disconnected": "Disconnected from wallet",
"withdraw": "Withdraw",

View File

@ -26,7 +26,7 @@
"cancel": "Cancel",
"clear-all": "Clear All",
"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...",
"collateral-value": "Collateral Value",
"connect": "Connect",
@ -41,6 +41,8 @@
"date-from": "Date From",
"date-to": "Date To",
"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-more-sol": "Deposit more SOL to your wallet before creating an account.",
"deposit-rate": "Deposit Rate (APR)",
@ -106,6 +108,7 @@
"updating-account-name": "Updating Account Name...",
"utilization": "Utilization",
"value": "Value",
"wallet-address": "Wallet Address",
"wallet-balance": "Wallet Balance",
"wallet-disconnected": "Disconnected from wallet",
"withdraw": "Withdraw",

View File

@ -26,7 +26,7 @@
"cancel": "Cancel",
"clear-all": "Clear All",
"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...",
"collateral-value": "Collateral Value",
"connect": "Connect",
@ -41,6 +41,8 @@
"date-from": "Date From",
"date-to": "Date To",
"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-more-sol": "Deposit more SOL to your wallet before creating an account.",
"deposit-rate": "Deposit Rate (APR)",
@ -84,8 +86,8 @@
"sell": "Sell",
"settings": "Settings",
"show-zero-balances": "Show Zero Balances",
"spot": "Spot",
"solana-tps": "Solana TPS",
"spot": "Spot",
"stats": "Stats",
"swap": "Swap",
"time": "Time",
@ -106,6 +108,7 @@
"updating-account-name": "Updating Account Name...",
"utilization": "Utilization",
"value": "Value",
"wallet-address": "Wallet Address",
"wallet-balance": "Wallet Balance",
"wallet-disconnected": "Disconnected from wallet",
"withdraw": "Withdraw",