forked from hoangnm/react-native-week-view
-
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.
Improve performance of events processing (hoangnm#27)
* Add props to set the hours in display, and the start hour Disable event-pressing if no handler is passed Fix typo in README.md * Fix lint errors * Make event sorting more efficient Move sorting to WeekView, to avoid sorting multiple times Add memoization to the sorting process * Make event displaying more efficient Avoid double renders in Events Component * Fix memoize-one dependency
- Loading branch information
Showing
12 changed files
with
253 additions
and
189 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
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,26 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { View, Text } from 'react-native'; | ||
import styles from './Times.styles'; | ||
import { TIME_LABEL_HEIGHT } from '../utils'; | ||
|
||
const Times = ({ times }) => { | ||
return ( | ||
<View style={styles.columnContainer}> | ||
{times.map(time => ( | ||
<View | ||
key={time} | ||
style={[styles.label, { height: TIME_LABEL_HEIGHT }]} | ||
> | ||
<Text style={styles.text}>{time}</Text> | ||
</View> | ||
))} | ||
</View> | ||
); | ||
}; | ||
|
||
Times.propTypes = { | ||
times: PropTypes.arrayOf(PropTypes.string).isRequired, | ||
}; | ||
|
||
export default React.memo(Times); |
Oops, something went wrong.