fix: floating button position on iPad

This commit is contained in:
Radek Czemerys
2020-11-28 21:45:19 +01:00
parent 4a36cbfea0
commit bb2e30b287
2 changed files with 12 additions and 3 deletions

View File

@@ -34,7 +34,13 @@ import { StyledIcon } from './Notes.styled';
import { notePassesFilter, NoteSortKey } from './utils';
export const Notes = React.memo(
({ shouldSplitLayout }: { shouldSplitLayout: boolean | undefined }) => {
({
shouldSplitLayout,
keyboardHeight,
}: {
shouldSplitLayout: boolean | undefined;
keyboardHeight: number | undefined;
}) => {
// Context
const application = useContext(ApplicationContext);
const theme = useContext(ThemeContext);
@@ -477,7 +483,7 @@ export const Notes = React.memo(
// @ts-ignore style prop does not exist in types
style={
application?.getAppState().isInTabletMode
? { bottom: application?.getAppState().getKeyboardHeight() }
? { bottom: keyboardHeight }
: undefined
}
buttonColor={theme.stylekitInfoColor}

View File

@@ -136,7 +136,10 @@ export const Root = (): JSX.Element | null => {
notesListCollapsed={noteListCollapsed}
shouldSplitLayout={shouldSplitLayout}
>
<Notes shouldSplitLayout={shouldSplitLayout} />
<Notes
keyboardHeight={keyboardHeight}
shouldSplitLayout={shouldSplitLayout}
/>
</NotesContainer>
{hasEditor && shouldSplitLayout && (
<ComposeContainer>