Fabric: Codegen for PullToRefresh component

Summary:
Straightforward.
Rick, I rename some stuff, I hope you are cool with that.

Reviewed By: mdvacca

Differential Revision: D15403306

fbshipit-source-id: 1dbd34060052a9bd39ed4211010f14b76fffcde6
This commit is contained in:
Valentin Shergin
2019-05-19 17:44:40 -07:00
committed by Facebook Github Bot
parent e8b2145263
commit f02feb8d38
10 changed files with 10 additions and 181 deletions
@@ -1,20 +0,0 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <react/components/scrollview/PullToRefreshViewShadowNode.h>
#include <react/core/ConcreteComponentDescriptor.h>
namespace facebook {
namespace react {
using PullToRefreshViewComponentDescriptor =
ConcreteComponentDescriptor<PullToRefreshViewShadowNode>;
} // namespace react
} // namespace facebook
@@ -1,18 +0,0 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "PullToRefreshViewEventEmitter.h"
namespace facebook {
namespace react {
void PullToRefreshViewEventEmitter::onRefresh() const {
dispatchEvent("refresh");
}
} // namespace react
} // namespace facebook
@@ -1,25 +0,0 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <memory>
#include <react/components/view/ViewEventEmitter.h>
#include <react/core/EventEmitter.h>
namespace facebook {
namespace react {
class PullToRefreshViewEventEmitter : public ViewEventEmitter {
public:
using ViewEventEmitter::ViewEventEmitter;
void onRefresh() const;
};
} // namespace react
} // namespace facebook
@@ -1,28 +0,0 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "PullToRefreshViewProps.h"
#include <react/core/propsConversions.h>
#include <react/graphics/conversions.h>
namespace facebook {
namespace react {
PullToRefreshViewProps::PullToRefreshViewProps(
PullToRefreshViewProps const &sourceProps,
RawProps const &rawProps)
: ViewProps(sourceProps, rawProps),
refreshing(
convertRawProp(rawProps, "refreshing", sourceProps.refreshing)),
tintColor(convertRawProp(rawProps, "tintColor", sourceProps.tintColor)),
title(convertRawProp(rawProps, "title", sourceProps.title)),
titleColor(
convertRawProp(rawProps, "titleColor", sourceProps.titleColor)) {}
} // namespace react
} // namespace facebook
@@ -1,31 +0,0 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <react/components/view/ViewProps.h>
namespace facebook {
namespace react {
class PullToRefreshViewProps final : public ViewProps {
public:
PullToRefreshViewProps() = default;
PullToRefreshViewProps(
PullToRefreshViewProps const &sourceProps,
RawProps const &rawProps);
#pragma mark - Props
bool const refreshing{};
SharedColor const tintColor{};
std::string const title{};
SharedColor const titleColor{};
};
} // namespace react
} // namespace facebook
@@ -1,16 +0,0 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "PullToRefreshViewShadowNode.h"
namespace facebook {
namespace react {
const char PullToRefreshViewComponentName[] = "RefreshControl";
} // namespace react
} // namespace facebook
@@ -1,31 +0,0 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <react/components/scrollview/PullToRefreshViewEventEmitter.h>
#include <react/components/scrollview/PullToRefreshViewProps.h>
#include <react/components/view/ConcreteViewShadowNode.h>
namespace facebook {
namespace react {
extern const char PullToRefreshViewComponentName[];
/*
* `ShadowNode` for <PullToRefreshView> component.
*/
class PullToRefreshViewShadowNode final : public ConcreteViewShadowNode<
PullToRefreshViewComponentName,
PullToRefreshViewProps,
PullToRefreshViewEventEmitter> {
public:
using ConcreteViewShadowNode::ConcreteViewShadowNode;
};
} // namespace react
} // namespace facebook