diff --git a/dist/BUNDLE_ID b/dist/BUNDLE_ID index 0a94c98..62d5728 100644 --- a/dist/BUNDLE_ID +++ b/dist/BUNDLE_ID @@ -1 +1 @@ -019a3ab8-dbe7-7a48-ad25-ccb100a2864b \ No newline at end of file +019a54c5-8937-7210-a2f3-19f313fb8c9f \ No newline at end of file diff --git a/package.json b/package.json index 144ec7b..dae6894 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minibits_wallet", - "version": "0.3.2-beta.7", + "version": "0.3.2-beta.8", "private": true, "scripts": { "android:clean": "cd android && ./gradlew clean", diff --git a/src/components/ListItem.tsx b/src/components/ListItem.tsx index cccf931..472956d 100644 --- a/src/components/ListItem.tsx +++ b/src/components/ListItem.tsx @@ -176,8 +176,8 @@ export const ListItem = function (props: ListItemProps) { const $subTextStyles = [$subTextStyle, $subTextStyleOverride, TextProps?.style] const $containerStyles = [ - topSeparator && $separatorTop, { borderTopColor: separatorColor }, - bottomSeparator && $separatorBottom, { borderBottomColor: separatorColor }, + $separatorTop, topSeparator && { borderTopColor: separatorColor }, + $separatorBottom, bottomSeparator && { borderBottomColor: separatorColor }, $containerStyleOverride, {paddingVertical: spacing.tiny}, ] @@ -283,11 +283,13 @@ function ListItemAction(props: ListItemActionProps) { } const $separatorTop: ViewStyle = { - borderTopWidth: 1, + borderTopWidth: 1, + borderTopColor: 'transparent', } const $separatorBottom: ViewStyle = { - borderBottomWidth: 1, + borderBottomWidth: 1, + borderBottomColor: 'transparent', } const $textStyle: TextStyle = { diff --git a/src/models/WalletStore.ts b/src/models/WalletStore.ts index c22b6fe..230323f 100644 --- a/src/models/WalletStore.ts +++ b/src/models/WalletStore.ts @@ -586,7 +586,7 @@ export const WalletStoreModel = types log.trace('[WalletStore.getProofsStatesFromMint] start', {mintUrl, unit}) const cashuWallet: CashuWallet = yield self.getWallet(mintUrl, unit, {withSeed: false}) - const proofsByState: {[key in CheckStateEnum]: Proof[]} = yield cashuWallet.checkProofsStates(proofs) + const proofsByState: {[key in CheckStateEnum]: CashuProof[]} = yield cashuWallet.checkProofsStates(proofs) log.trace('[WalletStore.getProofsStatesFromMint]', {mintUrl, proofsByState}) diff --git a/src/screens/Contacts/PublicContactsNew.tsx b/src/screens/Contacts/PublicContactsNew.tsx index 34932a4..7dbc753 100644 --- a/src/screens/Contacts/PublicContactsNew.tsx +++ b/src/screens/Contacts/PublicContactsNew.tsx @@ -22,6 +22,7 @@ import { set, toJS } from 'mobx' import FastImage from 'react-native-fast-image' import { TransferOption } from '../TransferScreen' import numbro from 'numbro' +import Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated' // const defaultPublicNpub = 'npub14n7frsyufzqsxlvkx8vje22cjah3pcwnnyqncxkuj2243jvt9kmqsdgs52' @@ -46,7 +47,6 @@ export const PublicContactsNew = observer(function (props: { const [ownProfile, setOwnProfile] = useState(undefined) const [followingPubkeys, setFollowingPubkeys] = useState([]) const [followingProfiles, setFollowingProfiles] = useState([]) - const [isOwnProfileVisible, setIsOwnProfileVisible] = useState(true) const [isLoading, setIsLoading] = useState(false) const [isNpubModalVisible, setIsNpubModalVisible] = useState(false) @@ -528,17 +528,6 @@ export const PublicContactsNew = observer(function (props: { } - const collapseProfile = function () { - LayoutAnimation.easeInEaseOut() - setIsOwnProfileVisible(false) - - } - - const expandProfile = function () { - LayoutAnimation.easeInEaseOut() - setIsOwnProfileVisible(true) - } - const handleError = function (e: AppError): void { setIsLoading(false) setError(e) @@ -668,10 +657,40 @@ export const PublicContactsNew = observer(function (props: { const inputText = useThemeColor('text') const placeholderTextColor = useThemeColor('textDim') const buttonBorder = useThemeColor('card') + + + const isOwnProfileVisible = useSharedValue(true) + const profileHeight = useSharedValue(100) + const followsListHeight = useSharedValue(spacing.screenHeight * 0.55) + + const collapseProfile = () => { + profileHeight.value = 0 + isOwnProfileVisible.value = false + followsListHeight.value = spacing.screenHeight * 0.68 + } + + const expandProfile = () => { + profileHeight.value = 100 + isOwnProfileVisible.value = true + followsListHeight.value = spacing.screenHeight * 0.55 + } + + const animatedOwnProfile = useAnimatedStyle(() => { + return { + height: withTiming(profileHeight.value, { duration: 300 }), + marginBottom: withTiming(isOwnProfileVisible.value ? spacing.medium : 0, { duration: 300 }) + } + }) + + const animatedFollowsListHeight = useAnimatedStyle(() => { + return { + maxHeight: withTiming(followsListHeight.value, { duration: 300 }), + } + }) return ( - + {!contactsStore.publicPubkey && ( )} - {ownProfile && ( - - {ownProfile.picture ? ( - - ) : ( - - )} - - } - text={ownProfile.name} - subText={isOwnProfileVisible ? relaysStore.allPublicUrls.toString() : undefined} - onPress={toggleNpubActionsModal} - rightIcon={'faEllipsisVertical'} - /> - } - style={$card} - /> + {ownProfile && ( + + + {ownProfile.picture ? ( + + ) : ( + + )} + + } + text={ownProfile.name} + subText={isOwnProfileVisible ? relaysStore.allPublicUrls.toString() : undefined} + onPress={toggleNpubActionsModal} + rightIcon={'faEllipsisVertical'} + /> + } + style={[$card]} + /> + )} {followingProfiles.length > 0 && ( - + data={followingProfiles} renderItem={({ item, index }) => { const isFirst= index === 0 @@ -819,11 +840,11 @@ export const PublicContactsNew = observer(function (props: { /> ) }} - onScrollBeginDrag={collapseProfile} - onStartReached={expandProfile} + onEndReached={collapseProfile} + onStartReached={expandProfile} keyExtractor={(item) => item.pubkey} contentInset={insets} - style={{ maxHeight: spacing.screenHeight * 0.55 }} + style={animatedFollowsListHeight} // contentContainerStyle={{paddingBottom: 200}} /> @@ -1006,14 +1027,15 @@ const $headerContainer: TextStyle = { } const $pasteButton: ViewStyle = { - borderTopLeftRadius: 0, - borderBottomLeftRadius: 0, + borderRadius: 0, alignSelf: 'stretch', justifyContent: 'center', } const $saveButton: ViewStyle = { - borderRadius: spacing.extraSmall, + borderRadius: 0, + borderTopRightRadius: spacing.extraSmall, + borderBottomRightRadius: spacing.extraSmall, // marginLeft: spacing.small, }