mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-05-04 21:53:59 -04:00
* refactor: convert UserIcon to TypeScript * feat: show simple MyObs to signed in user; add user icon & login to header * feat: show warning and edit button for unuploaded obs w/o basics * refactor: consolidate ObsEdit navigation logic * feat: show edit button with circle dots * refactor: upload UploadQueuedRotatingIcon to the more reusable CircleDots component * refactor: upload icons to use more composition and fewer specialized, one-off components * fix: bugs in determining if an obs has date and coords * refactor: extract MyObservationsSimple business logic into container * refactor: get total obs count from relevant hooks * feat: show remote species for signed in users * fix: hide photo count icon when missing basics icon is present * feat: show banner alerting user when missing location or date Closes MOB-318
50 lines
1.2 KiB
TypeScript
50 lines
1.2 KiB
TypeScript
import classnames from "classnames";
|
|
import { INatIcon } from "components/SharedComponents";
|
|
import { View } from "components/styledComponents";
|
|
import React from "react";
|
|
import CircularProgressBase from "react-native-circular-progress-indicator";
|
|
import { useTranslation } from "sharedHooks";
|
|
|
|
type Props = {
|
|
color: string;
|
|
progress: number;
|
|
iconClasses: Array<string>;
|
|
uniqueKey?: string;
|
|
}
|
|
|
|
const UploadProgressIcon = ( {
|
|
color,
|
|
progress,
|
|
iconClasses,
|
|
uniqueKey
|
|
}: Props ) => {
|
|
const { t } = useTranslation( );
|
|
return (
|
|
<View
|
|
className={classnames( iconClasses, "justify-center", "items-center" )}
|
|
accessibilityLabel={t( "Upload-in-progress" )}
|
|
testID={`UploadIcon.progress.${uniqueKey}`}
|
|
>
|
|
<View className="absolute">
|
|
<INatIcon
|
|
name="upload-arrow"
|
|
color={color}
|
|
size={15}
|
|
/>
|
|
</View>
|
|
<CircularProgressBase
|
|
activeStrokeColor={color}
|
|
activeStrokeWidth={2.5}
|
|
inActiveStrokeOpacity={0}
|
|
maxValue={1}
|
|
radius={18}
|
|
showProgressValue={false}
|
|
testID="UploadStatus.CircularProgress"
|
|
value={progress}
|
|
/>
|
|
</View>
|
|
);
|
|
};
|
|
|
|
export default UploadProgressIcon;
|