Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bgptr committed Mar 29, 2021
1 parent a41af33 commit be88d6c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 10 deletions.
4 changes: 3 additions & 1 deletion app/components/buttons/SmallButton/SmallButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import styles from "./SmallButton.module.css";
import { Button, classNames } from "pi-ui";

const SmallButton = ({ className, ...props }) => (
<Button className={classNames(styles.button, className)} {...props} />
<Button className={classNames(styles.button, className)} {...props}>
<div />
</Button>
);

export default SmallButton;
19 changes: 15 additions & 4 deletions app/components/modals/ListUTXOsModal/ListUTXOsModal.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
import { FormattedMessage as T } from "react-intl";
import { FormattedMessage as T, defineMessages } from "react-intl";
import Modal from "../Modal";
import styles from "./ListUTXOsModal.module.css";
import { Table } from "pi-ui";
import { useListUtxo } from "./hooks";
import { Balance } from "shared";
import { AccountsSelect } from "inputs";

const messages = defineMessages({
utxo: {
id: "listutxo.header.utxo",
defaultMessage: "UTXO"
},
value: {
id: "listutxo.header.value",
defaultMessage: "Value"
}
});

const ListUTXOsModal = ({ onCancelModal, show }) => {
const { unspentOutputs, account, setAccount } = useListUtxo();
const { intl, unspentOutputs, account, setAccount } = useListUtxo();

const data =
unspentOutputs?.map((utxo) => {
Expand All @@ -24,8 +35,8 @@ const ListUTXOsModal = ({ onCancelModal, show }) => {
}) ?? [];

const headers = [
<T id="listutxo.utxo" m="UTXO" />,
<T id="listutxo.value" m="Value" />
intl.formatMessage(messages.utxo),
intl.formatMessage(messages.value)
];

return (
Expand Down
3 changes: 3 additions & 0 deletions app/components/modals/ListUTXOsModal/hooks.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { useSelector, useDispatch } from "react-redux";
import { useCallback, useState, useEffect } from "react";
import { listUnspentOutputs } from "actions/TransactionActions";
import { useIntl } from "react-intl";
import * as sel from "selectors";

export function useListUtxo() {
const intl = useIntl();
const defaultSpendingAccount = useSelector(sel.defaultSpendingAccount);
const [unspentOutputs, setUnspentOutputs] = useState(null);
const [account, setAccount] = useState(defaultSpendingAccount);
Expand All @@ -25,6 +27,7 @@ export function useListUtxo() {
}, [onListUnspentOutputs, account]);

return {
intl,
unspentOutputs,
account,
setAccount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,17 @@ const getAddInputIcon = ({
onlySendSelfAllowed
}) =>
isSendSelf || onlySendSelfAllowed || isSendAll ? (
<Button onClick={onAddOutput} className={styles.add} disabled />
<Button onClick={onAddOutput} className={styles.add} disabled>
<div />
</Button>
) : index === 0 ? (
<Button onClick={onAddOutput} className={styles.add} />
<Button onClick={onAddOutput} className={styles.add}>
<div />
</Button>
) : (
<Button onClick={() => onRemoveOutput(index)} className={styles.delete} />
<Button onClick={() => onRemoveOutput(index)} className={styles.delete}>
<div />
</Button>
);

const getSendSelfIcon = ({ isSendSelf, onShowSendSelf, onShowSendOthers }) =>
Expand Down Expand Up @@ -284,8 +290,9 @@ const SendOutputRow = ({
onClick={(e) => {
e.preventDefault();
onValidateAddress({ address: "", index });
}}
/>
}}>
<div />
</Button>
)}
</>
)}
Expand Down

0 comments on commit be88d6c

Please sign in to comment.