mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-05-05 06:05:12 -04:00
* Change black text to dark gray text * Start simplifying to a single color scheme * Remove custom paper theme colors * More theme cleanup * Styling specifically for RNPaper components * Update snapshots to use hex colors, not rbga
53 lines
1.2 KiB
TypeScript
53 lines
1.2 KiB
TypeScript
import classnames from "classnames";
|
|
import {
|
|
Body2,
|
|
INatIcon
|
|
} from "components/SharedComponents";
|
|
import { Pressable } from "components/styledComponents";
|
|
import React from "react";
|
|
import { useTranslation } from "sharedHooks";
|
|
|
|
interface Props {
|
|
color?: string;
|
|
onPress: () => void;
|
|
}
|
|
|
|
const OfflineNotice = ( {
|
|
color,
|
|
onPress
|
|
}: Props ) => {
|
|
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}`
|
|
: "text-darkGray"
|
|
)}
|
|
>
|
|
{ t( "You-are-offline-Tap-to-try-again" ) }
|
|
</Body2>
|
|
</Pressable>
|
|
);
|
|
};
|
|
|
|
export default OfflineNotice;
|