mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-23 22:18:36 -05:00
MOB-512: resuse match card classes
This commit is contained in:
@@ -19,9 +19,9 @@ import MatchHeader from "./MatchHeader";
|
||||
import PhotosSection from "./PhotosSection";
|
||||
import SaveDiscardButtons from "./SaveDiscardButtons";
|
||||
|
||||
const cardClassTop
|
||||
export const matchCardClassTop
|
||||
= "rounded-t-2xl border-lightGray border-[2px] py-[18px] px-5 border-b-0 -mb-0.5";
|
||||
const cardClassBottom
|
||||
export const matchCardClassBottom
|
||||
= "rounded-b-2xl border-lightGray border-[2px] pb-3 border-t-0 -mt-0.5 mb-[30px]";
|
||||
|
||||
type Props = {
|
||||
@@ -66,7 +66,7 @@ const Match = ( {
|
||||
return (
|
||||
<>
|
||||
<ScrollViewWrapper scrollRef={scrollRef}>
|
||||
<View className={cardClassTop}>
|
||||
<View className={matchCardClassTop}>
|
||||
{
|
||||
suggestionsLoading
|
||||
? (
|
||||
@@ -127,7 +127,7 @@ const Match = ( {
|
||||
return (
|
||||
<>
|
||||
<ScrollViewWrapper scrollRef={scrollRef}>
|
||||
<View className={cardClassTop}>
|
||||
<View className={matchCardClassTop}>
|
||||
{
|
||||
suggestionsLoading
|
||||
? (
|
||||
@@ -177,7 +177,7 @@ const Match = ( {
|
||||
return (
|
||||
<>
|
||||
<ScrollViewWrapper scrollRef={scrollRef}>
|
||||
<View className={cardClassTop}>
|
||||
<View className={matchCardClassTop}>
|
||||
{
|
||||
suggestionsLoading
|
||||
? (
|
||||
@@ -207,7 +207,7 @@ const Match = ( {
|
||||
belongsToCurrentUser
|
||||
observation={observation}
|
||||
/>
|
||||
<View className={cardClassBottom} />
|
||||
<View className={matchCardClassBottom} />
|
||||
{
|
||||
isConnected && (
|
||||
<Button
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useNetInfo } from "@react-native-community/netinfo";
|
||||
import { matchCardClassBottom, matchCardClassTop } from "components/Match/Match";
|
||||
import MatchHeader from "components/Match/MatchHeader";
|
||||
import PhotosSection from "components/Match/PhotosSection";
|
||||
import LocationSection from "components/ObsDetailsDefaultMode/LocationSection/LocationSection";
|
||||
@@ -12,11 +13,6 @@ import { useTranslation } from "sharedHooks";
|
||||
|
||||
import SavedMatchHeaderRight from "./SavedMatchHeaderRight";
|
||||
|
||||
const cardClassTop
|
||||
= "rounded-t-2xl border-lightGray border-[2px] py-[18px] px-5 border-b-0 -mb-0.5";
|
||||
const cardClassBottom
|
||||
= "rounded-b-2xl border-lightGray border-[2px] pb-3 border-t-0 -mt-0.5 mb-[30px]";
|
||||
|
||||
type Props = {
|
||||
observation: RealmObservation,
|
||||
navToTaxonDetails: ( ) => void,
|
||||
@@ -32,14 +28,10 @@ const SavedMatch = ( {
|
||||
const latitude = observation?.privateLatitude || observation?.latitude;
|
||||
const { taxon } = observation;
|
||||
|
||||
/*
|
||||
todo: globalize class strings and maybe some of the resused container functions
|
||||
*/
|
||||
|
||||
return (
|
||||
<ScrollViewWrapper>
|
||||
<SavedMatchHeaderRight uuid={observation.uuid} />
|
||||
<View className={cardClassTop}>
|
||||
<View className={matchCardClassTop}>
|
||||
<MatchHeader hideObservationStatus topSuggestion={observation} />
|
||||
</View>
|
||||
<PhotosSection
|
||||
@@ -56,7 +48,7 @@ const SavedMatch = ( {
|
||||
belongsToCurrentUser
|
||||
observation={observation}
|
||||
/>
|
||||
<View className={cardClassBottom} />
|
||||
<View className={matchCardClassBottom} />
|
||||
{
|
||||
isConnected && (
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user