generated from RealDevSquad/website-template
-
Notifications
You must be signed in to change notification settings - Fork 166
added footer to task details page #631
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
Merged
prakashchoudhary07
merged 8 commits into
RealDevSquad:develop
from
bksh05:fix/add-footer-task-details-page
Jun 22, 2023
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6126541
added footer to task details page
bksh05 07f84ba
refactoring header to separate component
bksh05 a1df054
added footer to task details page
bksh05 cae9e46
refactoring header to separate component
bksh05 1eef27e
Moving interfaces and types to separate files. Also fixed some css un…
bksh05 0f1356e
adding testcases
bksh05 3ce0010
merging changes
bksh05 72bcbbe
fixing test cases
bksh05 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,38 @@ | ||
| .header { | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| flex-wrap: wrap; | ||
| padding-top: 0.625rem; | ||
| } | ||
|
|
||
| .link { | ||
| padding: 0.625rem; | ||
| text-decoration: none; | ||
| font-weight: bold; | ||
| color: #041484; | ||
| cursor: pointer; | ||
| background: none; | ||
| border: none; | ||
| position: relative; | ||
|
|
||
| &::after { | ||
| content: ''; | ||
| position: absolute; | ||
| height: 1rem; | ||
| width: 2px; | ||
| right: 0; | ||
| background-color: #00000077; | ||
| } | ||
| } | ||
|
|
||
| // Hide | for the last elements | ||
| .header a:last-child { | ||
| .link::after { | ||
| display: none; | ||
| } | ||
| } | ||
|
|
||
| .active { | ||
| color: #e30464; | ||
| } |
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,54 @@ | ||
| import { FC } from 'react'; | ||
| import styles from './Header.module.scss'; | ||
| import Link from 'next/link'; | ||
| import { HeaderLinkProps } from '@/interfaces/HeaderItem.type'; | ||
| import { useRouter } from 'next/router'; | ||
| import { | ||
| devHeaderCategories, | ||
| headerCategories, | ||
| } from '@/constants/header-categories'; | ||
|
|
||
| export const HeaderLink: FC<HeaderLinkProps> = ({ title, link, isActive }) => { | ||
| const linkClasses = `${styles.link} ${isActive ? styles.active : ''}`; | ||
|
|
||
| return ( | ||
| <Link href={link} passHref> | ||
| <button type="button" tabIndex={0} className={linkClasses}> | ||
| {title} | ||
| </button> | ||
| </Link> | ||
| ); | ||
| }; | ||
|
|
||
| export const Header = () => { | ||
| const router = useRouter(); | ||
|
|
||
| // Dev feature toggle | ||
| const { query } = router; | ||
| const dev = !!query.dev; | ||
|
|
||
| return ( | ||
| <div className={styles.header}> | ||
| {headerCategories.map(({ title, refURL, pathName }, index) => ( | ||
| <HeaderLink | ||
| key={index} | ||
| title={title} | ||
| link={refURL} | ||
| isActive={router.pathname === pathName} | ||
| /> | ||
| ))} | ||
|
|
||
| {dev && | ||
| devHeaderCategories.map( | ||
| ({ title, refURL, pathName }, index) => ( | ||
| <HeaderLink | ||
| key={index} | ||
| title={title} | ||
| link={refURL} | ||
| isActive={router.pathname === pathName} | ||
| /> | ||
| ) | ||
| )} | ||
| </div> | ||
| ); | ||
| }; |
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
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
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
14 changes: 3 additions & 11 deletions
14
src/constants/navbar-Content.ts → src/constants/header-categories.ts
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 |
|---|---|---|
| @@ -1,53 +1,45 @@ | ||
| export const navBarContentMock = [ | ||
| export const headerCategories = [ | ||
| { | ||
| title: 'Tasks', | ||
| refURL: '/', | ||
| pathName: '/', | ||
| pipeSymbol: '|', | ||
| }, | ||
| { | ||
| title: 'Issues', | ||
| refURL: '/issues', | ||
| pathName: '/issues', | ||
| pipeSymbol: '|', | ||
| }, | ||
| { | ||
| title: 'Mine', | ||
| refURL: '/mine', | ||
| pathName: '/mine', | ||
| pipeSymbol: '|', | ||
| }, | ||
| { | ||
| title: 'Open PRs', | ||
| refURL: '/openPRs', | ||
| pathName: '/openPRs', | ||
| pipeSymbol: '|', | ||
| }, | ||
| { | ||
| title: 'Stale PRs', | ||
| refURL: '/stale-pr', | ||
| pathName: '/stale-pr', | ||
| pipeSymbol: '|', | ||
| }, | ||
| { | ||
| title: 'Idle Users', | ||
| refURL: '/idle-users', | ||
| pathName: '/idle-users', | ||
| pipeSymbol: '', | ||
| }, | ||
| ]; | ||
|
|
||
| export const featureFlags = [ | ||
| export const devHeaderCategories = [ | ||
| { | ||
| title: 'Standup', | ||
| refURL: '/standup/?dev=true', | ||
| pathName: '/standup', | ||
| pipeSymbol: '|', | ||
| }, | ||
| { | ||
| title: 'Availability Panel', | ||
| refURL: '/availability-panel', | ||
| pathName: '', | ||
| pipeSymbol: '|', | ||
| pathName: '/availability-panel', | ||
| }, | ||
| ]; |
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,5 @@ | ||
| export interface HeaderLinkProps { | ||
| title: string; | ||
| link: string; | ||
| isActive: boolean; | ||
| } |
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
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.