Skip to content

Commit

Permalink
Unify SlackSheet again (#1478)
Browse files Browse the repository at this point in the history
  • Loading branch information
osdnk authored Dec 18, 2020
1 parent 3a5822d commit 03dfe9e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 97 deletions.
92 changes: 0 additions & 92 deletions src/components/sheet/SlackSheet.ios.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ const calculateTopPosition = (
contentHeight,
additionalTopPadding
) => {
if (ios) {
return '';
}
if (deferredHeight) return '';
const top =
contentHeight && additionalTopPadding ? deviceHeight - contentHeight : 0;
Expand All @@ -38,9 +41,13 @@ const Container = styled(Centered).attrs({ direction: 'column' })`
left: 0;
overflow: hidden;
position: absolute;
border-radius: 20;
${android ? 'border-radius: 20;' : ''}
${({ deferredHeight, contentHeight, additionalTopPadding }) =>
calculateTopPosition(deferredHeight, contentHeight, additionalTopPadding)}
calculateTopPosition(
deferredHeight,
contentHeight,
additionalTopPadding
)}
right: 0;
`;

Expand Down Expand Up @@ -116,10 +123,12 @@ export default function SlackSheet({
<Pressable onPress={goBack} style={[StyleSheet.absoluteFillObject]} />
) : null}
<Container
additionalTopPadding={additionalTopPadding}
backgroundColor={backgroundColor}
contentHeight={contentHeight}
deferredHeight={deferredHeight}
{...(android && {
additionalTopPadding,
contentHeight,
deferredHeight,
})}
{...props}
>
{android && (
Expand Down

0 comments on commit 03dfe9e

Please sign in to comment.