-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(wallet-mobile): CR updates + scrollable in input needs checking
- Loading branch information
1 parent
27f5f77
commit 3e92069
Showing
5 changed files
with
15 additions
and
3 deletions.
There are no files selected for viewing
12 changes: 11 additions & 1 deletion
12
apps/wallet-mobile/src/components/ScrollableView/ScrollableView.tsx
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,6 +1,16 @@ | ||
import * as React from 'react' | ||
import {ScrollView} from 'react-native' | ||
import {ScrollView, ScrollViewProps} from 'react-native' | ||
|
||
const ScrollViewContext = React.createContext<{current: ScrollView | null}>({current: null}) | ||
|
||
export const useScrollView = () => React.useContext(ScrollViewContext).current | ||
|
||
export const ScrollableView = (props: ScrollViewProps) => { | ||
const scrollViewRef = React.useRef<ScrollView | null>(null) | ||
|
||
return ( | ||
<ScrollViewContext.Provider value={scrollViewRef}> | ||
<ScrollView {...props} ref={scrollViewRef} /> | ||
</ScrollViewContext.Provider> | ||
) | ||
} |
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 @@ | ||
export * from './ScrollableView' |
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