Skip to content

Commit

Permalink
fix: eslint.
Browse files Browse the repository at this point in the history
Signed-off-by: Eugene Panteleymonchuk <[email protected]>
  • Loading branch information
panteleymonchuk committed Jan 29, 2024
1 parent 12a93e8 commit c436792
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
1 change: 0 additions & 1 deletion client/src/app/components/stardust/Output.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ class Output extends Component<OutputProps, OutputState> {
*/
public render(): ReactNode {
const { outputId, output, amount, showCopyAmount, network, isPreExpanded, displayFullOutputId, isLinksDisabled } = this.props;
// console.log(output);
const { isExpanded, isFormattedBalance } = this.state;
const tokenInfo: INodeInfoBaseToken = this.context.tokenInfo;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class TransactionPayload extends AsyncComponent<TransactionPayloadProps, Transac
*/
public render(): ReactNode {
const { network, inputs, unlocks, outputs, header, isLinksDisabled } = this.props;
console.log('--- outputs', outputs);
return (
<div className="transaction-payload">
{header && (
Expand Down
22 changes: 12 additions & 10 deletions client/src/app/routes/stardust/TransactionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,13 @@ const TransactionPage: React.FC<RouteComponentProps<TransactionPageProps>> = ({
if (!outputs) return null;
return outputs.map((output, idx) => {
const extraInfo = inputsExtraInfo[output.id];
console.log('--- extraInfo', extraInfo);
return {
...output,
unlockConditionOpenedIndexes: extraInfo?.unlockConditionOpenedIndexes ?? [],
};
});
}, [outputs, inputsExtraInfo]);


const inputsWithExtraInfo = React.useMemo(() => {
if (!inputs) return null;
return inputs.map((input, idx) => {
Expand Down Expand Up @@ -104,9 +102,9 @@ const TransactionPage: React.FC<RouteComponentProps<TransactionPageProps>> = ({

if (!isOutputSpent(input)) {
const isExpired = DateHelper.isExpired(expirationConditionTimestamp);
const indexes: number[] = isExpired ?
getUnlockConditionIndexes(commonOutput, UnlockConditionType.Expiration) :
getUnlockConditionIndexes(commonOutput, UnlockConditionType.Address);
const indexes: number[] = isExpired
? getUnlockConditionIndexes(commonOutput, UnlockConditionType.Expiration)
: getUnlockConditionIndexes(commonOutput, UnlockConditionType.Address);

setInputsExtraInfo((prev) => ({
...prev,
Expand All @@ -125,9 +123,9 @@ const TransactionPage: React.FC<RouteComponentProps<TransactionPageProps>> = ({
}
const isSpentAfterUnlock = DateHelper.isExpired(expirationConditionTimestamp, transactionTimestamp);

const indexes = isSpentAfterUnlock ?
getUnlockConditionIndexes(commonOutput, UnlockConditionType.Expiration) :
getUnlockConditionIndexes(commonOutput, UnlockConditionType.Address);
const indexes = isSpentAfterUnlock
? getUnlockConditionIndexes(commonOutput, UnlockConditionType.Expiration)
: getUnlockConditionIndexes(commonOutput, UnlockConditionType.Address);

setInputsExtraInfo((prev) => ({
...prev,
Expand All @@ -139,7 +137,6 @@ const TransactionPage: React.FC<RouteComponentProps<TransactionPageProps>> = ({

const updateOutputExtraInfo = async (output: IOutput) => {
const indexes = getUnlockConditionIndexes(output?.output as CommonOutput, UnlockConditionType.Address);
console.log('--- indexes', indexes);
setInputsExtraInfo((prev) => ({
...prev,
[output.id]: {
Expand Down Expand Up @@ -280,7 +277,12 @@ const TransactionPage: React.FC<RouteComponentProps<TransactionPageProps>> = ({
>
{inputsWithExtraInfo && unlocks && outputsWithExtraInfo ? (
<div className="section">
<TransactionPayload network={network} inputs={inputsWithExtraInfo} unlocks={unlocks} outputs={outputsWithExtraInfo} />
<TransactionPayload
network={network}
inputs={inputsWithExtraInfo}
unlocks={unlocks}
outputs={outputsWithExtraInfo}
/>
</div>
) : (
<></>
Expand Down

0 comments on commit c436792

Please sign in to comment.