Skip to content

Commit

Permalink
Merge pull request #597 from z3us-dapps/hotfix/tx-no-sig
Browse files Browse the repository at this point in the history
Tx fix for no required signatures
  • Loading branch information
heathsnee authored Jun 2, 2024
2 parents 336d401 + 33c0f4d commit 8e1741c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 17 deletions.
12 changes: 7 additions & 5 deletions apps/extension/src/hooks/transaction/use-intent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@ export const useIntent = () => {
]
.filter((value, index, array) => array.indexOf(value) === index) // unique
.filter(value => !!accountIndexes[value])
if (walletAddresses.length === 0) {

const feePayer =
settings.feePayer ||
walletAddresses.sort((x, y) => input.transactionManifest.indexOf(x) - input.transactionManifest.indexOf(y))[0] ||
Object.keys(accountIndexes)[0]

if (!feePayer) {
throw new Error(intl.formatMessage(messages.empty_signatures_error))
}

Expand All @@ -84,10 +90,6 @@ export const useIntent = () => {
tipPercentage: settings.tipPercentage || 0,
}

const feePayer =
settings.feePayer ||
walletAddresses.sort((x, y) => input.transactionManifest.indexOf(x) - input.transactionManifest.indexOf(y))[0]

let offset = 0
Object.values(settings.guarantees).forEach(guarantee => {
if (guarantee.amount > 0) {
Expand Down
22 changes: 12 additions & 10 deletions packages/ui/src/components/resource/nft.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { CardButtons } from 'ui/src/components/card-buttons'
import FieldValue from 'ui/src/components/field-value'
import { AccountsTransactionInfo } from 'ui/src/components/layout/account-transaction-info'
import { NftImageIcon } from 'ui/src/components/nft-image-icon'
import { ToolTip } from 'ui/src/components/tool-tip'
import { Text } from 'ui/src/components/typography'
import { findFieldValue } from 'ui/src/services/metadata'

Expand Down Expand Up @@ -40,7 +39,7 @@ const Nft: React.FC<IProps> = ({ nft, withCardButtons }) => {

const dataJson = nft.data.programmatic_json as any
const name = findFieldValue('name', dataJson?.fields)
const description = findFieldValue('description', dataJson?.fields)
const description = findFieldValue('description', dataJson?.fields) || ''

const fields = useMemo(
() => (nft?.data.programmatic_json as any)?.fields?.filter(field => !IGNORE_DATA.includes(field.field_name)) || [],
Expand All @@ -60,14 +59,17 @@ const Nft: React.FC<IProps> = ({ nft, withCardButtons }) => {
/>
</Box>
<Box display="flex" flexDirection="column" gap="small">
<ToolTip message={nft.non_fungible_id}>
<Box>
<Text size="xlarge" weight="strong" color="strong" align="center">
{`${name} ${nft.is_burned === true ? intl.formatMessage(messages.burned) : ''}`}
</Text>
</Box>
</ToolTip>
{description && <Text size="small">{description}</Text>}
<Text size="xlarge" weight="strong" color="strong" align="center">
{`${name} ${nft.is_burned === true ? intl.formatMessage(messages.burned) : ''}`}
</Text>
<Text size="small" align="center">
{nft.non_fungible_id}
</Text>
{description && (
<Text size="small" mx="medium" textAlign="justify">
{description}
</Text>
)}
</Box>

{withCardButtons && (
Expand Down
5 changes: 4 additions & 1 deletion packages/ui/src/components/typography/text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React, { forwardRef } from 'react'
import type { Sprinkles } from 'ui/src/theme/sprinkles.css'
import { sprinkles } from 'ui/src/theme/sprinkles.css'

import type { BoxProps } from '../box'
import { Box } from '../box'
import * as styles from './typography.css'

Expand Down Expand Up @@ -38,7 +39,7 @@ interface TextStyleProps {
htmlFor?: string
}

export interface TextProps extends TextStyleProps {
export interface TextProps extends Omit<BoxProps, 'color'>, TextStyleProps {
component?: ElementType
children?: ReactNode
}
Expand Down Expand Up @@ -102,6 +103,7 @@ const Text = forwardRef<HTMLElement, TextProps>((props, ref: ForwardedRef<any>)
inheritColor,
lineClamp,
htmlFor,
...rest
} = props

return (
Expand All @@ -127,6 +129,7 @@ const Text = forwardRef<HTMLElement, TextProps>((props, ref: ForwardedRef<any>)
style={{ ...(lineClamp ? { WebkitLineClamp: lineClamp } : {}) }}
htmlFor={htmlFor}
ref={ref}
{...rest}
>
{children}
</Box>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/theme/sprinkles.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const properties = {
justifyContent: ['stretch', 'flex-start', 'center', 'flex-end', 'space-around', 'space-between'],
alignItems: ['stretch', 'flex-start', 'center', 'flex-end', 'baseline', 'self-start'],
alignContent: ['stretch', 'flex-start', 'center', 'flex-end', 'space-between', 'space-around'],
textAlign: ['left', 'center', 'right'],
textAlign: ['left', 'center', 'right', 'justify'],
boxSizing: ['border-box'],
scrollbarGutter: ['stable'],
aspectRatio: ['1'],
Expand Down

0 comments on commit 8e1741c

Please sign in to comment.