Skip to content
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

feat(infiniteAgendaList): support passing scrollViewProps #2497

Merged
merged 3 commits into from
Jul 11, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 19 additions & 21 deletions src/expandableCalendar/infiniteAgendaList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,24 @@ import {AgendaSectionHeader, AgendaListProps} from "./AgendaListsCommon";
* @extends: InfiniteList
* @example: https://github.com/wix/react-native-calendars/blob/master/example/src/screens/expandableCalendar.js
*/
const InfiniteAgendaList = (props: AgendaListProps) => {
const {
theme,
sections,
scrollToNextEvent,
avoidDateUpdates,
onScroll,
renderSectionHeader,
sectionStyle,
dayFormatter,
dayFormat = 'dddd, MMM d',
useMoment,
markToday = true,
infiniteListProps,
renderItem,
onEndReached,
onEndReachedThreshold,
refreshControl
} = props;

const InfiniteAgendaList = ({
theme,
sections,
scrollToNextEvent,
avoidDateUpdates,
onScroll,
renderSectionHeader,
sectionStyle,
dayFormatter,
dayFormat = 'dddd, MMM d',
useMoment,
markToday = true,
infiniteListProps,
renderItem,
onEndReached,
onEndReachedThreshold,
...others
}: AgendaListProps) => {
const {date, updateSource, setDate} = useContext(Context);

const style = useRef(styleConstructor(theme));
Expand Down Expand Up @@ -244,7 +242,7 @@ const InfiniteAgendaList = (props: AgendaListProps) => {
layoutProvider={layoutProvider}
onScroll={_onScroll}
onVisibleIndicesChanged={_onVisibleIndicesChanged}
scrollViewProps={{onMomentumScrollEnd: _onMomentumScrollEnd, nestedScrollEnabled: true, refreshControl}}
scrollViewProps={{nestedScrollEnabled: true, ...others, onMomentumScrollEnd: _onMomentumScrollEnd}}
Inbal-Tish marked this conversation as resolved.
Show resolved Hide resolved
onEndReached={_onEndReached}
onEndReachedThreshold={onEndReachedThreshold as number | undefined}
disableScrollOnDataChange
Expand Down