{showingPartialDirectory ? (
- {TSX_STRINGS.componentsSecurityPoolVaultDirectory.copy001}
- {loadedVaultCount.toString()} {TSX_STRINGS.componentsSecurityPoolVaultDirectory.copy002}
- {pool.vaultCount.toString()} {TSX_STRINGS.componentsSecurityPoolVaultDirectory.copy003}
+ {UI_STRING_SHOWING_PREFIX}
+ {loadedVaultCount.toString()} {UI_STRING_OF_PREFIX}
+ {pool.vaultCount.toString()} {UI_STRING_ACTIVE_VAULTS_NEWEST_ACTIVITY_FIRST_ENTER_A_VAULT_ADDRESS_ABOVE_TO_INSPECT}
) : null}
{pool.vaults.map(vault => {
diff --git a/ui/ts/components/SecurityPoolsOverviewSection.tsx b/ui/ts/components/SecurityPoolsOverviewSection.tsx
index 7384a557..52ad6aee 100644
--- a/ui/ts/components/SecurityPoolsOverviewSection.tsx
+++ b/ui/ts/components/SecurityPoolsOverviewSection.tsx
@@ -25,7 +25,57 @@ import { openInterestFeePerYearBigint } from '../lib/retentionRate.js'
import { getSecurityPoolStatusBadgeLabel } from '../lib/securityPoolLabels.js'
import { deriveSecurityPoolLifecycleState, evaluateSecurityPoolState, type SecurityPoolLifecycleState } from '../lib/securityPoolState.js'
import { getPoolCollateralizationPercent, getVaultCollateralizationPercent } from '../lib/trading.js'
-import { CURATED_TSX_STRINGS, UI_STRINGS, TSX_STRINGS } from '../lib/uiStrings.js'
+import {
+ UI_STRING_ACTIVE_VAULTS_IN_THIS_PREVIEW_NEWEST_ACTIVITY_FIRST,
+ UI_STRING_ALL_POOLS,
+ UI_STRING_ALL_STATES,
+ UI_STRING_ANNUAL_FEE,
+ UI_STRING_CREATE_SECURITY_POOL,
+ UI_STRING_ENDED,
+ UI_STRING_ETH,
+ UI_STRING_FILTER_THIS_PAGE_BY_POOL_ADDRESS_QUESTION_ID_OR_QUESTION_TEXT,
+ UI_STRING_FORK_MIGRATION,
+ UI_STRING_HAS_VAULTS,
+ UI_STRING_LOAD_SECURITY_POOLS,
+ UI_STRING_MANAGER_ADDRESS,
+ UI_STRING_MAX_PREFIX,
+ UI_STRING_MULTIPLIER,
+ UI_STRING_NONE,
+ UI_STRING_NO_MATCHES,
+ UI_STRING_NO_POOLS_MATCH_THE_CURRENT_SEARCH_AND_FILTER_SETTINGS,
+ UI_STRING_NO_SECURITY_POOLS,
+ UI_STRING_NO_VAULTS_IN_THIS_POOL,
+ UI_STRING_NO_VAULTS,
+ UI_STRING_OF_PREFIX,
+ UI_STRING_OPEN_INTEREST_MINTED,
+ UI_STRING_OPEN_ORACLE_PRICE,
+ UI_STRING_OPEN_POOL,
+ UI_STRING_OPERATIONAL,
+ UI_STRING_PERCENT,
+ UI_STRING_POOLS_SHOWN_ON_THIS_PAGE,
+ UI_STRING_POOL_ADDRESS,
+ UI_STRING_POOL_COLLATERALIZATION,
+ UI_STRING_POOL_FORKED,
+ UI_STRING_QUESTION_ID,
+ UI_STRING_REP,
+ UI_STRING_REP_COLLATERAL,
+ UI_STRING_RETRYING_SECURITY_POOLS_TRUNCATED,
+ UI_STRING_RETRY_LOADING_POOLS,
+ UI_STRING_REVIEW_LIQUIDATION,
+ UI_STRING_REVIEW_LIQUIDATION_DETAILS_FOR_THIS_VAULT_BEFORE_QUEUEING_THE_ACTION,
+ UI_STRING_SEARCH_LOADED_PAGE,
+ UI_STRING_SECURITY_BOND_ALLOWANCE,
+ UI_STRING_SECURITY_POOLS,
+ UI_STRING_SHOWING_PREFIX,
+ UI_STRING_SYSTEM_STATE,
+ UI_STRING_TRUTH_AUCTION,
+ UI_STRING_UNAVAILABLE,
+ UI_STRING_UNIVERSE,
+ UI_STRING_VAULTS,
+ UI_STRING_VAULT_COVERAGE,
+ UI_STRING_VAULT_PREVIEW_UNAVAILABLE,
+ UI_TEMPLATE_VAULT_COUNT_LABEL,
+} from '../lib/uiStrings.js'
import { getPoolRegistryPresentation } from '../lib/userCopy.js'
import { getToneRatioThreshold, getVisualRatio } from '../lib/visualMetrics.js'
import type { SecurityPoolsOverviewSectionProps } from '../types/components.js'
@@ -141,10 +191,10 @@ export function SecurityPoolsOverviewSection({
return pool.securityPoolAddress.toLowerCase().includes(normalizedSearchText) || pool.questionId.toLowerCase().includes(normalizedSearchText) || pool.marketDetails.title.toLowerCase().includes(normalizedSearchText) || pool.marketDetails.description.toLowerCase().includes(normalizedSearchText)
})
return (
-
+
)}
- {filteredSecurityPools.length.toString()} {TSX_STRINGS.componentsSecurityPoolsOverviewSection.copy018}
- {pagedSecurityPools.length.toString()} {TSX_STRINGS.componentsSecurityPoolsOverviewSection.copy019}
+ {filteredSecurityPools.length.toString()} {UI_STRING_OF_PREFIX}
+ {pagedSecurityPools.length.toString()} {UI_STRING_POOLS_SHOWN_ON_THIS_PAGE}
) : undefined}
@@ -209,21 +259,21 @@ export function SecurityPoolsOverviewSection({
if (isEmptyRegistry && onCreateSecurityPool !== undefined)
return (
@@ -257,38 +307,38 @@ export function SecurityPoolsOverviewSection({
actions={
onSelectSecurityPool === undefined ? undefined : (
)
}
>
-
-
+
+
- {TSX_STRINGS.componentsSecurityPoolsOverviewSection.copy028}
+ {UI_STRING_VAULTS}
{pool.vaultCount.toString()}
- {TSX_STRINGS.componentsSecurityPoolsOverviewSection.copy029}
+ {UI_STRING_MULTIPLIER}
{pool.securityMultiplier.toString()}x
- {TSX_STRINGS.componentsSecurityPoolsOverviewSection.copy030}
+ {UI_STRING_ANNUAL_FEE}
-
+
-
{TSX_STRINGS.componentsSecurityPoolsOverviewSection.copy032}
+
{UI_STRING_OPEN_ORACLE_PRICE}
@@ -296,12 +346,12 @@ export function SecurityPoolsOverviewSection({
- {TSX_STRINGS.componentsSecurityPoolsOverviewSection.copy034}
-
+ {UI_STRING_MAX_PREFIX}
+
}
tone={getToneRatioThreshold({
@@ -310,34 +360,34 @@ export function SecurityPoolsOverviewSection({
warningThreshold: 0.85,
})}
value={pool.completeSetCollateralAmount}
- valueText={}
+ valueText={}
/>
-
+
-
+
- {pool.questionId}
-
+ {pool.questionId}
+
-
{TSX_STRINGS.componentsSecurityPoolsOverviewSection.copy041}
-
{CURATED_TSX_STRINGS.securityPoolsOverviewSection.vaultCountLabel(pool.vaultCount.toString())}
+
{UI_STRING_VAULTS}
+
{UI_TEMPLATE_VAULT_COUNT_LABEL(pool.vaultCount.toString())}
{pool.hasLoadedVaults === false ? (
-
+
) : (
{pool.vaults.length === 0 ? (
-
+
) : (
(() => {
const previewVaults = [...pool.vaults]
@@ -363,24 +413,24 @@ export function SecurityPoolsOverviewSection({
- {TSX_STRINGS.componentsSecurityPoolsOverviewSection.copy045}
+ {UI_STRING_SECURITY_BOND_ALLOWANCE}
-
+
- {TSX_STRINGS.componentsSecurityPoolsOverviewSection.copy047}
+ {UI_STRING_REP_COLLATERAL}
-
+
@@ -390,9 +440,9 @@ export function SecurityPoolsOverviewSection({
)}
{pool.vaultCount > BigInt(pool.vaults.length) ? (
- {TSX_STRINGS.componentsSecurityPoolsOverviewSection.copy051}
- {pool.vaults.length.toString()} {TSX_STRINGS.componentsSecurityPoolsOverviewSection.copy052}
- {pool.vaultCount.toString()} {TSX_STRINGS.componentsSecurityPoolsOverviewSection.copy053}
+ {UI_STRING_SHOWING_PREFIX}
+ {pool.vaults.length.toString()} {UI_STRING_OF_PREFIX}
+ {pool.vaultCount.toString()} {UI_STRING_ACTIVE_VAULTS_IN_THIS_PREVIEW_NEWEST_ACTIVITY_FIRST}
) : undefined}
diff --git a/ui/ts/components/SimulationBanner.tsx b/ui/ts/components/SimulationBanner.tsx
index 17ac4b25..8ad1915c 100644
--- a/ui/ts/components/SimulationBanner.tsx
+++ b/ui/ts/components/SimulationBanner.tsx
@@ -12,14 +12,76 @@ import { OperationModal } from './OperationModal.js'
import { TimestampValue } from './TimestampValue.js'
import { Badge } from './Badge.js'
import type { BadgeTone } from '../types/components.js'
-import { CURATED_TSX_STRINGS, TSX_STRINGS } from '../lib/uiStrings.js'
+import {
+ UI_STRING_1_DAY,
+ UI_STRING_1_HOUR,
+ UI_STRING_1_MONTH,
+ UI_STRING_1_WEEK,
+ UI_STRING_1_YEAR,
+ UI_STRING_ACTIONS,
+ UI_STRING_ACTIVE,
+ UI_STRING_BLOCKCHAIN_TIME,
+ UI_STRING_BLOCKS,
+ UI_STRING_BOOTSTRAPPING,
+ UI_STRING_BROWSER_SIMULATION,
+ UI_STRING_BUILT_IN_SCENARIOS,
+ UI_STRING_BUILT_IN_SCENARIOS_CANNOT_BE_DELETED,
+ UI_STRING_CONTROLS,
+ UI_STRING_COPIED,
+ UI_STRING_COPY_JSON,
+ UI_STRING_DELETE_SAVE,
+ UI_STRING_DELETE_SAVED_SIMULATION_STATE,
+ UI_STRING_ERROR,
+ UI_STRING_EXPORT_NAME,
+ UI_STRING_EXPORT_SIMULATION_STATE,
+ UI_STRING_EXPORT_STATE,
+ UI_STRING_FAILED_TO_EXPORT_THE_CURRENT_SIMULATION_STATE,
+ UI_STRING_FAILED_TO_UPDATE_THE_SAVED_SIMULATION_STATE,
+ UI_STRING_IMPORT_AND_LOAD,
+ UI_STRING_IMPORT_SIMULATION_STATE,
+ UI_STRING_IMPORT_STATE,
+ UI_STRING_JSON_STATE,
+ UI_STRING_MINE_BLOCK,
+ UI_STRING_MINT_1_MILLION_REP,
+ UI_STRING_NO_CORRUPTED_SAVED_SIMULATION_STATES_WERE_FOUND,
+ UI_STRING_PREPARING_THE_SELECTED_SIMULATION_SCENARIO_IN_THE_BACKGROUND,
+ UI_STRING_QA_ACCOUNT,
+ UI_STRING_QA_CONTROLS_PRICES_AND_TIME_TRAVEL,
+ UI_STRING_QUERY_DELAY_MS,
+ UI_STRING_SIMULATION_CONTROL_HELP_TEXT,
+ UI_STRING_READY,
+ UI_STRING_REFRESH_EXPORT,
+ UI_STRING_REMOVE_CORRUPTED_SAVED_STATES,
+ UI_STRING_REMOVE_CORRUPTED_SAVES,
+ UI_STRING_REMOVE_SAVED_SIMULATION_STATE_ENTRIES_THAT_ARE_NO_LONGER_READABLE_FROM_BROWSER,
+ UI_STRING_REP_ETH_MOCK_PRICE,
+ UI_STRING_REP_USDC_MOCK_PRICE,
+ UI_STRING_RESET_SCENARIO,
+ UI_STRING_SAVE,
+ UI_STRING_SAVED_STATES,
+ UI_STRING_SAVE_SIMULATION_STATE,
+ UI_STRING_SAVE_STATE,
+ UI_STRING_SCENARIO,
+ UI_STRING_SIMULATION_MODE,
+ UI_STRING_SIMULATION_QA_ACCOUNT,
+ UI_STRING_SIMULATION_SCENARIO,
+ UI_STRING_STATE_NAME,
+ UI_STRING_TIME_TRAVEL,
+ UI_STRING_TRANSACTIONS,
+ UI_STRING_TRANSACTION_RECEIPT_DELAY_MS,
+ UI_STRING_USE_THESE_CONTROLS_FOR_REPEATABLE_MANUAL_UI_QA_WITHOUT_A_WALLET_EXTENSION,
+ UI_TEMPLATE_CUSTOM_STATE_VALUE_BASED_ON_VALUE_SAVED_VALUE,
+ UI_TEMPLATE_DELETE_SAVED_SIMULATION_STATE_DETAIL,
+ UI_TEMPLATE_QA_VALUE,
+ UI_TEMPLATE_SAVED_SIMULATION_STATE_VALUE_NO_LONGER_EXISTS,
+} from '../lib/uiStrings.js'
const SIMULATION_TIME_PRESETS = [
- { label: TSX_STRINGS.componentsSimulationBanner.copy001, seconds: 60n * 60n },
- { label: TSX_STRINGS.componentsSimulationBanner.copy002, seconds: 24n * 60n * 60n },
- { label: TSX_STRINGS.componentsSimulationBanner.copy003, seconds: 7n * 24n * 60n * 60n },
- { label: TSX_STRINGS.componentsSimulationBanner.copy004, seconds: 30n * 24n * 60n * 60n },
- { label: TSX_STRINGS.componentsSimulationBanner.copy005, seconds: 365n * 24n * 60n * 60n },
+ { label: UI_STRING_1_HOUR, seconds: 60n * 60n },
+ { label: UI_STRING_1_DAY, seconds: 24n * 60n * 60n },
+ { label: UI_STRING_1_WEEK, seconds: 7n * 24n * 60n * 60n },
+ { label: UI_STRING_1_MONTH, seconds: 30n * 24n * 60n * 60n },
+ { label: UI_STRING_1_YEAR, seconds: 365n * 24n * 60n * 60n },
] as const
const SIMULATION_REP_MINT_AMOUNT = 1_000_000n * 10n ** 18n
type SimulationBannerProps = {
@@ -66,25 +128,25 @@ function hasSavedSimulationStateRoute() {
}
function getSimulationAccountOptionLabel(account: string) {
- return TSX_STRINGS.componentsSimulationBanner.copy006(account)
+ return UI_TEMPLATE_QA_VALUE(account)
}
function getScenarioStatus(parameters: { bootstrapError: string | undefined; isBootstrapped: boolean }): { badgeTone: BadgeTone; label: string } {
if (parameters.bootstrapError !== undefined) {
return {
badgeTone: 'blocked',
- label: TSX_STRINGS.componentsSimulationBanner.copy007,
+ label: UI_STRING_ERROR,
}
}
if (parameters.isBootstrapped) {
return {
badgeTone: 'ok',
- label: TSX_STRINGS.componentsSimulationBanner.copy008,
+ label: UI_STRING_READY,
}
}
return {
badgeTone: 'pending',
- label: TSX_STRINGS.componentsSimulationBanner.copy009,
+ label: UI_STRING_BOOTSTRAPPING,
}
}
@@ -180,7 +242,7 @@ export function SimulationBanner({ controller, onEnvironmentChanged = async () =
try {
await work()
} catch (error) {
- savedStateError.value = getErrorMessage(error, CURATED_TSX_STRINGS.simulationBanner.updateSavedStateError)
+ savedStateError.value = getErrorMessage(error, UI_STRING_FAILED_TO_UPDATE_THE_SAVED_SIMULATION_STATE)
} finally {
busy.value = false
}
@@ -209,13 +271,14 @@ export function SimulationBanner({ controller, onEnvironmentChanged = async () =
try {
exportStateText.value = await controller.exportState(nextName)
} catch (error) {
- savedStateError.value = getErrorMessage(error, CURATED_TSX_STRINGS.simulationBanner.exportStateError)
+ savedStateError.value = getErrorMessage(error, UI_STRING_FAILED_TO_EXPORT_THE_CURRENT_SIMULATION_STATE)
}
}
let scenarioDetail = bootstrapError.value
if (scenarioDetail === undefined) {
- scenarioDetail = currentSource.value.kind === 'saved-state' ? TSX_STRINGS.componentsSimulationBanner.copy010(currentSource.value.name, getSimulationScenarioLabel(currentSource.value.baseScenario), new Date(currentSource.value.savedAt).toLocaleString()) : getSimulationScenarioDescription(currentScenario.value)
+ scenarioDetail =
+ currentSource.value.kind === 'saved-state' ? UI_TEMPLATE_CUSTOM_STATE_VALUE_BASED_ON_VALUE_SAVED_VALUE(currentSource.value.name, getSimulationScenarioLabel(currentSource.value.baseScenario), new Date(currentSource.value.savedAt).toLocaleString()) : getSimulationScenarioDescription(currentScenario.value)
}
const scenarioStatus = getScenarioStatus({
bootstrapError: bootstrapError.value,
@@ -226,8 +289,8 @@ export function SimulationBanner({ controller, onEnvironmentChanged = async () =
-
{TSX_STRINGS.componentsSimulationBanner.copy011}
-
{TSX_STRINGS.componentsSimulationBanner.copy012}
+
{UI_STRING_SIMULATION_MODE}
+
{UI_STRING_BROWSER_SIMULATION}
@@ -235,14 +298,14 @@ export function SimulationBanner({ controller, onEnvironmentChanged = async () =
{scenarioStatus.label}
-
{TSX_STRINGS.componentsSimulationBanner.copy013}
+ {UI_STRING_SCENARIO}
{scenarioDetail}
{savedStateStorageWarning.value === undefined ? undefined :
{savedStateStorageWarning.value}
}
{bootstrapError.value === undefined && isBootstrapping.value ? (
- {bootstrapLabel.value ?? TSX_STRINGS.componentsSimulationBanner.copy014}
+ {bootstrapLabel.value ?? UI_STRING_PREPARING_THE_SELECTED_SIMULATION_SCENARIO_IN_THE_BACKGROUND}
) : undefined}
{isBootstrapping.value ? (
@@ -253,7 +316,7 @@ export function SimulationBanner({ controller, onEnvironmentChanged = async () =
-
- {currentSource.value.kind === 'saved-state' ? TSX_STRINGS.componentsSimulationBanner.copy055(currentSource.value.name) : TSX_STRINGS.componentsSimulationBanner.copy056}
+
+ {currentSource.value.kind === 'saved-state' ? UI_TEMPLATE_DELETE_SAVED_SIMULATION_STATE_DETAIL(currentSource.value.name) : UI_STRING_BUILT_IN_SCENARIOS_CANNOT_BE_DELETED}
{savedStateError.value === undefined ? undefined : {savedStateError.value}
}
-
- {TSX_STRINGS.componentsSimulationBanner.copy059}
+
+ {UI_STRING_REMOVE_SAVED_SIMULATION_STATE_ENTRIES_THAT_ARE_NO_LONGER_READABLE_FROM_BROWSER}
{savedStateStorageWarning.value === undefined ? undefined : {savedStateStorageWarning.value}
}
{savedStateError.value === undefined ? undefined : {savedStateError.value}
}
@@ -601,7 +664,7 @@ export function SimulationBanner({ controller, onEnvironmentChanged = async () =
savedStateStorageWarning.value = undefined
void runNavigationControl(async () => {
const removedCount = removeCorruptedSavedSimulationStates(savedStateStorage)
- if (removedCount === 0) throw new Error(CURATED_TSX_STRINGS.simulationBanner.noCorruptedSavedStatesFoundError)
+ if (removedCount === 0) throw new Error(UI_STRING_NO_CORRUPTED_SAVED_SIMULATION_STATES_WERE_FOUND)
clearSavedStateStorageWarning()
if (hasSavedSimulationStateRoute()) {
navigateToBuiltInScenario(currentScenario.value)
@@ -611,7 +674,7 @@ export function SimulationBanner({ controller, onEnvironmentChanged = async () =
})
}}
>
- {TSX_STRINGS.componentsSimulationBanner.copy060}
+ {UI_STRING_REMOVE_CORRUPTED_SAVES}
diff --git a/ui/ts/components/TimestampValue.tsx b/ui/ts/components/TimestampValue.tsx
index df21feff..03f13a42 100644
--- a/ui/ts/components/TimestampValue.tsx
+++ b/ui/ts/components/TimestampValue.tsx
@@ -2,7 +2,7 @@ import type { ComponentChildren } from 'preact'
import { useChainTimestamp } from '../lib/chainTimestamp.js'
import { formatRelativeTimestamp, formatTimestamp } from '../lib/formatters.js'
import { getMetricPlaceholderPresentation } from '../lib/userCopy.js'
-import { TSX_STRINGS } from '../lib/uiStrings.js'
+import { UI_STRING_LOADING_WITH_ELLIPSIS } from '../lib/uiStrings.js'
type TimestampValueProps = {
className?: string
@@ -17,7 +17,7 @@ export function TimestampValue({ className = '', currentTimestamp, loading = fal
const chainCurrentTimestamp = useChainTimestamp()
const resolvedCurrentTimestamp = currentTimestamp ?? chainCurrentTimestamp
- if (loading) return {TSX_STRINGS.componentsTimestampValue.copy001}
+ if (loading) return {UI_STRING_LOADING_WITH_ELLIPSIS}
if (timestamp === undefined) return {undefinedText}
diff --git a/ui/ts/components/TokenApprovalControl.tsx b/ui/ts/components/TokenApprovalControl.tsx
index ce6c029a..d0159cec 100644
--- a/ui/ts/components/TokenApprovalControl.tsx
+++ b/ui/ts/components/TokenApprovalControl.tsx
@@ -9,7 +9,19 @@ import { MetricField } from './MetricField.js'
import { TransactionActionButton } from './TransactionActionButton.js'
import { formatCurrencyBalance } from '../lib/formatters.js'
import { deriveTokenApprovalRequirement, formatTokenApprovalUnavailableMessage, parseTokenApprovalAmountInput, resolveTokenApprovalStatusMessage } from '../lib/tokenApproval.js'
-import { CURATED_TSX_STRINGS, TSX_STRINGS } from '../lib/uiStrings.js'
+import {
+ UI_STRING_APPROVAL_AMOUNT,
+ UI_STRING_APPROVAL_AMOUNT_MUST_BE_A_DECIMAL_NUMBER,
+ UI_STRING_APPROVAL_SATISFIED,
+ UI_STRING_LEAVE_BLANK_FOR_REQUIRED_TOTAL,
+ UI_STRING_MAX,
+ UI_TEMPLATE_APPROVED_VALUE,
+ UI_TEMPLATE_APPROVE_MAX_VALUE,
+ UI_TEMPLATE_APPROVE_VALUE,
+ UI_TEMPLATE_APPROVE_TOKEN_AMOUNT,
+ UI_TEMPLATE_REQUIRED_VALUE,
+ UI_TEMPLATE_VALUE_APPROVAL_AMOUNT,
+} from '../lib/uiStrings.js'
type TokenApprovalControlProps = {
actionLabel: string
allowanceError: string | undefined
@@ -47,10 +59,10 @@ function resolveApprovalButtonLabel({
tokenUnits: number
}) {
if (pending) return {pendingLabel}
- if (guardMessage !== undefined || nextApprovalAmount === undefined) return TSX_STRINGS.componentsTokenApprovalControl.copy001(tokenSymbol)
- if (requirementSatisfied && !isCustomAmount && !isMaxAmount) return TSX_STRINGS.componentsTokenApprovalControl.copy002
- if (isMaxAmount) return TSX_STRINGS.componentsTokenApprovalControl.copy003(tokenSymbol)
- return TSX_STRINGS.componentsTokenApprovalControl.copy004(formatCurrencyBalance(nextApprovalAmount, tokenUnits), tokenSymbol)
+ if (guardMessage !== undefined || nextApprovalAmount === undefined) return UI_TEMPLATE_APPROVE_VALUE(tokenSymbol)
+ if (requirementSatisfied && !isCustomAmount && !isMaxAmount) return UI_STRING_APPROVAL_SATISFIED
+ if (isMaxAmount) return UI_TEMPLATE_APPROVE_MAX_VALUE(tokenSymbol)
+ return UI_TEMPLATE_APPROVE_TOKEN_AMOUNT(formatCurrencyBalance(nextApprovalAmount, tokenUnits), tokenSymbol)
}
export function TokenApprovalControl({ actionLabel, allowanceError, allowanceLoading, approvedAmount, disabled = false, guardMessage, onApprove, pending, pendingLabel, requiredAmount, resetKey, tokenSymbol, tokenUnits }: TokenApprovalControlProps) {
const [draftAmount, setDraftAmount] = useState('')
@@ -60,10 +72,10 @@ export function TokenApprovalControl({ actionLabel, allowanceError, allowanceLoa
}, [resetKey])
const parsedAmount = useMemo(() => {
try {
- return parseTokenApprovalAmountInput(draftAmount, CURATED_TSX_STRINGS.tokenApprovalControl.approvalAmountLabel, tokenUnits)
+ return parseTokenApprovalAmountInput(draftAmount, UI_STRING_APPROVAL_AMOUNT, tokenUnits)
} catch (error) {
return {
- error: error instanceof Error ? error.message : CURATED_TSX_STRINGS.tokenApprovalControl.approvalAmountDecimalError,
+ error: error instanceof Error ? error.message : UI_STRING_APPROVAL_AMOUNT_MUST_BE_A_DECIMAL_NUMBER,
kind: 'invalid' as const,
}
}
@@ -115,20 +127,20 @@ export function TokenApprovalControl({ actionLabel, allowanceError, allowanceLoa
return (
-
+
-
+
diff --git a/ui/ts/components/TransactionHashLink.tsx b/ui/ts/components/TransactionHashLink.tsx
index 7d3bf4ea..22fda5a4 100644
--- a/ui/ts/components/TransactionHashLink.tsx
+++ b/ui/ts/components/TransactionHashLink.tsx
@@ -1,7 +1,7 @@
import type { Hash } from '@zoltar/shared/ethereum'
import { getActiveNetworkProfile } from '../lib/activeEnvironment.js'
import { buildTransactionExplorerUrl } from '../lib/networkProfile.js'
-import { TSX_STRINGS } from '../lib/uiStrings.js'
+import { UI_STRING_VIEW_TRANSACTION } from '../lib/uiStrings.js'
type TransactionHashLinkProps = {
hash: Hash
@@ -12,7 +12,7 @@ export function TransactionHashLink({ hash }: TransactionHashLinkProps) {
if (transactionUrl === undefined) return
{hash}
return (
-
+
{hash}
)
diff --git a/ui/ts/components/TruthAuctionBidsSection.tsx b/ui/ts/components/TruthAuctionBidsSection.tsx
index 322e5945..35a68741 100644
--- a/ui/ts/components/TruthAuctionBidsSection.tsx
+++ b/ui/ts/components/TruthAuctionBidsSection.tsx
@@ -6,7 +6,29 @@ import { MetricField } from './MetricField.js'
import { PaginationControls } from './PaginationControls.js'
import { SectionBlock } from './SectionBlock.js'
import type { TruthAuctionBidRowViewModel, ViewerTruthAuctionBidRowViewModel } from '../lib/truthAuctionBidViewModels.js'
-import { TSX_STRINGS } from '../lib/uiStrings.js'
+import {
+ UI_STRING_BIDDER,
+ UI_STRING_BID_AMOUNT_ETH,
+ UI_STRING_CONNECT_A_WALLET_TO_INSPECT_YOUR_SUBMITTED_TRUTH_AUCTION_BIDS,
+ UI_STRING_COVERAGE,
+ UI_STRING_ETH,
+ UI_STRING_LOADED_BIDS,
+ UI_STRING_LOADED_DEPTH_ETH,
+ UI_STRING_LOADED_LEVELS,
+ UI_STRING_LOADING_AUCTION_BIDS,
+ UI_STRING_LOADING_YOUR_BIDS,
+ UI_STRING_LOAD_MORE_OF_MY_BIDS,
+ UI_STRING_LOAD_MORE_TRUTH_AUCTION_BIDS,
+ UI_STRING_MY_BIDS,
+ UI_STRING_NO_ACTIVE_PRICES_ARE_CURRENTLY_VISIBLE_FOR_THIS_AUCTION,
+ UI_STRING_NO_BIDS_ARE_CURRENTLY_INDEXED_FOR_THE_LOADED_PRICES,
+ UI_STRING_NO_BIDS_FROM_THIS_WALLET_ARE_INDEXED_FOR_THE_CURRENT_AUCTION,
+ UI_STRING_PRICE_ETH_PER_REP,
+ UI_STRING_SELECTED,
+ UI_STRING_STATUS,
+ UI_STRING_TRUTH_AUCTION_BIDS,
+ UI_TEMPLATE_LOADED_BID_COVERAGE_SUMMARY,
+} from '../lib/uiStrings.js'
type TruthAuctionBidsSectionProps = {
aggregatedAuctionBidCountForLoadedTicks: bigint
@@ -32,11 +54,11 @@ type ViewerTruthAuctionBidsSectionProps = {
function AuctionBidsHeader() {
return (
- {TSX_STRINGS.componentsTruthAuctionBidsSection.copy001}
- {TSX_STRINGS.componentsTruthAuctionBidsSection.copy002}
- {TSX_STRINGS.componentsTruthAuctionBidsSection.copy003}
- {TSX_STRINGS.componentsTruthAuctionBidsSection.copy004}
- {TSX_STRINGS.componentsTruthAuctionBidsSection.copy005}
+ {UI_STRING_PRICE_ETH_PER_REP}
+ {UI_STRING_BIDDER}
+ {UI_STRING_BID_AMOUNT_ETH}
+ {UI_STRING_LOADED_DEPTH_ETH}
+ {UI_STRING_STATUS}
)
}
@@ -44,25 +66,25 @@ function AuctionBidsHeader() {
function ViewerBidsHeader({ showActions }: { showActions: boolean }) {
return (
- {showActions ? {TSX_STRINGS.componentsTruthAuctionBidsSection.copy006} : undefined}
- {TSX_STRINGS.componentsTruthAuctionBidsSection.copy007}
- {TSX_STRINGS.componentsTruthAuctionBidsSection.copy008}
- {TSX_STRINGS.componentsTruthAuctionBidsSection.copy009}
+ {showActions ? {UI_STRING_SELECTED} : undefined}
+ {UI_STRING_PRICE_ETH_PER_REP}
+ {UI_STRING_BID_AMOUNT_ETH}
+ {UI_STRING_STATUS}
)
}
export function TruthAuctionBidsSection({ aggregatedAuctionBidCountForLoadedTicks, hasMoreAggregatedAuctionBids, loadedTickCount, loadingAggregatedAuctionBids, onLoadNextAuctionBidPage, renderPriceValue, rows }: TruthAuctionBidsSectionProps) {
return (
-
+
- {loadedTickCount.toString()}
- {rows.length.toString()}
- {TSX_STRINGS.componentsTruthAuctionBidsSection.copy014(rows.length.toString(), aggregatedAuctionBidCountForLoadedTicks.toString())}
+ {loadedTickCount.toString()}
+ {rows.length.toString()}
+ {UI_TEMPLATE_LOADED_BID_COVERAGE_SUMMARY(rows.length.toString(), aggregatedAuctionBidCountForLoadedTicks.toString())}
- {loadingAggregatedAuctionBids ? {TSX_STRINGS.componentsTruthAuctionBidsSection.copy015}
: undefined}
- {!loadingAggregatedAuctionBids && loadedTickCount === 0 ? {TSX_STRINGS.componentsTruthAuctionBidsSection.copy016}
: undefined}
- {!loadingAggregatedAuctionBids && loadedTickCount > 0 && rows.length === 0 ? {TSX_STRINGS.componentsTruthAuctionBidsSection.copy017}
: undefined}
+ {loadingAggregatedAuctionBids ? {UI_STRING_LOADING_AUCTION_BIDS}
: undefined}
+ {!loadingAggregatedAuctionBids && loadedTickCount === 0 ? {UI_STRING_NO_ACTIVE_PRICES_ARE_CURRENTLY_VISIBLE_FOR_THIS_AUCTION}
: undefined}
+ {!loadingAggregatedAuctionBids && loadedTickCount > 0 && rows.length === 0 ? {UI_STRING_NO_BIDS_ARE_CURRENTLY_INDEXED_FOR_THE_LOADED_PRICES}
: undefined}
{rows.length === 0 ? undefined : (
@@ -73,10 +95,10 @@ export function TruthAuctionBidsSection({ aggregatedAuctionBidCountForLoadedTick
-
+
-
+
{row.statusLabel}
@@ -85,17 +107,17 @@ export function TruthAuctionBidsSection({ aggregatedAuctionBidCountForLoadedTick
))}
)}
- {hasMoreAggregatedAuctionBids ? : undefined}
+ {hasMoreAggregatedAuctionBids ? : undefined}
)
}
export function ViewerTruthAuctionBidsSection({ accountAddress, hasMoreViewerBids, loadingTruthAuctionBook, onLoadNextViewerBidPage, onSettlementBidSelectionChange, renderPriceValue, rows, showSettlementActionColumn }: ViewerTruthAuctionBidsSectionProps) {
return (
-
- {accountAddress === undefined ? {TSX_STRINGS.componentsTruthAuctionBidsSection.copy022}
: undefined}
- {accountAddress !== undefined && loadingTruthAuctionBook ? {TSX_STRINGS.componentsTruthAuctionBidsSection.copy023}
: undefined}
- {accountAddress !== undefined && !loadingTruthAuctionBook && rows.length === 0 ? {TSX_STRINGS.componentsTruthAuctionBidsSection.copy024}
: undefined}
+
+ {accountAddress === undefined ? {UI_STRING_CONNECT_A_WALLET_TO_INSPECT_YOUR_SUBMITTED_TRUTH_AUCTION_BIDS}
: undefined}
+ {accountAddress !== undefined && loadingTruthAuctionBook ? {UI_STRING_LOADING_YOUR_BIDS}
: undefined}
+ {accountAddress !== undefined && !loadingTruthAuctionBook && rows.length === 0 ? {UI_STRING_NO_BIDS_FROM_THIS_WALLET_ARE_INDEXED_FOR_THE_CURRENT_AUCTION}
: undefined}
{rows.length === 0 ? undefined : (
@@ -112,7 +134,7 @@ export function ViewerTruthAuctionBidsSection({ accountAddress, hasMoreViewerBid
) : undefined}
{renderPriceValue(row.price)}
-
+
{row.statusLabel}
@@ -121,7 +143,7 @@ export function ViewerTruthAuctionBidsSection({ accountAddress, hasMoreViewerBid
))}
)}
- {accountAddress !== undefined && hasMoreViewerBids ? : undefined}
+ {accountAddress !== undefined && hasMoreViewerBids ? : undefined}
)
}
diff --git a/ui/ts/components/TruthAuctionDepthChart.tsx b/ui/ts/components/TruthAuctionDepthChart.tsx
index d7c7f462..95e3814f 100644
--- a/ui/ts/components/TruthAuctionDepthChart.tsx
+++ b/ui/ts/components/TruthAuctionDepthChart.tsx
@@ -3,7 +3,7 @@ import { CurrencyValue } from './CurrencyValue.js'
import { formatCurrencyInputBalance, formatRoundedCurrencyBalance } from '../lib/formatters.js'
import { getVisualRatio } from '../lib/visualMetrics.js'
import type { TruthAuctionDepthPoint } from '../lib/truthAuctionBook.js'
-import { TSX_STRINGS } from '../lib/uiStrings.js'
+import { UI_STRING_0_ETH, UI_STRING_ETH, UI_STRING_LOADED_DEPTH_ETH, UI_STRING_PRICE_ETH_PER_REP, UI_STRING_TRUTH_AUCTION_VISIBLE_DEPTH_CHART, UI_TEMPLATE_ETH_PER_REP_VALUE, UI_TEMPLATE_SELECT_PRICE_VALUE_ETH_REP_FROM_DEPTH_CHART } from '../lib/uiStrings.js'
type TruthAuctionDepthChartProps = {
clearingTick?: bigint
@@ -22,7 +22,7 @@ const CHART_PADDING = {
let nextDepthGradientId = 0
function formatTruthAuctionPriceLabel(price: bigint) {
- return TSX_STRINGS.componentsTruthAuctionDepthChart.copy001(formatRoundedCurrencyBalance(price, 18, 4))
+ return UI_TEMPLATE_ETH_PER_REP_VALUE(formatRoundedCurrencyBalance(price, 18, 4))
}
function getDepthRatio(value: bigint, maxDepth: bigint) {
@@ -120,22 +120,22 @@ export function TruthAuctionDepthChart({ clearingTick, onSelectTick, points }: T
<>
-
{TSX_STRINGS.componentsTruthAuctionDepthChart.copy002}
+
{UI_STRING_LOADED_DEPTH_ETH}
-
+
{midpointDepth === undefined ? undefined : (
-
+
)}
- {TSX_STRINGS.componentsTruthAuctionDepthChart.copy005}
+ {UI_STRING_0_ETH}
-
+