-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(react-ui-core): add
onSwipe*
hooks and add `--stackflow-swipe-…
…back-ratio` css var (#548)
- Loading branch information
1 parent
f1213a0
commit dc35bfc
Showing
6 changed files
with
88 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@stackflow/plugin-basic-ui": minor | ||
"@stackflow/react-ui-core": minor | ||
--- | ||
|
||
feat(react-ui-core, plugin-basic-ui): add `onSwipe*` hooks and add data attributes and css variables |
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,20 @@ | ||
import { useMounted } from "./useMounted"; | ||
import { useNullableActivity } from "./useNullableActivity"; | ||
|
||
export function useActivityDataAttributes() { | ||
const activity = useNullableActivity(); | ||
const mounted = useMounted(); | ||
|
||
return { | ||
/** | ||
* should be rendered in client-side only to avoid hydration mismatch warning | ||
*/ | ||
...(mounted | ||
? { | ||
"data-stackflow-activity-id": activity?.id, | ||
"data-stackflow-activity-is-active": activity?.isActive, | ||
"data-stackflow-activity-transition-state": activity?.transitionState, | ||
} | ||
: null), | ||
}; | ||
} |
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