Skip to content

Commit

Permalink
Use boolean flags for variants in Platform module
Browse files Browse the repository at this point in the history
These flags allow for a slightly more flexible, performant, and terse
way of branching by platform. For more details, see:
#18058 (comment)
  • Loading branch information
mkevins committed May 31, 2021
1 parent 45a11dd commit 076f2c2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/element/src/platform.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const Platform = {
}
return spec.default;
},
isNative: true,
isAndroid: true,
};

export default Platform;
2 changes: 2 additions & 0 deletions packages/element/src/platform.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const Platform = {
}
return spec.default;
},
isNative: true,
isIOS: true,
};

export default Platform;
1 change: 1 addition & 0 deletions packages/element/src/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
const Platform = {
OS: 'web',
select: ( spec ) => ( 'web' in spec ? spec.web : spec.default ),
isWeb: true,
};
/**
* Component used to detect the current Platform being used.
Expand Down

0 comments on commit 076f2c2

Please sign in to comment.