Skip to content

Commit

Permalink
fix: change transfer tabs names (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-ziv authored May 11, 2022
1 parent bbf19ba commit e795f1c
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/components/Features/Transfer/Transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ export const Transfer = () => {
const getL1Token = useL1Token();
const getL2Token = useL2Token();
const maxDeposit = useMaxDeposit();
const tabs = [
{
text: `${NetworkType.L1.name} -> ${NetworkType.L2.name}`,
isActive: action === ActionType.TRANSFER_TO_L2,
onClick: () => onNetworkTabClick(ActionType.TRANSFER_TO_L2)
},
{
text: `${NetworkType.L2.name} -> ${NetworkType.L1.name}`,
isActive: action === ActionType.TRANSFER_TO_L1,
onClick: () => onNetworkTabClick(ActionType.TRANSFER_TO_L1)
}
];

useEffect(() => {
if (!selectedToken) {
Expand Down Expand Up @@ -118,13 +130,13 @@ export const Transfer = () => {
};

const renderTabs = () => {
return Object.values(ActionType).map((tab, index) => {
return tabs.map((tab, index) => {
return (
<TransferMenuTab
key={index}
isActive={action === tab}
text={tab === ActionType.TRANSFER_TO_L2 ? NetworkType.L1.name : NetworkType.L2.name}
onClick={() => onNetworkTabClick(tab)}
isActive={tab.isActive}
text={tab.text}
onClick={tab.onClick}
/>
);
});
Expand Down

0 comments on commit e795f1c

Please sign in to comment.