-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add entry list arrow navigation (#29)
* add arrow nav to entry list * wip
- Loading branch information
Showing
6 changed files
with
50 additions
and
36 deletions.
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 |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import { screens } from '~/constants/screens'; | ||
import { createWindowSize } from '@solid-primitives/resize-observer'; | ||
import { useWindowSize } from '@solid-primitives/resize-observer'; | ||
|
||
export type ScreenSize = keyof typeof screens; | ||
export const getBreakpoint = (screen: ScreenSize) => +screens[screen].replace('px', ''); | ||
|
||
export const useViewport = () => { | ||
const size = createWindowSize(); | ||
const size = useWindowSize(); | ||
|
||
const belowBreakpoint = (screen: ScreenSize) => size.width <= getBreakpoint(screen); | ||
const aboveBreakpoint = (screen: ScreenSize) => size.width > getBreakpoint(screen); | ||
const lteBreakpoint = (screen: ScreenSize) => size.width <= getBreakpoint(screen); | ||
const gtBreakpoint = (screen: ScreenSize) => size.width > getBreakpoint(screen); | ||
|
||
return { | ||
size, | ||
belowBreakpoint, | ||
aboveBreakpoint, | ||
lteBreakpoint, | ||
gtBreakpoint, | ||
}; | ||
}; |
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