-
Notifications
You must be signed in to change notification settings - Fork 24
Release v2.6.0 #78
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
Merged
Merged
Release v2.6.0 #78
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
dff150e
Merge branch 'maintenance/update-lint-config' into develop
troberts-28 327025f
💄 Improve layout styling options and fix modal width issue
troberts-28 5fb7c23
📝 Update docs to reflect changes
troberts-28 d02544f
🧑💻 Add pre-commit hook that lints/formats
troberts-28 d8ae01b
Merge pull request #77 from troberts-28/feat/improve-styling-options
troberts-28 cc34507
🔖 bump version
troberts-28 57dccde
📝 Make use of new styles in examples
troberts-28 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -4,3 +4,4 @@ node_modules | |
| .yarn | ||
| examples/example-bare/android | ||
| examples/example-bare/ios | ||
| *.md | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -45,8 +45,10 @@ const DurationScroll = forwardRef<DurationScrollRef, DurationScrollProps>((props | |
| onDurationChange, | ||
| padNumbersWithZero = false, | ||
| padWithNItems, | ||
| pickerColumnWidth, | ||
| pickerFeedback, | ||
| pickerGradientOverlayProps, | ||
| pickerLabelGap, | ||
| pmLabel, | ||
| repeatNumbersNTimes = 3, | ||
| repeatNumbersNTimesNotExplicitlySet, | ||
|
|
@@ -55,6 +57,24 @@ const DurationScroll = forwardRef<DurationScrollRef, DurationScrollProps>((props | |
| testID, | ||
| } = props; | ||
|
|
||
| const labelPositionStyle = useMemo(() => { | ||
| // When the style already has an explicit `left` (from legacy percentage system or | ||
| // user override), don't apply pixel-based positioning. | ||
| if (styles.pickerLabelContainer.left != null) { | ||
| return undefined; | ||
| } | ||
|
|
||
| const gap = pickerLabelGap ?? 6; | ||
| const fontSize = styles.pickerItem.fontSize ?? 25; | ||
| const maxDigitCount = Math.max(2, String(maximumValue).length); | ||
| const halfNumberWidth = (maxDigitCount * fontSize * 0.55) / 2; | ||
|
|
||
| return { | ||
| left: "50%" as const, | ||
| marginLeft: halfNumberWidth + gap, | ||
| }; | ||
| }, [maximumValue, pickerLabelGap, styles.pickerItem.fontSize, styles.pickerLabelContainer.left]); | ||
|
|
||
| const numberOfItems = useMemo(() => { | ||
| // guard against negative maximum values | ||
| if (maximumValue < 0) { | ||
|
|
@@ -210,6 +230,7 @@ const DurationScroll = forwardRef<DurationScrollRef, DurationScrollProps>((props | |
| amLabel={amLabel} | ||
| is12HourPicker={is12HourPicker} | ||
| item={item} | ||
| pickerAmPmPositionStyle={labelPositionStyle} | ||
| pmLabel={pmLabel} | ||
| selectedValue={selectedValue} | ||
| styles={styles} | ||
|
|
@@ -221,6 +242,7 @@ const DurationScroll = forwardRef<DurationScrollRef, DurationScrollProps>((props | |
| allowFontScaling, | ||
| amLabel, | ||
| is12HourPicker, | ||
| labelPositionStyle, | ||
| pmLabel, | ||
| selectedValue, | ||
| styles, | ||
|
|
@@ -488,7 +510,7 @@ const DurationScroll = forwardRef<DurationScrollRef, DurationScrollProps>((props | |
| viewabilityConfigCallbackPairs={viewabilityConfigCallbackPairs} | ||
| windowSize={numberOfItemsToShow} | ||
| /> | ||
| <View pointerEvents="none" style={styles.pickerLabelContainer}> | ||
| <View pointerEvents="none" style={[styles.pickerLabelContainer, labelPositionStyle]}> | ||
| {typeof label === "string" ? ( | ||
| <Text allowFontScaling={allowFontScaling} style={styles.pickerLabel}> | ||
| {label} | ||
|
|
@@ -508,6 +530,7 @@ const DurationScroll = forwardRef<DurationScrollRef, DurationScrollProps>((props | |
| initialScrollIndex, | ||
| isDisabled, | ||
| label, | ||
| labelPositionStyle, | ||
| numberOfItemsToShow, | ||
| numbersForFlatList, | ||
| onMomentumScrollEnd, | ||
|
|
@@ -571,6 +594,7 @@ const DurationScroll = forwardRef<DurationScrollRef, DurationScrollProps>((props | |
| pointerEvents={isDisabled ? "none" : undefined} | ||
| style={[ | ||
| styles.durationScrollFlatListContainer, | ||
| pickerColumnWidth != null && { flex: 0, width: pickerColumnWidth }, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| { | ||
| height: styles.pickerItemContainer.height * numberOfItemsToShow, | ||
| }, | ||
|
|
||
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prepare script no longer builds package
High Severity
The
preparescript was changed fromyarn buildtosimple-git-hooks. The prepare script runs onyarn install/npm install, so the package no longer builds automatically. After cloning and runningyarn install, thedist/folder will not exist, and the examples (and any devs importing the package) will fail becausemainpoints todist/commonjs/index.js.