Skip to content

Commit

Permalink
Initial changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alfonsocj-cb committed Sep 15, 2022
1 parent 54a2efc commit 3fa7ae3
Show file tree
Hide file tree
Showing 14 changed files with 825 additions and 31 deletions.
26 changes: 24 additions & 2 deletions RNDateTimePicker.podspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require 'json'

fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'

package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

Pod::Spec.new do |s|
Expand All @@ -12,8 +14,28 @@ Pod::Spec.new do |s|
s.homepage = package['homepage']
s.platform = :ios, "11.0"
s.source = { :git => "https://github.com/react-native-community/datetimepicker", :tag => "v#{s.version}" }
s.source_files = "ios/*.{h,m}"
s.source_files = "ios/**/*.{h,m,mm}"
s.requires_arc = true

s.dependency "React-Core"
if fabric_enabled
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'

s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
s.pod_target_xcconfig = {
'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native" "$(PODS_ROOT)/RCT-Folly"',
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
}

s.dependency "React"
s.dependency "React-RCTFabric"
s.dependency "React-Codegen"
s.dependency "RCT-Folly"
s.dependency "RCTRequired"
s.dependency "RCTTypeSafety"
s.dependency "ReactCommon/turbomodule/core"
else
s.exclude_files = "ios/fabric"

s.dependency "React-Core"
end
end
14 changes: 14 additions & 0 deletions example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,13 @@ export const App = () => {
setMode(MODE_VALUES[event.nativeEvent.selectedSegmentIndex]);
}}
/>
{MODE_VALUES.map((value) => (
<Button
key={value}
title={value}
onPress={() => setMode(value)}
/>
))}
<ThemedText>display prop:</ThemedText>
<SegmentedControl
values={DISPLAY_VALUES}
Expand All @@ -188,6 +195,13 @@ export const App = () => {
);
}}
/>
{DISPLAY_VALUES.map((value) => (
<Button
key={value}
title={value}
onPress={() => setDisplay(value)}
/>
))}
<ThemedText>minute interval prop:</ThemedText>
<SegmentedControl
values={MINUTE_INTERVALS.map(String)}
Expand Down
Loading

0 comments on commit 3fa7ae3

Please sign in to comment.