Skip to content

Commit

Permalink
UNDO THIS COMMIT
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldonadel committed Aug 19, 2022
1 parent 5c8e011 commit c57ae1c
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions Libraries/NativeComponent/BaseViewConfig.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ const validAttributesForNonEventProps = {
marginStart: true,
marginEnd: true,
marginTop: true,
// marginBlockStart: true,
marginBottom: true,
marginLeft: true,
marginRight: true,
Expand Down
1 change: 1 addition & 0 deletions Libraries/NativeComponent/BaseViewConfig.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ const validAttributesForNonEventProps = {
// borderEndWidth: true,
// borderWidth: true,

// marginBlockStart: true,
marginTop: true,
marginRight: true,
marginBottom: true,
Expand Down
6 changes: 6 additions & 0 deletions Libraries/StyleSheet/StyleSheetTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ type ____LayoutStyle_Internal = $ReadOnly<{
*/
marginBottom?: DimensionValue,

/** `marginBlockStart` works like `margin-bottom` in CSS.
* See https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom
* for more details.
*/
marginBlockStart?: DimensionValue,

/**
* When direction is `ltr`, `marginEnd` is equivalent to `marginRight`.
* When direction is `rtl`, `marginEnd` is equivalent to `marginLeft`.
Expand Down
1 change: 1 addition & 0 deletions Libraries/StyleSheet/splitLayoutProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default function splitLayoutProps(props: ?____ViewStyle_Internal): {
case 'marginVertical':
case 'marginBottom':
case 'marginTop':
// case 'marginBlockStart':
case 'marginLeft':
case 'marginRight':
case 'flex':
Expand Down
1 change: 1 addition & 0 deletions React/Views/RCTShadowView.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ typedef void (^RCTApplierBlock)(NSDictionary<NSNumber *, UIView *> *viewRegistry
@property (nonatomic, assign) YGValue marginBottom;
@property (nonatomic, assign) YGValue marginRight;
@property (nonatomic, assign) YGValue marginStart;
// @property (nonatomic, assign) YGValue marginBlockStart;
@property (nonatomic, assign) YGValue marginEnd;

/**
Expand Down
8 changes: 8 additions & 0 deletions React/Views/RCTShadowView.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ typedef NS_ENUM(unsigned int, meta_prop_t) {
META_PROP_VERTICAL,
META_PROP_ALL,
META_PROP_COUNT,
// META_PROP_BLOCK_START
};

@implementation RCTShadowView {
Expand Down Expand Up @@ -133,11 +134,17 @@ static void RCTProcessMetaPropsMargin(const YGValue metaProps[META_PROP_COUNT],
RCT_SET_YGVALUE_AUTO(start, YGNodeStyleSetMargin, node, YGEdgeStart);
RCT_SET_YGVALUE_AUTO(end, YGNodeStyleSetMargin, node, YGEdgeEnd);
}

NSLog(@"testee");
// if(metaProps[META_PROP_BLOCK_START].unit == YGUnitUndefined){
// NSLog(@"Caraiiiii");
// }
RCT_SET_YGVALUE_AUTO(metaProps[META_PROP_TOP], YGNodeStyleSetMargin, node, YGEdgeTop);
RCT_SET_YGVALUE_AUTO(metaProps[META_PROP_BOTTOM], YGNodeStyleSetMargin, node, YGEdgeBottom);
RCT_SET_YGVALUE_AUTO(metaProps[META_PROP_HORIZONTAL], YGNodeStyleSetMargin, node, YGEdgeHorizontal);
RCT_SET_YGVALUE_AUTO(metaProps[META_PROP_VERTICAL], YGNodeStyleSetMargin, node, YGEdgeVertical);
RCT_SET_YGVALUE_AUTO(metaProps[META_PROP_ALL], YGNodeStyleSetMargin, node, YGEdgeAll);
// RCT_SET_YGVALUE_AUTO(metaProps[META_PROP_BLOCK_START], YGNodeStyleSetMargin, node, YGEdgeTop);
}

static void RCTProcessMetaPropsBorder(const YGValue metaProps[META_PROP_COUNT], YGNodeRef node)
Expand Down Expand Up @@ -436,6 +443,7 @@ -(YGValue)margin##prop \
RCT_MARGIN_PROPERTY(Bottom, BOTTOM)
RCT_MARGIN_PROPERTY(Right, RIGHT)
RCT_MARGIN_PROPERTY(Start, START)
// RCT_MARGIN_PROPERTY(BlockStart, BLOCK_START)
RCT_MARGIN_PROPERTY(End, END)

// Padding
Expand Down
2 changes: 2 additions & 0 deletions packages/rn-tester/js/components/RNTesterExampleFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ const styles = StyleSheet.create({
alignItems: 'center',
position: 'relative',
right: 10,
// backgroundColor: 'green',
// marginBlockStart: 100,
},
searchIcon: {
width: 20,
Expand Down

0 comments on commit c57ae1c

Please sign in to comment.