Skip to content

Commit

Permalink
chore: allow usage of size style attrs w/o ->dp
Browse files Browse the repository at this point in the history
  • Loading branch information
cem2ran committed Apr 19, 2020
1 parent 1dd1dd0 commit 92717ca
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"dependencies": {
"@baransu/graphql_ppx_re": "0.7.1",
"@cem2ran/ppx_style": "0.0.3",
"@cem2ran/ppx_style": "0.0.4",
"@react-native-community/masked-view": "0.1.6",
"@react-navigation/core": "^5.3.3",
"@react-navigation/native": "^5.1.5",
Expand Down
7 changes: 3 additions & 4 deletions src/Post/components/ImageActions.re
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ let make = (~liked=true) => {
style={
ViewStyle({
justifyContent: spaceBetween,
paddingHorizontal: 12.->dp,
paddingVertical: 10.->dp,
paddingHorizontal: 12.,
paddingVertical: 10.,
})
}>
<Horizontal
style={ViewStyle({width: 90.->dp, justifyContent: spaceBetween})}>
<Horizontal style={ViewStyle({width: 90., justifyContent: spaceBetween})}>
<Icons.Ionicons
name={liked ? "md-heart" : "md-heart-empty"}
size=26
Expand Down
2 changes: 1 addition & 1 deletion src/Post/components/ImageDescription.re
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ open Styles;

[@react.component]
let make = (~username, ~description) =>
<View style={ViewStyle({paddingHorizontal: 12.->dp})}>
<View style={ViewStyle({paddingHorizontal: 12.})}>
<T4>
<T4_Bold value={j|$username |j} />
Option.(description or "")->React.string
Expand Down
6 changes: 3 additions & 3 deletions src/Post/components/ImageHeader.re
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ let make = (~image as uri, ~location, ~username) => {
style={
ViewStyle({
justifyContent: spaceBetween,
paddingHorizontal: 7.->dp,
paddingVertical: 10.->dp,
paddingHorizontal: 7.,
paddingVertical: 10.,
})
}>
<Horizontal>
Expand All @@ -20,7 +20,7 @@ let make = (~image as uri, ~location, ~username) => {
source=Image.(Source.fromUriSource(uriSource(~uri, ())))
/>
</TouchableWithoutFeedback>
<View style={ViewStyle({paddingLeft: 7.->dp, justifyContent: center})}>
<View style={ViewStyle({paddingLeft: 7., justifyContent: center})}>
<T2 value=username />
<T3
value={
Expand Down
4 changes: 2 additions & 2 deletions src/Post/components/ImageLikes.re
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ let make = (~likes, ~likedByUsers=[|"a", "b", "c"|]) => {
};

<Horizontal
style={ViewStyle({paddingHorizontal: 12.->dp, paddingVertical: 5.->dp})}>
<Horizontal style={ViewStyle({width: 50.->dp})}>
style={ViewStyle({paddingHorizontal: 12., paddingVertical: 5.})}>
<Horizontal style={ViewStyle({width: 50.})}>
images->React.array
</Horizontal>
<T4>
Expand Down
4 changes: 2 additions & 2 deletions src/Profile/Profile.re
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ let make = () => {
<TouchableOpacity
style={
ViewStyle({
width: 32.->dp,
height: 32.->dp,
width: 32.,
height: 32.,
alignItems: center,
justifyContent: center,
})
Expand Down
4 changes: 2 additions & 2 deletions src/Profile/components/ProfileInfo.re
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ let make = (~id) => {
style={
ViewStyle({
justifyContent: spaceBetween,
paddingHorizontal: 12.->dp,
paddingVertical: 12.->dp,
paddingHorizontal: 12.,
paddingVertical: 12.,
})
}>
<Horizontal>
Expand Down
2 changes: 1 addition & 1 deletion src/components/EditButton.re
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let style =
borderColor: "#E6E6E6",
borderRadius: 4.,
borderWidth: 1.5,
padding: 5.->dp,
padding: 5.,
})
);

Expand Down
2 changes: 1 addition & 1 deletion src/components/Styled.re
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ module type TextT = {
},
React.element,
);
};
};
2 changes: 2 additions & 0 deletions src/config/Typography.re
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ open ReactNative;
module Edit = {
include Text;

let make = Text.make;

let makeProps =
Styled.text(style =>
style(~fontSize=13., ~fontWeight=`_700, ~color="#333", ())
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1160,10 +1160,10 @@
resolved "https://registry.yarnpkg.com/@base2/pretty-print-object/-/pretty-print-object-1.0.0.tgz#860ce718b0b73f4009e153541faff2cb6b85d047"
integrity sha512-4Th98KlMHr5+JkxfcoDT//6vY8vM+iSPrLNpHhRyLx2CFYi8e2RfqPLdpbnpo0Q5lQC5hNB79yes07zb02fvCw==

"@cem2ran/[email protected].3":
version "0.0.3"
resolved "https://registry.yarnpkg.com/@cem2ran/ppx_style/-/ppx_style-0.0.3.tgz#db582e0b959618eefdde2601ca8c07bdce76e593"
integrity sha512-wmZji0IJJxg6JUwwQjqMDcZtCws0DiZZVfWXMA2NhYQ012nVGMbnayTr2tO1rkrH6oGrzky/vh3tcS4jOfKsHQ==
"@cem2ran/[email protected].4":
version "0.0.4"
resolved "https://registry.yarnpkg.com/@cem2ran/ppx_style/-/ppx_style-0.0.4.tgz#c5149c089ab2797dac5589bfe08553ff949e4c5a"
integrity sha512-viw3N23Pnn1EedXWXpab9UTTmy5zePZry2jKjxr6lsmrP02bJuWrDAKJ2MjgO+EQMIMwKPvkUkIPkZZzbrxhZA==

"@cnakazawa/watch@^1.0.3":
version "1.0.4"
Expand Down

0 comments on commit 92717ca

Please sign in to comment.