add market name conventions to list form

This commit is contained in:
saml33 2023-06-16 12:28:19 +10:00
parent 68a3aad79a
commit bba4c7208b
7 changed files with 93 additions and 29 deletions

View File

@ -60,7 +60,7 @@ const defaultFormValues: ListMarketForm = {
const ListMarket = ({ goBack }: { goBack: () => void }) => { const ListMarket = ({ goBack }: { goBack: () => void }) => {
const wallet = useWallet() const wallet = useWallet()
const { handleConnect } = useEnhancedWallet() const { handleConnect } = useEnhancedWallet()
const { t } = useTranslation(['governance']) const { t } = useTranslation(['governance', 'trade'])
const { group } = useMangoGroup() const { group } = useMangoGroup()
const connection = mangoStore((s) => s.connection) const connection = mangoStore((s) => s.connection)
const client = mangoStore((s) => s.client) const client = mangoStore((s) => s.client)
@ -375,16 +375,52 @@ const ListMarket = ({ goBack }: { goBack: () => void }) => {
) : null} ) : null}
</> </>
) : ( ) : (
<div className="rounded-md bg-th-bkg-2 p-4"> <>
<h3 className="mb-2">{t('market-details')}</h3> <div className="mb-4 rounded-md bg-th-bkg-2 p-4">
<div className="flex items-center justify-between"> <h3 className="mb-1">{t('market-name')}</h3>
<p>{t('market-name')}</p> <div className="mb-2 flex items-center">
<p className="text-th-fgd-2">{`${baseToken}/${quoteToken}`}</p> <ExclamationTriangleIcon className="mr-1.5 h-5 w-5 text-th-warning" />
<p className="text-base text-th-fgd-2">
{t('market-name-desc')}
</p>
</div> </div>
<ul className="ml-4 mb-4 list-outside list-decimal space-y-1">
<li>{t('market-name-convention-1')}</li>
<li>{t('market-name-convention-2')}</li>
<li>{t('market-name-convention-3')}</li>
<li>{t('market-name-convention-4')}</li>
<li>{t('market-name-convention-5')}</li>
<li>
{t('market-name-convention-6')}
<a
href="https://discord.gg/2uwjsBc5yw"
target="_blank"
rel="noopener noreferrer"
>
Discord
</a>
</li>
</ul>
<Label className="mb-2" text={t('market-name')} />
<Input
hasError={formErrors.marketName !== undefined}
type="text"
value={advForm.marketName.toString()}
onChange={(e: ChangeEvent<HTMLInputElement>) =>
handleSetAdvForm('marketName', e.target.value)
}
/>
</div>
<div className="rounded-md bg-th-bkg-2 p-4">
<h3 className="mb-2">
{t('trade:market-details', { market: '' })}
</h3>
{tradingParams.minOrderSize ? ( {tradingParams.minOrderSize ? (
<div className="mt-2 flex items-center justify-between"> <div className="mt-2 flex items-center justify-between">
<p>{t('min-order')}</p> <p>{t('min-order')}</p>
<p className="text-th-fgd-2">{tradingParams.minOrderSize}</p> <p className="text-th-fgd-2">
{tradingParams.minOrderSize}
</p>
</div> </div>
) : null} ) : null}
{tradingParams.minOrderSize ? ( {tradingParams.minOrderSize ? (
@ -396,6 +432,7 @@ const ListMarket = ({ goBack }: { goBack: () => void }) => {
</div> </div>
) : null} ) : null}
</div> </div>
</>
)} )}
{marketPk ? ( {marketPk ? (
<Disclosure> <Disclosure>
@ -424,15 +461,6 @@ const ListMarket = ({ goBack }: { goBack: () => void }) => {
<Disclosure.Panel> <Disclosure.Panel>
<div className="space-y-4 rounded-md rounded-t-none bg-th-bkg-2 p-4"> <div className="space-y-4 rounded-md rounded-t-none bg-th-bkg-2 p-4">
<div> <div>
<Label text={t('market-name')} />
<Input
hasError={formErrors.marketName !== undefined}
type="text"
value={advForm.marketName.toString()}
onChange={(e: ChangeEvent<HTMLInputElement>) =>
handleSetAdvForm('marketName', e.target.value)
}
/>
{formErrors.marketName && ( {formErrors.marketName && (
<div className="mt-1.5 flex items-center space-x-1"> <div className="mt-1.5 flex items-center space-x-1">
<ExclamationCircleIcon className="h-4 w-4 text-th-down" /> <ExclamationCircleIcon className="h-4 w-4 text-th-down" />

View File

@ -16,6 +16,7 @@ export async function getStaticProps({ locale }: { locale: string }) {
'onboarding', 'onboarding',
'profile', 'profile',
'search', 'search',
'trade',
])), ])),
}, },
} }

View File

@ -39,6 +39,13 @@
"market-created-successful": "Market created successfully", "market-created-successful": "Market created successfully",
"market-index": "Market Index", "market-index": "Market Index",
"market-name": "Market Name", "market-name": "Market Name",
"market-name-convention-1": "The base symbol for each token should be uppercase",
"market-name-convention-2": "If either token is bridged via Portal append 'po' to the base symbol e.g. ETHpo",
"market-name-convention-3": "If either token is a liquid staking derivative prepend the characters to the base symbol in lowercase e.g. mSOL",
"market-name-convention-4": "If either token is wrapped prepend a lowercase 'w'",
"market-name-convention-5": "Tokens are separated by '/' with no spaces",
"market-name-convention-6": "If it isn't clear what the market name should be reach out to us on ",
"market-name-desc": "Follow these conventions when creating the market name:",
"market-pair": "Market Pair", "market-pair": "Market Pair",
"min-order": "Min Order Size", "min-order": "Min Order Size",
"mint": "Mint", "mint": "Mint",

View File

@ -39,6 +39,13 @@
"market-created-successful": "Market created successfully", "market-created-successful": "Market created successfully",
"market-index": "Market Index", "market-index": "Market Index",
"market-name": "Market Name", "market-name": "Market Name",
"market-name-convention-1": "The base symbol for each token should be uppercase",
"market-name-convention-2": "If either token is bridged via Portal append 'po' to the base symbol e.g. ETHpo",
"market-name-convention-3": "If either token is a liquid staking derivative prepend the characters to the base symbol in lowercase e.g. mSOL",
"market-name-convention-4": "If either token is wrapped prepend a lowercase 'w'",
"market-name-convention-5": "Tokens are separated by '/' with no spaces",
"market-name-convention-6": "If it isn't clear what the market name should be reach out to us on ",
"market-name-desc": "Follow these conventions when creating the market name:",
"market-pair": "Market Pair", "market-pair": "Market Pair",
"min-order": "Min Order Size", "min-order": "Min Order Size",
"mint": "Mint", "mint": "Mint",

View File

@ -39,6 +39,13 @@
"market-created-successful": "Market created successfully", "market-created-successful": "Market created successfully",
"market-index": "Market Index", "market-index": "Market Index",
"market-name": "Market Name", "market-name": "Market Name",
"market-name-convention-1": "The base symbol for each token should be uppercase",
"market-name-convention-2": "If either token is bridged via Portal append 'po' to the base symbol e.g. ETHpo",
"market-name-convention-3": "If either token is a liquid staking derivative prepend the characters to the base symbol in lowercase e.g. mSOL",
"market-name-convention-4": "If either token is wrapped prepend a lowercase 'w'",
"market-name-convention-5": "Tokens are separated by '/' with no spaces",
"market-name-convention-6": "If it isn't clear what the market name should be reach out to us on ",
"market-name-desc": "Follow these conventions when creating the market name:",
"market-pair": "Market Pair", "market-pair": "Market Pair",
"min-order": "Min Order Size", "min-order": "Min Order Size",
"mint": "Mint", "mint": "Mint",

View File

@ -39,6 +39,13 @@
"market-created-successful": "Market created successfully", "market-created-successful": "Market created successfully",
"market-index": "Market Index", "market-index": "Market Index",
"market-name": "Market Name", "market-name": "Market Name",
"market-name-convention-1": "The base symbol for each token should be uppercase",
"market-name-convention-2": "If either token is bridged via Portal append 'po' to the base symbol e.g. ETHpo",
"market-name-convention-3": "If either token is a liquid staking derivative prepend the characters to the base symbol in lowercase e.g. mSOL",
"market-name-convention-4": "If either token is wrapped prepend a lowercase 'w'",
"market-name-convention-5": "Tokens are separated by '/' with no spaces",
"market-name-convention-6": "If it isn't clear what the market name should be reach out to us on ",
"market-name-desc": "Follow these conventions when creating the market name:",
"market-pair": "Market Pair", "market-pair": "Market Pair",
"min-order": "Min Order Size", "min-order": "Min Order Size",
"mint": "Mint", "mint": "Mint",

View File

@ -39,6 +39,13 @@
"market-created-successful": "Market created successfully", "market-created-successful": "Market created successfully",
"market-index": "Market Index", "market-index": "Market Index",
"market-name": "Market Name", "market-name": "Market Name",
"market-name-convention-1": "The base symbol for each token should be uppercase",
"market-name-convention-2": "If either token is bridged via Portal append 'po' to the base symbol e.g. ETHpo",
"market-name-convention-3": "If either token is a liquid staking derivative prepend the characters to the base symbol in lowercase e.g. mSOL",
"market-name-convention-4": "If either token is wrapped prepend a lowercase 'w'",
"market-name-convention-5": "Tokens are separated by '/' with no spaces",
"market-name-convention-6": "If it isn't clear what the market name should be reach out to us on ",
"market-name-desc": "Follow these conventions when creating the market name:",
"market-pair": "Market Pair", "market-pair": "Market Pair",
"min-order": "Min Order Size", "min-order": "Min Order Size",
"mint": "Mint", "mint": "Mint",