diff --git a/ios/Podfile.lock b/ios/Podfile.lock index b3fc328aa..a6d7e6745 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -727,7 +727,7 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/yoga" SPEC CHECKSUMS: - boost: 7dcd2de282d72e344012f7d6564d024930a6a440 + boost: 57d2868c099736d80fcd648bf211b4431e51a558 BVLinearGradient: 880f91a7854faff2df62518f0281afb1c60d49a3 DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 FBLazyVector: 9840513ec2766e31fb9e34c2dabb2c4671400fcd @@ -810,4 +810,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 77ed9526d4011b245ce5afa1ea331dea4c67d753 -COCOAPODS: 1.14.3 +COCOAPODS: 1.14.2 diff --git a/ios/iNaturalistReactNative.xcodeproj/project.pbxproj b/ios/iNaturalistReactNative.xcodeproj/project.pbxproj index 4a23087c6..b63bcf2ac 100644 --- a/ios/iNaturalistReactNative.xcodeproj/project.pbxproj +++ b/ios/iNaturalistReactNative.xcodeproj/project.pbxproj @@ -979,7 +979,11 @@ "-DFOLLY_MOBILE=1", "-DFOLLY_USE_LIBCPP=1", ); - OTHER_LDFLAGS = "$(inherited)"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-Wl", + "-ld_classic", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; }; @@ -1048,7 +1052,11 @@ "-DFOLLY_MOBILE=1", "-DFOLLY_USE_LIBCPP=1", ); - OTHER_LDFLAGS = "$(inherited)"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-Wl", + "-ld_classic", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; diff --git a/src/api/relationships.js b/src/api/relationships.js index e94b895f9..3d444705d 100644 --- a/src/api/relationships.js +++ b/src/api/relationships.js @@ -17,6 +17,15 @@ const fetchRelationships = async ( params: Object = {}, opts: Object = {} ): Pro } }; +const createRelationships = async ( params: Object = {}, opts: Object = {} ): Promise => { + try { + const response = await inatjs.relationships.create( { ...PARAMS, ...params }, opts ); + return response; + } catch ( e ) { + return handleError( e ); + } +}; + const updateRelationships = async ( params: Object = {}, opts: Object = {} ): Promise => { try { const response = await inatjs.relationships.update( { ...PARAMS, ...params }, opts ); @@ -36,6 +45,7 @@ const deleteRelationships = async ( params: Object = {}, opts: Object = {} ): Pr }; export { + createRelationships, deleteRelationships, fetchRelationships, updateRelationships diff --git a/src/components/SharedComponents/OverviewCounts.js b/src/components/SharedComponents/OverviewCounts.js index beae8a601..57e1686d5 100644 --- a/src/components/SharedComponents/OverviewCounts.js +++ b/src/components/SharedComponents/OverviewCounts.js @@ -15,6 +15,12 @@ type Props = { } type CountProps = { + count: number, + label: string, + icon: string +} + +type CountPressableProps = { count: number, label: string, icon: string, @@ -22,8 +28,28 @@ type CountProps = { } const Count = ( { - count, label, icon, onPress + count, label, icon }: CountProps ) => ( + + + + + {typeof count === "number" + ? {t( "Intl-number", { val: count } )} + : } + {label} + +); + +const CountPressable = ( { + count, label, icon, onPress +}: CountPressableProps ) => ( ( - - )} {typeof ( counts.members_count ) === "number" && ( diff --git a/src/components/UserProfile/FollowButton.js b/src/components/UserProfile/FollowButton.js new file mode 100644 index 000000000..d99aed5c6 --- /dev/null +++ b/src/components/UserProfile/FollowButton.js @@ -0,0 +1,44 @@ +// @flow + +import { + Button +} from "components/SharedComponents"; +import { t } from "i18next"; +import type { Node } from "react"; +import React from "react"; + +type Props = { + following: boolean, + follow: Function, + unfollow: Function, + loading: boolean + }; + +const FollowButton = ( { + following, follow, unfollow, loading +}: Props ): Node => { + if ( following ) { + return ( +