Skip to content

Commit

Permalink
chore: update transaction header component with action component comm…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
alexruzenhack committed Jun 13, 2024
1 parent fb783ca commit a9caff1
Showing 1 changed file with 36 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ import { TransactionStatusLabel } from '../TransactionStatusLabel';
* @param {Obejct} props.tx Transaction data
*/
export const NanoContractTransactionHeader = ({ tx }) => {
// TODO: use `toggleShrank` on 'onPress` of TouchableWithoutFeedback
const [isShrank, toggleShrank] = useState(false);
// XXX: the set function for the state is beeing ignored because we can't
// use the shrank format just yet. We need the actions component first.
// For his, we also need hathor-core support for actions in each nano contract
// transaction.
const [isShrank, _] = useState(false);

Check warning on line 38 in src/components/NanoContract/NanoContractTransactionHeader.component.js

View workflow job for this annotation

GitHub Actions / test (14.x)

'_' is assigned a value but never used

Check warning on line 38 in src/components/NanoContract/NanoContractTransactionHeader.component.js

View workflow job for this annotation

GitHub Actions / test (16.x)

'_' is assigned a value but never used

return (
<HathorHeader>
Expand Down Expand Up @@ -74,40 +77,38 @@ const HeaderExpanded = ({ tx }) => {
Linking.openURL(explorerLink);
};

/* XXX: add <ArrowUpIcon /> when shrank component can be used. */
return (
<>
<View style={styles.wrapper}>
<InfoContainer>
<TransactionStatusLabel hasFirstBlock={hasFirstBlock} isVoided={tx.isVoided} />
</InfoContainer>
<InfoContainer>
<TextValue bold pb4>{ncId}</TextValue>
<TextLabel>{t`Nano Contract ID`}</TextLabel>
</InfoContainer>
<InfoContainer>
<TextValue bold pb4>{tx.ncMethod}</TextValue>
<TextLabel>{t`Blueprint Method`}</TextLabel>
</InfoContainer>
<InfoContainer>
<TextValue bold pb4>{getTimestampFormat(tx.timestamp)}</TextValue>
<TextLabel>{t`Date and Time`}</TextLabel>
</InfoContainer>
<InfoContainer lastElement>
<TextValue bold>{callerAddr}</TextValue>
{tx.isMine
&& (
<View style={styles.headlineLabel}>
<Text style={styles.isMineLabel}>{t`From this wallet`}</Text>
</View>
)}
<TextLabel>{t`Caller`}</TextLabel>
</InfoContainer>
<ActionsWrapper>
<PrimaryTextButton title={t`See transaction details`} onPress={navigatesToExplorer} />
</ActionsWrapper>
</View>
{/* TODO: add <ArrowUpIcon /> when action list is ready to be showed */}
</>
<View style={styles.wrapper}>
<InfoContainer>
<TransactionStatusLabel hasFirstBlock={hasFirstBlock} isVoided={tx.isVoided} />
</InfoContainer>
<InfoContainer>
<TextValue bold pb4>{ncId}</TextValue>
<TextLabel>{t`Nano Contract ID`}</TextLabel>
</InfoContainer>
<InfoContainer>
<TextValue bold pb4>{tx.ncMethod}</TextValue>
<TextLabel>{t`Blueprint Method`}</TextLabel>
</InfoContainer>
<InfoContainer>
<TextValue bold pb4>{getTimestampFormat(tx.timestamp)}</TextValue>
<TextLabel>{t`Date and Time`}</TextLabel>
</InfoContainer>
<InfoContainer lastElement>
<TextValue bold>{callerAddr}</TextValue>
{tx.isMine
&& (
<View style={styles.headlineLabel}>
<Text style={styles.isMineLabel}>{t`From this wallet`}</Text>
</View>
)}
<TextLabel>{t`Caller`}</TextLabel>
</InfoContainer>
<ActionsWrapper>
<PrimaryTextButton title={t`See transaction details`} onPress={navigatesToExplorer} />
</ActionsWrapper>
</View>
)
};

Expand Down

0 comments on commit a9caff1

Please sign in to comment.