Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ui/src/components/AllMarketModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ const AllMarketModal = (props) => {
inputBtnTextTwo = {`${new BigNumber(tokenDetails.collateralFactor).multipliedBy(100)}% Limit`}
useMaxAmount= {useMaxAmount}
errorText={publicKeyHash && ((currentTab === 'one') ? buttonOne.errorText : buttonTwo.errorText)}
disabled={(currentTab === 'one') ? buttonOne.disabled : buttonTwo.disabled}
disabled={true}
pendingLimit={(currentTab === 'two') ? pendingLimit : false}
pendingLimitUsed={(currentTab === 'two') ? pendingLimitUsed : false}
getProps={(tokenAmount, tabValue) => { setTokenValue(tokenAmount); setCurrentTab(tabValue); }}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/components/BorrowModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ const BorrowModal = (props) => {
inputBtnTextTwo="Use Max"
useMaxAmount={useMaxAmount}
errorText={currentTab === 'one' ? buttonOne.errorText : buttonTwo.errorText}
disabled={currentTab === 'one' ? buttonOne.disabled : buttonTwo.disabled}
disabled={currentTab === 'one' ? true : buttonTwo.disabled}
pendingLimit={pendingLimit}
pendingLimitUsed={pendingLimitUsed}
getProps={(tokenAmount, tabValue) => {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/components/Dashboard/SuppliedTokenTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const SuppliedTokenTable = (props) => {
<>
<SupplyModal open={openSupplyModal} close={closeModal} tokenDetails={tokenDetails} tab={openWithdrawTab ? 'two' : undefined}/>
<DisableCollateralModal open={disableCollModal} close={closeModal} tokenDetails={tokenDetails} />
<CollateralizeModal open={collModal} close={closeModal} tokenDetails={tokenDetails} />
{/* <CollateralizeModal open={collModal} close={closeModal} tokenDetails={tokenDetails} /> */}
</>
)}
<Table>
Expand Down
104 changes: 54 additions & 50 deletions src/ui/src/components/Header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,68 +13,72 @@ import collateralizedIcon from "../../assets/collateralizedIcon.svg";
import borrowingIcon from "../../assets/borrowing.svg";
import borrowLimitIcon from "../../assets/borrowLimitIcon.svg";
import questionCircle from "../../assets/questionCircle.svg";
import Box from '@mui/material/Box';

import { supplyCompositionAction } from "../../reduxContent/supplyComposition/actions";
import { borrowCompositionAction } from "../../reduxContent/borrowComposition/actions";
import { LightTooltip } from "../StackedBars/style.tsx";

// eslint-disable-next-line import/no-dynamic-require
const config = require(
`../../library/${process.env.REACT_APP_ENV || "prod"}-network-config.json`,
);
const config = require(`../../library/${process.env.REACT_APP_ENV || "prod"}-network-config.json`);

const Header = () => {
const classes = useStyles();
const dispatch = useDispatch();
const { network } = config.infra.conseilServer;
const networkType = network.charAt(0).toUpperCase() + network.slice(1);
const classes = useStyles();
const dispatch = useDispatch();
const { network } = config.infra.conseilServer;
const networkType = network.charAt(0).toUpperCase() + network.slice(1);

const { supplyComposition } = useSelector((state) => state.supplyComposition);
const { borrowComposition } = useSelector((state) => state.borrowComposition);
const account = useSelector((state) => state.addWallet.account);
const { suppliedMarkets, borrowedMarkets } = useSelector(
(state) => state.market,
);
const { supplyComposition } = useSelector((state) => state.supplyComposition);
const { borrowComposition } = useSelector((state) => state.borrowComposition);
const account = useSelector((state) => state.addWallet.account);
const { suppliedMarkets, borrowedMarkets } = useSelector((state) => state.market);

useEffect(() => {
dispatch(supplyCompositionAction(suppliedMarkets));
dispatch(borrowCompositionAction(borrowedMarkets));
}, [dispatch, account, suppliedMarkets, borrowedMarkets]);
useEffect(() => {
dispatch(supplyCompositionAction(suppliedMarkets));
dispatch(borrowCompositionAction(borrowedMarkets));
}, [dispatch, account, suppliedMarkets, borrowedMarkets]);

return (
<HeaderCon className={classes1.root}>
<Typography className={classes.networkType}>
{network !== "mainnet" &&
`Note: Tezfin is currently operating on the Tezos test network ${networkType}.`}
</Typography>
<Grid container className={classes.compositionGrid}>
<Composition
title="Supply Composition"
data={supplyComposition}
dataIcon={supplyingIcon}
dataTitle="Supplying"
dataLimitIcon={collateralizedIcon}
dataLimitTitle="Collateralized"
gridClass={classes.compositionOne}
progressBarClass={classes.progressBarOne}
progressBarColor={classes.supplyBarColor} // add class
supplyBar
/>
return (
<HeaderCon className={classes1.root}>
<Typography className={classes.networkType}>
{network !== "mainnet" &&
`Note: Tezfin is currently operating on the Tezos test network ${networkType}.`}
</Typography>
<Box className={classes.legacyAppNote}>
<Typography>
{
"This is the legacy app for TezFin v2. Please repay all borrowing positions and/or withdraw deposits, and move to the latest TezFin."
}
</Typography>
</Box>
<Grid container className={classes.compositionGrid}>
<Composition
title="Supply Composition"
data={supplyComposition}
dataIcon={supplyingIcon}
dataTitle="Supplying"
dataLimitIcon={collateralizedIcon}
dataLimitTitle="Collateralized"
gridClass={classes.compositionOne}
progressBarClass={classes.progressBarOne}
progressBarColor={classes.supplyBarColor} // add class
supplyBar
/>

<Composition
title="Borrow Limit"
data={borrowComposition}
dataIcon={borrowingIcon}
dataTitle="Borrowing"
dataLimitIcon={borrowLimitIcon}
dataLimitTitle="Borrow limit"
gridClass={classes.compositionTwo}
progressBarClass={classes.progressBarTwo}
progressBarColor={classes.borrowBarColor} // add class
/>
</Grid>
</HeaderCon>
);
<Composition
title="Borrow Limit"
data={borrowComposition}
dataIcon={borrowingIcon}
dataTitle="Borrowing"
dataLimitIcon={borrowLimitIcon}
dataLimitTitle="Borrow limit"
gridClass={classes.compositionTwo}
progressBarClass={classes.progressBarTwo}
progressBarColor={classes.borrowBarColor} // add class
/>
</Grid>
</HeaderCon>
);
};

export default Header;
6 changes: 6 additions & 0 deletions src/ui/src/components/Header/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,12 @@ export const useStyles = makeStyles({
fontSize: '0.625rem',
paddingBottom: '0.5rem'
}
},
legacyAppNote: {
backgroundColor: '#ed6c02',
padding: '16px',
textAlign: 'center',
color: 'white'
}
});

Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/components/SupplyModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ const SupplyModal = (props) => {
inputBtnTextTwo = "Use Max"
useMaxAmount= {useMaxAmount}
errorText={(currentTab === 'one') ? buttonOne.errorText : buttonTwo.errorText}
disabled={(currentTab === 'one') ? buttonOne.disabled : buttonTwo.disabled}
disabled={(currentTab === 'one') ? true : buttonTwo.disabled}
getProps={(tokenAmount, tabValue) => { setTokenValue(tokenAmount); setCurrentTab(tabValue); }}
tab={tab}
/>
Expand Down