Skip to content

Commit

Permalink
Merge pull request #98 from cd-sigma/main
Browse files Browse the repository at this point in the history
Build
  • Loading branch information
cd-simarpreet committed Dec 10, 2023
2 parents fca6284 + a5d8903 commit 4510f6d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
Binary file modified frontend/src/assets/finsafe-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions frontend/src/components/ConnectWalltet/Walltet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ const ConnectWalletButton = ({
return (
<div>
{address && !loading ? (
<div onClick={onPressLogout} style={{border:"1px solid white", fontSize:"30px",fontFamily:"Bebas neue",marginTop:"10px",borderRadius:"30px" , padding:"12px 20px",background:"white" , color:"black",
<div onClick={onPressLogout} style={{border:"1px solid white", cursor:"pointer",fontSize:"30px",fontFamily:"Bebas neue",marginTop:"10px",borderRadius:"30px" , padding:"12px 20px",background:"white" , color:"black",
}}>
Disconnect
</div>
) : loading ? (
<div
style={{border:"1px solid white", fontSize:"30px",fontFamily:"Bebas neue",marginTop:"10px",borderRadius:"30px" , padding:"12px 20px",background:"white" , color:"black",ml: 1,
style={{border:"1px solid white", fontSize:"30px",fontFamily:"Bebas neue",marginTop:"10px",borderRadius:"30px" , padding:"12px 20px",background:"white" , color:"black",ml: 1 ,cursor:"pointer"
}}
disabled
>
Loading...
</div>
) : (
<div style={{border:"1px solid white", fontSize:"30px",fontFamily:"Bebas neue",marginTop:"10px",borderRadius:"30px" , padding:"12px 20px",background:"white" , color:"black",
<div style={{border:"1px solid white", fontSize:"30px",cursor:"pointer",fontFamily:"Bebas neue",marginTop:"10px",borderRadius:"30px" , padding:"12px 20px",background:"white" , color:"black",
}} onClick={onPressConnect} >
Connect Wallet
</div>
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/components/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import { AppBar, Toolbar, Typography, InputBase, Button, IconButton } from '@mui/material';
import SearchIcon from '@mui/icons-material/Search';
import { useNavigate } from 'react-router-dom';

import { Link } from 'react-router-dom';
// Logo
import Logo from "../assets/finsafe-logo.png";
import { useUserStore } from '../store/userStore';
Expand All @@ -24,9 +24,11 @@ const Navbar = () => {
<AppBar position="static" sx={{paddingTop:"25px", paddingLeft:"20px", paddingRight:"15px", backgroundColor:"black"}}>
<Toolbar sx={{ justifyContent: 'space-between', background: 'black' }}>
{/* Logo on the Left */}
<Link to="/">
<Typography variant="h6" component="div">
<img src={Logo} style={{width:"105px"}}/>
<img src={Logo} style={{width:"105px",cursor:"pointer"}} />
</Typography>
</Link>

{/* Search Bar in the Center */}
<div sx={{ flexGrow: 1 }}>
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/components/PortfolioDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ const PortfolioDetails = ({searchId,isActive}) => {
const borrowedDetails = useUserStore((state) => state.borrowedDetails);
const setSuppliedDetails = useUserStore((state) => state.setSuppliedDetails);
const search = useUserStore((state) => state.search);

let userAddress = useUserStore((state) => state.userAddress);

const [userData,setUserData]=useState({});
const convertSuppliedToDesiredFormat = async (array) => {
try {
const result = await Promise.all(
Expand Down Expand Up @@ -78,15 +76,17 @@ const PortfolioDetails = ({searchId,isActive}) => {

const callApis = async () => {
const details = await getPortfolioDetails(searchId);
const { metadata } = details[0];
const { metadata } = details[0];
const { supplied, borrowed } = metadata;
setLoading(true);
const derivedSupplied = await convertSuppliedToDesiredFormat(supplied);
const data=await getPortfolioDetails(searchId);
setUserData(data[0]);
const derivedBorrowed = await convertBorrowedToDesiredFormat(borrowed);
setSuppliedDetails(derivedSupplied);
setBorrowedDetails(derivedBorrowed);
setLoading(false);
};
console.log(userData);

useEffect(() => {
callApis();
}, [search,searchId]);
Expand Down
10 changes: 8 additions & 2 deletions frontend/src/pages/ProfilePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {Avatars} from '../utils/index'
import Navbar from "../components/Navbar";
import {FeedPage} from "./FeedPage";
import PortfolioDetails from "../components/PortfolioDetails";
import { useUserStore } from "../store/userStore";

const ProfilePage = () => {
const [currentTab, setCurrentTab] = React.useState(0);
Expand All @@ -19,7 +20,9 @@ const ProfilePage = () => {
const handleTabChange = (event, newValue) => {
setCurrentTab(newValue);
};
const userData=useUserStore((state) => state.userData);
const searchId=window.location.pathname.split('/')[2];
console.log(userData);

return (
<>
Expand All @@ -31,6 +34,7 @@ const ProfilePage = () => {
minHeight: "100vh",
paddingTop: "10px",
width: "100vw",
marginLeft: "0px",
}}
>
{/* Top Section - User Profile */}
Expand All @@ -39,7 +43,8 @@ const ProfilePage = () => {
display: "flex",
alignItems: "center",
marginTop: "20px",
marginLeft: "30px",
marginLeft: "55px",

}}
>
<Avatar
Expand All @@ -49,7 +54,8 @@ const ProfilePage = () => {
/>
<div>
<Typography variant="h6">{searchId.slice(0,5)+'...'+searchId.slice(-4)}</Typography>
<Typography variant="subtitle1">Secured</Typography>
<Typography variant="subtitle1" sx={{color:'green'}}>Secured</Typography>

</div>
</div>

Expand Down

0 comments on commit 4510f6d

Please sign in to comment.