-
Notifications
You must be signed in to change notification settings - Fork 1
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
Visual bugfixes, refactor of code, hooks #227
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
7b056b5
Added useOutsideClick hook to NavBarDropdown
yelodevopsi 078c5e3
Add left padding to avoid the filter button being placed over other e…
mathildehaugum 57aa8ce
Move filter button up
jonasbjoralt 8c4b974
Setting calc heigh minus header height
yelodevopsi a7979a4
Merge branch '203-add-modal-with-click-listener-when-when-context-men…
yelodevopsi 192b39a
Merge remote-tracking branch 'vibes/222-fix-hscreen-height-bug' into …
yelodevopsi 226aac1
Merge remote-tracking branch 'vibes/205-mobile-bugfix' into 220-add-m…
yelodevopsi 4fd17b5
* Refactoring tailwind config to Typescript.
yelodevopsi 7ed5ee9
Adding check to whether window is accesible to hook
yelodevopsi 3de1864
Improved code readability
yelodevopsi b16bbaf
Gathered commonly used variables
yelodevopsi ab9532d
Added enhanced variable naming and using common funcito router push w…
yelodevopsi f0119f2
Removed redundant code
yelodevopsi a4c37dd
Reverted 100vh- header fix on page
yelodevopsi adc1480
Refactored toggleFilter function
yelodevopsi f9716ce
Removed unused useScreenSize hook and conditional click-outisde on si…
yelodevopsi 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 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
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
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,21 @@ | ||
"use client"; | ||
import { useEffect, RefObject } from "react"; | ||
|
||
export function useOutsideClick( | ||
ref: RefObject<HTMLElement>, | ||
callback: () => void, | ||
) { | ||
useEffect(() => { | ||
function handleClick(e: MouseEvent) { | ||
if (ref.current && !ref.current.contains(e.target as Node)) { | ||
callback(); | ||
} | ||
} | ||
|
||
document.addEventListener("click", handleClick); | ||
|
||
return () => { | ||
document.removeEventListener("click", handleClick); | ||
}; | ||
}, [ref, callback]); | ||
} |
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,15 @@ | ||
export const windowWidth = { | ||
xs: 640, | ||
sm: 768, | ||
md: 1024, | ||
lg: 1280, | ||
xl: 1400, | ||
}; | ||
|
||
export const screens = { | ||
xs: `${windowWidth.xs}px`, | ||
sm: `${windowWidth.sm}px`, | ||
md: `${windowWidth.md}px`, | ||
lg: `${windowWidth.lg}px`, | ||
xl: `${windowWidth.xl}px`, | ||
}; |
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
Denne trengte vi! Veldig bra