mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-06-21 14:08:31 -04:00
* Added clean script; fixed UI Library * OfflineNotice component; added to Notifications * OfflineNotice on ObsDetails media * OfflineNotice for DQA
53 lines
1.2 KiB
JavaScript
53 lines
1.2 KiB
JavaScript
// @flow
|
|
import classnames from "classnames";
|
|
import {
|
|
Body2,
|
|
INatIcon
|
|
} from "components/SharedComponents";
|
|
import { Pressable } from "components/styledComponents";
|
|
import type { Node } from "react";
|
|
import React from "react";
|
|
import { useTranslation } from "sharedHooks";
|
|
|
|
type Props = {
|
|
color?: string,
|
|
onPress: Function
|
|
};
|
|
|
|
const OfflineNotice = ( {
|
|
color,
|
|
onPress
|
|
}: Props ): Node => {
|
|
const { t } = useTranslation( );
|
|
if ( typeof ( onPress ) !== "function" ) {
|
|
throw new Error( "OfflineNotice needs an onPress function" );
|
|
}
|
|
return (
|
|
<Pressable
|
|
accessibilityLabel={t( "Internet-Connection-Required" )}
|
|
accessibilityHint={t( "Loads-content-that-requires-an-Internet-connection" )}
|
|
onPress={onPress}
|
|
className="justify-center items-center w-full h-full"
|
|
>
|
|
<INatIcon
|
|
name="offline"
|
|
size={72}
|
|
aria-hidden
|
|
accessibilityElementsHidden
|
|
importantForAccessibility="no"
|
|
color={color}
|
|
/>
|
|
<Body2
|
|
className={classnames(
|
|
"mt-[30px]",
|
|
color && `text-${color}`
|
|
)}
|
|
>
|
|
{ t( "You-are-offline-Tap-to-try-again" ) }
|
|
</Body2>
|
|
</Pressable>
|
|
);
|
|
};
|
|
|
|
export default OfflineNotice;
|