Skip to content

Commit

Permalink
Merge branch 'main' into refac-form-page
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunusabdul38 committed Feb 1, 2025
2 parents 2b40daf + 6d408ab commit db67422
Show file tree
Hide file tree
Showing 35 changed files with 1,018 additions and 3,166 deletions.
2 changes: 1 addition & 1 deletion frontend/src/assets/icons/spotnet-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { useState } from "react";
import DashboardTabs from "@/components/dashboard/dashboard-tab/DashboardTabs"
import Collateral from "@/components/dashboard/collateral/Collateral"
import Borrow from "@/components/dashboard/borrow/Borrow"
import Deposited from "@/components/dashboard/deposited/Deposited"
import { DASHBOARD_TABS } from "@/utils/constants"


export default function DashboardInfoCard({ cardData, startSum, currentSum, depositedData }) {
const [activeTab, setActiveTab] = useState(DASHBOARD_TABS.COLLATERAL)
const { COLLATERAL, BORROW, DEPOSITED } = DASHBOARD_TABS

const getCurrentSumColor = () => {
if (currentSum > startSum) return "current-sum-green"
if (currentSum < startSum) return "current-sum-red"
return ""
}

return (
<div className="dashboard-info-card">
<DashboardTabs activeTab={activeTab} switchTab={setActiveTab} />

{activeTab === COLLATERAL && (
<Collateral
getCurrentSumColor={getCurrentSumColor}
startSum={startSum}
currentSum={currentSum}
data={cardData}
/>
)}

{activeTab === BORROW && <Borrow data={cardData} />}

{activeTab === DEPOSITED && <Deposited data={depositedData} />}
</div>
)
}
32 changes: 32 additions & 0 deletions frontend/src/components/gradientbutton.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from 'react';
import Rocket from '@/assets/icons/rocket.svg?react';



const GradientButton = ({
onClick,
children,
mobileWidth = 'w-[300px]',
desktopWidth = 'lg:w-[400px]',
icon = <Rocket />,
className = ''
}) => {
return (
<button
className={`
bg-gradient-to-r from-[var(--button-gradient-from)] via-[var(--button-gradient-to)] to-[var(--button-gradient-to)]
hover:bg-gradient-to-r hover:from-[var(--button-gradient-hover-from)] hover:via-[var(--button-gradient-from)] hover:to-[var(--button-gradient-hover-from)]
border-none rounded-[8px] h-[52px] text-[20px] text-black font-[700] mt-[20px] 2xl:h-[60px] z-10 cursor-pointer
${mobileWidth} ${desktopWidth} ${className}
`}
onClick={onClick}
>
<div className="justify-center items-center cursor-pointer flex gap-[20px]">
<span>{children}</span>
{icon}
</div>
</button>
);
};

export default GradientButton;
92 changes: 72 additions & 20 deletions frontend/src/components/home/about/About.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import EkuboSwap from '@/assets/icons/ekubo_swap.svg?react';
import Repeat from '@/assets/icons/repeats.svg?react';
import StarMaker from '@/components/layout/star-maker/StarMaker';

import './about.css';

const CardData = [
{
number: '1',
Expand Down Expand Up @@ -40,32 +38,86 @@ const About = () => {
{ top: 85, left: 10, size: 10 },
{ top: 7, left: 80, size: 8 },
];

return (
<div className="about-container">
<div className=" relative flex flex-col items-center justify-between w-[100%] bg-[var(--black)] lg:pb-[350px] pb-[100px] ">
<div
className=" absolute
h-[100px]
w-[20%]
hidden
lg:block
left-[10em]
top-[12em]
-translate-x-1/2
rounded-[2000px_2000px_0_0]
blur-[100px]
z-10
bg-gradient-to-r
from-[var(--gradient-from)]
to-[var(--gradient-to)] "
></div>
<StarMaker starData={starData} />
<h1 className="about-title">How it works</h1>
<div className="card-container flex-center">
<div className="cards-gradient">
<div className="card-gradient"></div>
<div className="card-gradient"></div>
</div>
<h1 className=" text-center font-text text-white mt-[64px] text-[48px] font-[600] mb-[180px] ">How it works</h1>

<div className="flex flex-wrap gap-[5em] sm:gap-[4em] lg:gap-[2em] justify-center px-4 max-w-7xl mx-auto">
{CardData.map((card, index) => (
<div key={index} className="card-about flex-center">
<div className="card-number flex-center">
<h2>{card.number}</h2>
</div>
<div className="card-icon-about">
<card.icon />
<div key={index} className="relative flex flex-col items-center">
<div className="absolute -top-[2em] md:-top-[1em] lg:-top-[1.5em] 2xl:-top-[1.5em] z-10 left-1/2 -translate-x-1/2">
<div
className="bg-primary-color border-[var(--brand)] border-[0.8px] text-brand font-text font-semibold
text-[32px] px-4 py-1 rounded-xl min-w-[70px] text-center
xl:text-[30px] z-7 bg-black lg:text-[25px] lg:min-w-[60px] md:text-[18px] md:min-w-[45px] text-[var(--brand)]"
>
{card.number}
</div>
</div>
<div className="card-title">
<h4>{card.title}</h4>
</div>
<div className="card-description">
<h6>{card.description}</h6>

<div
className="w-[310px] h-[368px] flex flex-col items-center gap-4 px-4 pt-[3em] 2xl:pt-[3em] bg-[linear-gradient(135deg,_rgba(116,_214,_253,_0.5)_0%,_rgba(11,_12,_16,_0.5)_100%)]
rounded-[20px] border border-[var(--card-border-1)] shadow-card backdrop-blur-[21.09375px]
xl:w-[280px] xl:h-[350px] lg:w-[250px] lg:h-[255px] md:w-[175px] md:h-[205px] z-6"
>
<div
className="flex justify-center items-center w-[120px] h-[120px]
xl:w-[100px] xl:h-[100px] lg:w-[80px] lg:h-[80px] md:w-[60px] md:h-[60px] "
>
<card.icon />
</div>

<h4
className="font-text text-[26px] text-primary text-center leading-[108%] font-medium
xl:text-[22px] text-white lg:text-[18px] md:text-[15px]"
>
{card.title}
</h4>

<p
className="font-text text-[20px] text-white text-secondary text-center leading-[140%] font-normal
xl:text-base lg:text-md md:text-[11px]"
>
{card.description}
</p>
</div>
</div>
))}
</div>
<div
className=" absolute
h-[100px]
w-[20%]
hidden
lg:block
right-0
top-[35em]
rounded-[2000px_2000px_0_0]
blur-[100px]
z-0
bg-gradient-to-r
from-[var(--gradient-from)]
to-[var(--gradient-to)] "
></div>
</div>
);
};
Expand Down
Loading

0 comments on commit db67422

Please sign in to comment.