Files
upstream-mirror 1d2bfcac0c
Some checks failed
Prosody Plugin Tests / test (push) Failing after 10m11s
Close stale issues and PRs / stale (push) Failing after 1s
snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
2026-09-15 15:56:32 +05:00

45 lines
1.1 KiB
TypeScript

import React from 'react';
import { useTranslation } from 'react-i18next';
import { GestureResponderEvent, Platform } from 'react-native';
import { IconCloseLarge } from '../../../base/icons/svg';
import HeaderNavigationButton from './HeaderNavigationButton';
interface IProps {
/**
* Goes back to the previous screen function.
*/
goBack: (e?: GestureResponderEvent | React.MouseEvent) => void;
}
/**
* Close icon/text button based on platform.
*
* @returns {React.Component}
*/
const ScreenCloseButton = React.memo(({ goBack }: IProps) => {
const { t } = useTranslation();
if (Platform.OS === 'ios') {
return (
<HeaderNavigationButton
id = { 'close-screen-button' }
label = { t('dialog.close') }
onPress = { goBack } />
);
}
return (
<HeaderNavigationButton
id = { 'close-screen-button' }
onPress = { goBack }
src = { IconCloseLarge } />
);
});
ScreenCloseButton.displayName = 'ScreenCloseButton';
export default ScreenCloseButton;