ref(keyboard-avoider) Don't use styled components (#12420)

This commit is contained in:
Robert Pintilii 2022-10-20 10:31:27 +03:00 committed by GitHub
parent 601e21ffcd
commit af0715dc17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 6 deletions

View File

@ -1,14 +1,9 @@
// @flow // @flow
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import styled from 'styled-components';
import { isIosMobileBrowser } from '../../../base/environment/utils'; import { isIosMobileBrowser } from '../../../base/environment/utils';
const Avoider = styled.div`
height: ${props => props.elementHeight}px;
`;
/** /**
* Component that renders an element to lift the chat input above the Safari keyboard, * Component that renders an element to lift the chat input above the Safari keyboard,
* computing the appropriate height comparisons based on the {@code visualViewport}. * computing the appropriate height comparisons based on the {@code visualViewport}.
@ -54,7 +49,7 @@ function KeyboardAvoider() {
}; };
}, []); }, []);
return <Avoider elementHeight = { elementHeight } />; return <div style = {{ height: `${elementHeight}px` }} />;
} }
export default KeyboardAvoider; export default KeyboardAvoider;