-
-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
081cf8f
commit 2fd7c95
Showing
7 changed files
with
223 additions
and
41 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
44 changes: 44 additions & 0 deletions
44
cpp/react/renderer/components/RNDateTimePicker/ComponentDescriptors.h
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,44 @@ | ||
|
||
/** | ||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). | ||
* | ||
* Do not edit this file as changes may cause incorrect behavior and will be lost | ||
* once the code is regenerated. | ||
* | ||
* @generated by codegen project: GenerateComponentDescriptorH.js | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "ShadowNodes.h" | ||
#include <react/renderer/core/ConcreteComponentDescriptor.h> | ||
|
||
namespace facebook { | ||
namespace react { | ||
|
||
class RNDateTimePickerComponentDescriptor final : public ConcreteComponentDescriptor<RNDateTimePickerShadowNode> { | ||
public: | ||
using ConcreteComponentDescriptor::ConcreteComponentDescriptor; | ||
|
||
void adopt(ShadowNode::Unshared const &shadowNode) const override { | ||
react_native_assert(std::dynamic_pointer_cast<RNDateTimePickerShadowNode>(shadowNode)); | ||
auto pickerShadowNode = std::static_pointer_cast<RNDateTimePickerShadowNode>(shadowNode); | ||
|
||
react_native_assert( | ||
std::dynamic_pointer_cast<YogaLayoutableShadowNode>(pickerShadowNode)); | ||
auto layoutableShadowNode = | ||
std::static_pointer_cast<YogaLayoutableShadowNode>(pickerShadowNode); | ||
|
||
auto state = std::static_pointer_cast<const RNDateTimePickerShadowNode::ConcreteState>(shadowNode->getState()); | ||
auto stateData = state->getData(); | ||
|
||
if(stateData.frameSize.width != 0 && stateData.frameSize.height != 0) { | ||
layoutableShadowNode->setSize(Size{stateData.frameSize.width, stateData.frameSize.height}); | ||
} | ||
|
||
ConcreteComponentDescriptor::adopt(shadowNode); | ||
} | ||
}; | ||
|
||
} // namespace react | ||
} // namespace facebook |
7 changes: 7 additions & 0 deletions
7
cpp/react/renderer/components/RNDateTimePicker/RNDateTimePickerState.cpp
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,7 @@ | ||
#include "RNDateTimePickerState.h" | ||
|
||
namespace facebook { | ||
namespace react { | ||
|
||
} // namespace react | ||
} // namespace facebook |
18 changes: 18 additions & 0 deletions
18
cpp/react/renderer/components/RNDateTimePicker/RNDateTimePickerState.h
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,18 @@ | ||
#pragma once | ||
|
||
#include <react/renderer/graphics/Geometry.h> | ||
|
||
namespace facebook { | ||
namespace react { | ||
|
||
class RNDateTimePickerState final { | ||
public: | ||
using Shared = std::shared_ptr<const RNDateTimePickerState>; | ||
RNDateTimePickerState(){}; | ||
RNDateTimePickerState(Size frameSize_) : frameSize(frameSize_){}; | ||
|
||
Size frameSize{}; | ||
}; | ||
|
||
} // namespace react | ||
} // namespace facebook |
19 changes: 19 additions & 0 deletions
19
cpp/react/renderer/components/RNDateTimePicker/ShadowNodes.cpp
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,19 @@ | ||
|
||
/** | ||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). | ||
* | ||
* Do not edit this file as changes may cause incorrect behavior and will be lost | ||
* once the code is regenerated. | ||
* | ||
* @generated by codegen project: GenerateShadowNodeCpp.js | ||
*/ | ||
|
||
#include "ShadowNodes.h" | ||
|
||
namespace facebook { | ||
namespace react { | ||
|
||
extern const char RNDateTimePickerComponentName[] = "RNDateTimePicker"; | ||
|
||
} // namespace react | ||
} // namespace facebook |
41 changes: 41 additions & 0 deletions
41
cpp/react/renderer/components/RNDateTimePicker/ShadowNodes.h
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,41 @@ | ||
|
||
/** | ||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). | ||
* | ||
* Do not edit this file as changes may cause incorrect behavior and will be lost | ||
* once the code is regenerated. | ||
* | ||
* @generated by codegen project: GenerateShadowNodeH.js | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "RNDateTimePickerState.h" | ||
#include <react/renderer/components/RNDAteTimePicker/EventEmitters.h> | ||
#include <react/renderer/components/RNDateTimePicker/Props.h> | ||
#include <react/renderer/components/view/ConcreteViewShadowNode.h> | ||
#include <jsi/jsi.h> | ||
#include <react/renderer/core/LayoutContext.h> | ||
|
||
namespace facebook { | ||
namespace react { | ||
|
||
JSI_EXPORT extern const char RNDateTimePickerComponentName[]; | ||
|
||
/* | ||
* `ShadowNode` for <RNDateTimePicker> component. | ||
*/ | ||
class JSI_EXPORT RNDateTimePickerShadowNode final : public ConcreteViewShadowNode<RNDateTimePickerComponentName, RNDateTimePickerProps, RNDateTimePickerEventEmitter, RNDateTimePickerState> { | ||
|
||
public: | ||
using ConcreteViewShadowNode::ConcreteViewShadowNode; | ||
|
||
static ShadowNodeTraits BaseTraits() { | ||
auto traits = ConcreteViewShadowNode::BaseTraits(); | ||
traits.set(ShadowNodeTraits::Trait::LeafYogaNode); | ||
return traits; | ||
} | ||
}; | ||
|
||
} // namespace react | ||
} // namespace facebook |
Oops, something went wrong.