generated from RealDevSquad/website-template
-
Notifications
You must be signed in to change notification settings - Fork 65
Feat/add new dashboard UI #299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
manish591
wants to merge
26
commits into
RealDevSquad:develop
Choose a base branch
from
manish591:feat/add-new-dashboard-UI
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
7bb0bcd
Sync main with develop (#249)
akshay1502 0d35066
added contstants and image
ivinayakg 4d7da41
fixed sidebar files
ivinayakg 3e19883
fixed the sidebar
ivinayakg f82eed7
'Requested Changes Done'
ivinayakg 5505754
fixed typo
ivinayakg ba14b6c
Merge branch 'develop' into feature/new-sidebar
MehulKChaudhari 944e08f
responsivness added
ivinayakg 22d8795
Sync main with develop (#249)
akshay1502 752bcf2
added contstants and image
ivinayakg 1a89d49
fixed sidebar files
ivinayakg 0a53637
fixed the sidebar
ivinayakg def0ffb
'Requested Changes Done'
ivinayakg 72bd58e
fixed typo
ivinayakg 9cbf66b
responsivness added
ivinayakg 125e025
Merge branch 'feature/new-sidebar' of https://github.com/ivinayakg/we…
ivinayakg d8257de
feat-created new dashboard UI
manish591 fb7c4dc
style-created responsive layout
manish591 8aa4c73
added remaining months in month dropdown
manish591 bf512e0
removed hardcoded data
manish591 1af9930
refactor-requested changes
manish591 39a0c8c
style-added cursor property in breadcrumbs
manish591 41adc8e
test-tests added for dashboard UI
manish591 314ad1c
added requested changes
manish591 94c6705
updated tests
manish591 bf32a62
Merge branch 'develop' into feat/add-new-dashboard-UI
MehulKChaudhari File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 @@ | ||
| describe('visiting /dashboard', () => { | ||
| before(() => { | ||
| cy.visit('/dashboard'); | ||
| }); | ||
|
|
||
| it('checks if url is pointing to dashboard route', () => { | ||
| cy.location('pathname').should('eq', '/dashboard'); | ||
| }); | ||
|
|
||
| it('checks if sidebar is rendered', () => { | ||
| cy.get('[data-testid="sidebar-notification"]').should('exist'); | ||
| }); | ||
|
|
||
| it('checks if breadcrumbs are rendered', () => { | ||
| cy.get('[data-testid="breadcrumbs"]').should('exist'); | ||
|
|
||
| cy.get('[data-testid="breadcrumbs"]') | ||
| .find('a') | ||
| .eq(0) | ||
| .should('have.text', 'home'); | ||
| cy.get('[data-testid="breadcrumbs"]').find('a').eq(0).click(); | ||
| cy.location('pathname').should('eq', '/'); | ||
|
|
||
| cy.go('back'); | ||
|
|
||
| cy.get('[data-testid="breadcrumbs"]') | ||
| .find('a') | ||
| .eq(1) | ||
| .should('have.text', 'dashboard'); | ||
| }); | ||
|
|
||
| it('checks if wallets section is rendered', () => { | ||
| cy.get('[data-testid="wallets"]').should('exist'); | ||
| cy.get('[data-testid="wallets"] h3').first().should('have.text', 'Wallets'); | ||
| }); | ||
|
|
||
| it('checks if rds transaction graph is visible', () => { | ||
| cy.get('h2').contains('RDS Transaction').should('exist'); | ||
| cy.get('[data-testid="transaction-chart"]').should('exist'); | ||
| }); | ||
|
|
||
| it('checks if profile sidebar is rendered', () => { | ||
| cy.get('[data-testid="profile-sidebar"]').should('exist'); | ||
| }); | ||
| }); |
This file contains hidden or 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,79 @@ | ||
| import { useState } from 'react'; | ||
| import styles from './sidebar.module.css'; | ||
| import { useRouter } from 'next/router'; | ||
| import Image from 'next/image'; | ||
| import sidebarMenuOptions from 'constants/sidebarMenuOptions'; | ||
|
|
||
| const Sidebar = () => { | ||
| const [mobileToggle, setMobileToggle] = useState(false); | ||
| const router = useRouter(); | ||
| const navigateTo = (url) => router.push(url); | ||
|
|
||
| const basePath = router.pathname; | ||
| const pagePath = router.pathname.split('/')[1]; | ||
|
|
||
| const addActiveOptionClass = (optionURL) => | ||
| pagePath === optionURL || (basePath === '/' && '/' === optionURL) | ||
manish591 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ? ' ' + styles.option_active | ||
| : ''; | ||
|
|
||
| return ( | ||
| <div className={styles.wrapper} data-testid="sidebar-notification"> | ||
| <div | ||
| className={ | ||
| styles.mobileToggle + | ||
| ` ${mobileToggle ? styles['mobileToggle--active'] : ''}` | ||
| } | ||
| onClick={() => setMobileToggle((prev) => !prev)} | ||
| > | ||
| <h3>Menu</h3> | ||
| <Image src="/assets/MenuArrow.svg" width={25} height={25} /> | ||
manish591 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </div> | ||
|
|
||
| <aside className={styles.sidebar}> | ||
| <span className={styles.heading}> | ||
| <Image src={'/assets/Real-Dev-Squad1x.png'} width={50} height={50} /> | ||
manish591 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <h3>RealDevSquad</h3> | ||
| </span> | ||
| <div className={styles.options}> | ||
| {sidebarMenuOptions.map((option, index) => { | ||
| const optionPath = option.urlPath; | ||
manish591 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| return ( | ||
| <span | ||
| key={index} | ||
| // this code below insure even if we are in nested path like currency-exchange/**/ | ||
| //even then the link is active | ||
| className={styles.option + addActiveOptionClass(optionPath)} | ||
| onClick={() => navigateTo(optionPath)} | ||
| > | ||
| <Image | ||
| src={option.iconPath} | ||
| className={styles.option_image} | ||
| width={25} | ||
manish591 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| height={25} | ||
| /> | ||
| <p>{option.name}</p> | ||
| <span className={styles.option_bar}></span> | ||
| </span> | ||
| ); | ||
| })} | ||
| </div> | ||
|
|
||
| <div className={styles.buttonWrapper}> | ||
| {router.pathname !== '/currency-exchange' && ( | ||
manish591 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <button className={styles.button}> | ||
| <Image src="/assets/InfoSquare.svg" width={25} height={25} /> | ||
manish591 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Trade Now | ||
| </button> | ||
| )} | ||
| <button className={styles.button}> | ||
| <Image src="/assets/InfoSquare.svg" width={25} height={25} /> | ||
manish591 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Guide | ||
| </button> | ||
| </div> | ||
| </aside> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default Sidebar; | ||
This file contains hidden or 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,155 @@ | ||
| .wrapper { | ||
| font: 700 16px 'DM Sans', sans-serif; | ||
| margin-bottom: 25px; | ||
manish591 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| width: 20vw; | ||
| height: max-content; | ||
| margin-right: auto; | ||
| } | ||
|
|
||
| .sidebar { | ||
| height: calc(100vh - 78px); | ||
| overflow-y: scroll; | ||
| background-color: #f8f7ff; | ||
manish591 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| display: flex; | ||
| justify-content: flex-start; | ||
| align-items: center; | ||
| flex-direction: column; | ||
| } | ||
|
|
||
| .sidebar::-webkit-scrollbar { | ||
| width: 0.5px; | ||
| } | ||
| .sidebar::-webkit-scrollbar-thumb { | ||
| visibility: hidden; | ||
| } | ||
|
|
||
| .sidebar > * { | ||
| padding: 1.6rem; | ||
| width: 100%; | ||
| } | ||
|
|
||
| .heading { | ||
| display: flex; | ||
| justify-content: flex-start; | ||
| align-items: center; | ||
| gap: 10px; | ||
| } | ||
|
|
||
| .options{ | ||
| gap: 1rem; | ||
| display: flex; | ||
| flex-direction: column; | ||
| } | ||
|
|
||
| .option { | ||
| position: relative; | ||
| display: flex; | ||
| justify-content: flex-start; | ||
| align-items: center; | ||
| padding: 6px 9px; | ||
| gap: 10px; | ||
| color: #a5a2b8; | ||
manish591 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| cursor: pointer; | ||
| } | ||
|
|
||
| .option:hover { | ||
| color: #352e5bd0; | ||
| } | ||
|
|
||
| .option_image { | ||
| position: static; | ||
| color: #352e5b; | ||
| } | ||
|
|
||
| .option_active { | ||
| color: #352e5b; | ||
| } | ||
|
|
||
| .option_bar { | ||
| width: 3px; | ||
| aspect-ratio: 1/6; | ||
| background-color: #9381ff; | ||
| border-radius: 1px 0px 0px 1px; | ||
manish591 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| right: -1.2rem; | ||
| position: absolute; | ||
| display: none; | ||
| } | ||
|
|
||
| .option_active .option_bar { | ||
| display: block; | ||
| } | ||
|
|
||
| .buttonWrapper { | ||
| width: 100%; | ||
| margin-top: auto; | ||
| } | ||
|
|
||
| .button { | ||
| width: 100%; | ||
| background-color: #041187; | ||
| height: 4rem; | ||
| border-radius: 8px; | ||
| border: none; | ||
| color: white; | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| gap: 10px; | ||
| font: 500 16px 'DM Sans', sans-serif; | ||
| margin-top: 1rem; | ||
| } | ||
|
|
||
| .mobileToggle{ | ||
| display: none; | ||
| } | ||
|
|
||
| /* Responsive CSS */ | ||
| @media screen and (max-width: 970px) { | ||
| .wrapper{ | ||
| width: 100vw; | ||
| } | ||
|
|
||
| .mobileToggle{ | ||
| display: flex; | ||
| justify-content: space-between; | ||
| padding: 1.6rem; | ||
| background-color: #1D1283; | ||
| color: white; | ||
| } | ||
|
|
||
| .mobileToggle img{ | ||
| transform: rotateZ(180deg); | ||
| transition: all 300ms ease-in; | ||
| } | ||
|
|
||
| .mobileToggle--active img{ | ||
| transform: rotateZ(0deg); | ||
| } | ||
|
|
||
| .sidebar{ | ||
| height: 0px; | ||
| transition: all 300ms ease-in; | ||
| } | ||
|
|
||
| .mobileToggle--active ~ .sidebar{ | ||
| height: max-content; | ||
| margin-top: 0rem; | ||
| animation: MobileMenuAnimation 300ms forwards ; | ||
| } | ||
|
|
||
| .buttonWrapper{ | ||
| margin-top: 1rem; | ||
| } | ||
| } | ||
|
|
||
|
|
||
|
|
||
manish591 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| /* custom animations */ | ||
| @keyframes MobileMenuAnimation{ | ||
| 0%{ | ||
| margin-top: -5rem; | ||
| } | ||
| 100%{ | ||
| margin-top: 0rem; | ||
| } | ||
| } | ||
manish591 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or 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,17 @@ | ||
| import Link from 'next/link'; | ||
| import styles from './breadcrumbs.module.css'; | ||
|
|
||
| const Breadcrumb = ({ link, index, links }) => { | ||
| return ( | ||
| <div className={styles.links} data-testid="breadcrumbs"> | ||
| <Link key={link} href={`/${link !== 'home' ? link : ''}`}> | ||
| {link} | ||
| </Link> | ||
| <span> | ||
| {index !== links.length - 1 && <> > </>} | ||
| </span> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default Breadcrumb; |
This file contains hidden or 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,6 @@ | ||
| .links { | ||
| color: #a5a2b8; | ||
| text-transform: capitalize; | ||
| display: inline; | ||
| user-select: none; | ||
| } |
This file contains hidden or 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,15 @@ | ||
| import Breadcrumb from './breadcrumb'; | ||
|
|
||
| const Breadcrumbs = ({ links }) => { | ||
| return ( | ||
| <div> | ||
| {links.map((link, index) => { | ||
| return ( | ||
| <Breadcrumb key={link} index={index} link={link} links={links} /> | ||
| ); | ||
| })} | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default Breadcrumbs; |
This file contains hidden or 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,42 @@ | ||
| .chart_actions { | ||
| background-color: #f8f7ff; | ||
| padding: 0.8rem 1rem; | ||
| border-top-left-radius: 10px; | ||
| border-top-right-radius: 10px; | ||
| margin-top: 1rem; | ||
| display: flex; | ||
| gap: 2rem; | ||
| } | ||
|
|
||
| .button { | ||
| padding: 0.4rem 0.4rem; | ||
| color: white; | ||
| background-color: #2196f3; | ||
| border-radius: 4px; | ||
| } | ||
|
|
||
| .sr_only { | ||
| position: absolute; | ||
| width: 1px; | ||
| height: 1px; | ||
| padding: 0; | ||
| margin: -1px; | ||
| overflow: hidden; | ||
| clip: rect(0, 0, 0, 0); | ||
| border: 0; | ||
| } | ||
|
|
||
| .month_select { | ||
| height: 100%; | ||
| padding: 0 0.4rem; | ||
| color: white; | ||
| background-color: #2196f3; | ||
| border-radius: 4px; | ||
| } | ||
|
|
||
| @media (min-width: 600px) { | ||
| .month_select, | ||
| .button { | ||
| padding: 0.4rem 0.9rem; | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.