generated from RealDevSquad/website-template
-
Notifications
You must be signed in to change notification settings - Fork 167
add dashboard page #544
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
Merged
add dashboard page #544
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e506070
add dashboard page
RitikJaiswal75 f737be2
fix styling
RitikJaiswal75 9fbd973
remove the DashboardLayout component
RitikJaiswal75 8f53140
Merge remote-tracking branch 'origin' into feat/standup-dashboard
RitikJaiswal75 70e54c3
add types and modify component for better testing
RitikJaiswal75 a23d59c
Merge remote-tracking branch 'origin' into feat/standup-dashboard
RitikJaiswal75 090688b
use strict equals for enter key press
RitikJaiswal75 f8c41f9
Merge remote-tracking branch 'origin' into feat/standup-dashboard
RitikJaiswal75 d5ba59b
remove handler passed as props and make a utility
RitikJaiswal75 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,42 @@ | ||
| $base-unit: 4px; | ||
| $base-font-size: 0.3rem; | ||
| $color-blue: #041187; | ||
| $color-red: #e30062; | ||
| $color-green: #85da6b; | ||
| $color-disabled: #e5e7eb; | ||
| $color-white: #fff; | ||
| $color-black: #000; | ||
| $diff-margin: $base-unit * 15; | ||
| $similar-margin: $base-unit * 8; | ||
| $section-padding-top-bottom: $base-unit * 30; | ||
| $section-padding-left-right: $base-unit * 25; | ||
|
|
||
| .container { | ||
| margin: $diff-margin auto; | ||
| width: 85%; | ||
| } | ||
|
|
||
| .searchLabel { | ||
| font-size: $base-font-size * 5; | ||
| padding-right: $base-unit * 8; | ||
| color: $color-blue; | ||
| } | ||
|
|
||
| .searchBar { | ||
| background-color: $color-disabled; | ||
| border-radius: $base-unit * 2; | ||
| border: none; | ||
| width: 80%; | ||
| height: $base-unit * 15; | ||
| font-size: $base-font-size * 5; | ||
| } | ||
|
|
||
| .searchBtn { | ||
| margin-left: $base-unit * 8; | ||
| background-color: $color-blue; | ||
| color: $color-white; | ||
| height: $base-unit * 15; | ||
| border-radius: $base-unit * 2; | ||
| border: none; | ||
| width: $base-unit * 40; | ||
| } |
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,40 @@ | ||
| import React, { KeyboardEvent, useState } from 'react'; | ||
| import styles from '@/components/Dashboard/Dashboard.module.scss'; | ||
| import { splitNSearch } from '@/utils/splitNSearch'; | ||
|
|
||
| function Searchbar({ label }: searchProps) { | ||
| const [query, setQuery] = useState(''); | ||
|
|
||
| const handleKeyPress = (event: KeyboardEvent) => { | ||
| if (event.key === 'Enter') { | ||
| splitNSearch(query); | ||
| } | ||
| }; | ||
|
|
||
| return ( | ||
| <section className={styles.container}> | ||
| <label htmlFor="search" className={styles.searchLabel}> | ||
| {label} | ||
| </label> | ||
| <input | ||
| type="text" | ||
| id="search" | ||
| value={query} | ||
| onChange={(e) => setQuery(e.target.value)} | ||
| onKeyDown={(e) => handleKeyPress(e)} | ||
| className={styles.searchBar} | ||
| /> | ||
| <button | ||
| type="submit" | ||
| onClick={() => { | ||
| splitNSearch(query); | ||
| }} | ||
| className={styles.searchBtn} | ||
| > | ||
| Search | ||
| </button> | ||
| </section> | ||
| ); | ||
| } | ||
|
|
||
| export default Searchbar; |
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,28 @@ | ||
| import { useRouter } from 'next/router'; | ||
| import React from 'react'; | ||
| import PageNotFound from '../404'; | ||
| import NavBar from '@/components/navBar'; | ||
| import Searchbar from '@/components/Dashboard/Searchbar'; | ||
|
|
||
| const search = (query: string) => { | ||
| const searchValues = query.split(','); | ||
| console.log('Searching', searchValues); | ||
| }; | ||
RitikJaiswal75 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| const DashboardPage = () => { | ||
| const router = useRouter(); | ||
|
|
||
| const { dev } = router.query; | ||
|
|
||
| if (dev !== 'true') { | ||
| return <PageNotFound />; | ||
| } | ||
| return ( | ||
| <> | ||
| <NavBar /> | ||
| <Searchbar label="Users" /> | ||
| </> | ||
| ); | ||
| }; | ||
|
|
||
| export default DashboardPage; | ||
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,3 @@ | ||
| interface searchProps { | ||
| label: string; | ||
| } |
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,4 @@ | ||
| export const splitNSearch = (query: string) => { | ||
| const searchValues = query.split(','); | ||
| console.log('Searching', searchValues); | ||
vvaibhavdesai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
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.