-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
245 additions
and
201 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
frontend/src/components/dashboard/dashboard-tab/DashboardTab.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import "./dashboardTab.css"; | ||
import { ReactComponent as DepositIcon} from '../../../assets/icons/deposited.svg'; | ||
import { ReactComponent as CollateralIcon } from '../../assets/icons/collateral_dynamic.svg'; | ||
import { ReactComponent as BorrowIcon } from '../../assets/icons/borrow_dynamic.svg'; | ||
|
||
function DashboardTab({activeTab, switchTab, tabs}) { | ||
const { COLLATERAL, BORROW, DEPOSITED } = tabs; | ||
|
||
return ( | ||
<div className="tabs"> | ||
<button | ||
onClick={() => switchTab(COLLATERAL)} | ||
className={`tab ${activeTab === COLLATERAL ? 'active' : ''}`} | ||
> | ||
<CollateralIcon className="tab-icon" /> | ||
<span className="tab-title">Collateral & Earnings</span> | ||
</button> | ||
|
||
<div className="tab-divider" /> | ||
|
||
<button | ||
onClick={() => switchTab(BORROW)} | ||
className={`tab ${activeTab === BORROW ? 'active' : ''}`} | ||
> | ||
<BorrowIcon className="tab-icon" /> | ||
<span className="tab-title">Borrow</span> | ||
</button> | ||
|
||
<div className="tab-divider" /> | ||
|
||
<button | ||
onClick={() => switchTab(DEPOSITED)} | ||
className={`tab ${activeTab === DEPOSITED ? 'active' : ''}`} | ||
> | ||
<DepositIcon className="tab-icon" /> | ||
<span className="tab-title">Deposited</span> | ||
</button> | ||
<div className="tab-indicator-container"> | ||
<div className={`tab-indicator ${activeTab}`} /> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default DashboardTab; |
160 changes: 160 additions & 0 deletions
160
frontend/src/components/dashboard/dashboard-tab/dashboardTab.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
.tabs { | ||
display: flex; | ||
justify-content: space-between; | ||
position: relative; | ||
align-items: center; | ||
} | ||
|
||
.tab { | ||
flex: 1; | ||
text-align: center; | ||
padding: 0.5rem 0; | ||
color: var(--gray); | ||
cursor: pointer; | ||
border: none; | ||
background: none; | ||
font-size: 18px; | ||
font-weight: 600; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.tab.active { | ||
color: var(--nav-button-hover); | ||
} | ||
|
||
/* .tab.active.borrow { | ||
color: #ff35d3; | ||
} | ||
.tab.active.deposited { | ||
color: var(--nav-button-hover) | ||
} */ | ||
|
||
.tab-indicator-container { | ||
position: absolute; | ||
bottom: -16px; | ||
left: 0; | ||
width: calc(100% - 20px); | ||
height: 1px; | ||
overflow: hidden; | ||
} | ||
|
||
.tab-indicator { | ||
position: absolute; | ||
bottom: 0; | ||
left: 0; | ||
/* width: 100%; */ | ||
height: 100%; | ||
transition: transform 0.3s ease; | ||
} | ||
|
||
.tab-indicator.collateral { | ||
/* background: linear-gradient(90deg, #49abd2 0%, rgba(40, 16, 41, 0) 100%); | ||
transform: translateX(0); */ | ||
width: 213px; | ||
background: var(--nav-button-hover); | ||
} | ||
|
||
.tab-indicator.borrow { | ||
/* background: linear-gradient(90deg, rgba(40, 16, 41, 0) 0%, #ff35d3 100%, rgba(40, 16, 41, 0) 0%,); | ||
transform: translateX(0); */ | ||
width: 155px; | ||
background: var(--nav-button-hover); | ||
} | ||
|
||
.tab-indicator.deposited { | ||
/* background: linear-gradient(90deg, rgba(40, 16, 41, 0) 0%, #74d6fd 100%); | ||
transform: translateX(0); */ | ||
width: 155px; | ||
background: var(--nav-button-hover); | ||
} | ||
|
||
.tab-icon { | ||
margin-right: 0.5rem; | ||
} | ||
|
||
.tab-title { | ||
font-size: 18px; | ||
font-weight: 600; | ||
} | ||
|
||
.tab-divider { | ||
width: 3px; | ||
height: 18px; | ||
border-radius: 8px; | ||
background-color: var(--border-color); | ||
margin: 0 1rem; | ||
} | ||
|
||
@media (max-width: 768px) { | ||
.tab-title { | ||
font-size: 14px; | ||
font-weight: 600; | ||
white-space: nowrap; | ||
} | ||
|
||
.tab { | ||
padding: 8px 0px; | ||
font-size: 14px; | ||
white-space: nowrap; | ||
} | ||
|
||
.tab-divider { | ||
width: 2px; | ||
height: 16px; | ||
margin: 0 4px; | ||
background-color: var(--border-color); | ||
} | ||
|
||
.tab-icon { | ||
width: 20px; | ||
height: 20px; | ||
margin-right: 4px; | ||
} | ||
|
||
.tab-indicator-container { | ||
bottom: -12px; | ||
width: calc(100% - 16px); | ||
} | ||
} | ||
|
||
@media (max-width: 550px) { | ||
.tab-divider { | ||
width: 2px; | ||
height: 16px; | ||
margin: 0 30px; | ||
background-color: var(--border-color); | ||
} | ||
} | ||
|
||
@media (max-width: 480px) { | ||
.tab-divider { | ||
width: 2px; | ||
height: 16px; | ||
margin: 0 18px; | ||
background-color: var(--border-color); | ||
} | ||
|
||
.tab-title { | ||
font-size: 14px; | ||
} | ||
|
||
.tab { | ||
padding: 6px 0px; | ||
font-size: 12px; | ||
} | ||
} | ||
|
||
@media (max-width: 400px) { | ||
.tab-title { | ||
font-size: 12px; | ||
} | ||
} | ||
|
||
@media (max-width: 350px) { | ||
.tabs { | ||
padding: 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.