MOB-512: resuse match card classes

This commit is contained in:
sepeterson
2025-11-21 10:31:09 -06:00
parent e8a5beded7
commit 45f2f63dff
2 changed files with 9 additions and 17 deletions

View File

@@ -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

View File

@@ -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