From 4dfa89ec1649824aea36cc6b5987192768d44b87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fur=20Eren?= Date: Wed, 24 Jul 2024 04:15:58 +0300 Subject: [PATCH 1/6] Remove unused icons --- JoyboyCommunity/src/components/Header/index.tsx | 7 ++++--- JoyboyCommunity/src/modules/Post/index.tsx | 4 +--- JoyboyCommunity/src/screens/PostDetail/index.tsx | 2 +- JoyboyCommunity/src/screens/Profile/Info/index.tsx | 10 +++++----- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/JoyboyCommunity/src/components/Header/index.tsx b/JoyboyCommunity/src/components/Header/index.tsx index fe508b7c..0aaea5d5 100644 --- a/JoyboyCommunity/src/components/Header/index.tsx +++ b/JoyboyCommunity/src/components/Header/index.tsx @@ -3,7 +3,6 @@ import {SafeAreaView} from 'react-native-safe-area-context'; import {JoyboyIcon} from '../../assets/icons'; import {useStyles, useTheme} from '../../hooks'; -import {IconButton} from '../IconButton'; import {Text} from '../Text'; import stylesheet from './styles'; @@ -39,11 +38,13 @@ export const Header: React.FC = ({showLogo = true, left, right, tit )} - {right ?? ( + {right} + + {/* {right ?? ( - )} + )} */} ); diff --git a/JoyboyCommunity/src/modules/Post/index.tsx b/JoyboyCommunity/src/modules/Post/index.tsx index bd663708..dfff4ae4 100644 --- a/JoyboyCommunity/src/modules/Post/index.tsx +++ b/JoyboyCommunity/src/modules/Post/index.tsx @@ -74,7 +74,6 @@ export const Post: React.FC = ({asComment, event}) => { return {uri: imageTag[1], width: dimensions[0], height: dimensions[1]}; }, [event?.tags]); - // Animated style for the icon const animatedIconStyle = useAnimatedStyle(() => ({ transform: [{scale: scale.value}], })); @@ -90,7 +89,6 @@ export const Post: React.FC = ({asComment, event}) => { navigation.navigate('PostDetail', {postId: event?.id, post: event}); }; - /** @TODO comment in Nostr */ const toggleLike = async () => { if (!event?.id) return; @@ -226,7 +224,7 @@ export const Post: React.FC = ({asComment, event}) => { setMenuOpen(true)} /> } > - + {/* */} = ({navigation, route})
} - right={} + /* right={} */ title="Conversation" /> diff --git a/JoyboyCommunity/src/screens/Profile/Info/index.tsx b/JoyboyCommunity/src/screens/Profile/Info/index.tsx index 1390367c..13d22468 100644 --- a/JoyboyCommunity/src/screens/Profile/Info/index.tsx +++ b/JoyboyCommunity/src/screens/Profile/Info/index.tsx @@ -76,7 +76,7 @@ export const ProfileInfo: React.FC = ({publicKey: userPublicKe Edit profile - setMenuOpen(false)} handle={ @@ -93,7 +93,7 @@ export const ProfileInfo: React.FC = ({publicKey: userPublicKe icon="ShareIcon" /> - + */} ) : ( <> @@ -108,7 +108,7 @@ export const ProfileInfo: React.FC = ({publicKey: userPublicKe {isConnected ? 'UnFollow' : 'Follow'} - + {/* */} = ({publicKey: userPublicKe setMenuOpen(false); }} /> - - + */} ) From c01f004302f73af4fa2475ad45099af003e1e913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fur=20Eren?= Date: Wed, 24 Jul 2024 11:27:06 +0300 Subject: [PATCH 2/6] Enable error logs --- website/src/app/api/deposit/claim/route.ts | 2 ++ website/src/app/api/deposit/estimate-claim/route.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/website/src/app/api/deposit/claim/route.ts b/website/src/app/api/deposit/claim/route.ts index d3d7d5d7..9c819d98 100644 --- a/website/src/app/api/deposit/claim/route.ts +++ b/website/src/app/api/deposit/claim/route.ts @@ -117,6 +117,8 @@ export async function POST(request: NextRequest) { return NextResponse.json({transaction_hash}, {status: HTTPStatus.OK}); } } catch (error) { + console.error(error); + return NextResponse.json( {code: ErrorCode.TRANSACTION_ERROR, error}, {status: HTTPStatus.InternalServerError}, diff --git a/website/src/app/api/deposit/estimate-claim/route.ts b/website/src/app/api/deposit/estimate-claim/route.ts index 343e5039..bf4e2724 100644 --- a/website/src/app/api/deposit/estimate-claim/route.ts +++ b/website/src/app/api/deposit/estimate-claim/route.ts @@ -124,6 +124,8 @@ export async function POST(request: NextRequest) { ); } } catch (error) { + console.error(error); + return NextResponse.json( {code: ErrorCode.ESTIMATION_ERROR, error}, {status: HTTPStatus.InternalServerError}, From 912c005b365a337d1da9211473de56f8c46d4996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fur=20Eren?= Date: Wed, 24 Jul 2024 11:45:46 +0300 Subject: [PATCH 3/6] Copy public key --- JoyboyCommunity/src/screens/Profile/Info/index.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/JoyboyCommunity/src/screens/Profile/Info/index.tsx b/JoyboyCommunity/src/screens/Profile/Info/index.tsx index 13d22468..e7a8ba75 100644 --- a/JoyboyCommunity/src/screens/Profile/Info/index.tsx +++ b/JoyboyCommunity/src/screens/Profile/Info/index.tsx @@ -1,5 +1,6 @@ import {useNavigation} from '@react-navigation/native'; import {useQueryClient} from '@tanstack/react-query'; +import * as Clipboard from 'expo-clipboard'; import {useState} from 'react'; import {Pressable, View} from 'react-native'; @@ -58,6 +59,11 @@ export const ProfileInfo: React.FC = ({publicKey: userPublicKe ); }; + const handleCopyPublicKey = async () => { + await Clipboard.setStringAsync(userPublicKey); + showToast({type: 'info', title: 'Public key copied to the clipboard'}); + }; + return ( = ({publicKey: userPublicKe {userPublicKey} - + From 79f2e8827047cc338cea1cc010e2108e03e8a01a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fur=20Eren?= Date: Wed, 24 Jul 2024 12:29:08 +0300 Subject: [PATCH 4/6] Remove argent mobile adapter --- JoyboyCommunity/src/app/StarknetProvider.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/JoyboyCommunity/src/app/StarknetProvider.tsx b/JoyboyCommunity/src/app/StarknetProvider.tsx index 221582b1..3f354901 100644 --- a/JoyboyCommunity/src/app/StarknetProvider.tsx +++ b/JoyboyCommunity/src/app/StarknetProvider.tsx @@ -12,7 +12,7 @@ import { } from '@starknet-wc/react'; import {Platform} from 'react-native'; -import {NETWORK_NAME, WALLET_CONNECT_ID} from '../constants/env'; +import {NETWORK_NAME} from '../constants/env'; import {RpcProviderProvider} from '../context/RpcProvider'; import {WalletQRModal} from '../modules/WalletQRModal'; import {providers} from '../services/provider'; @@ -38,14 +38,14 @@ export const StarknetReactProvider: React.FC = ({childr chains={[chain]} provider={providers} connectors={[ - argentMobileConnector({ + /* argentMobileConnector({ chain: NETWORK_NAME, wcProjectId: WALLET_CONNECT_ID, dappName: 'Joyboy', description: 'Joyboy Starknet dApp', url: 'https://joyboy.community', provider, - }), + }), */ ...(Platform.OS === 'web' ? injected : []), ]} From f1ca1b846e92e5e9b852758c9a94c49ac6a6d60a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fur=20Eren?= Date: Wed, 24 Jul 2024 12:37:00 +0300 Subject: [PATCH 5/6] Enable error logs --- website/src/app/api/file/route.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/website/src/app/api/file/route.ts b/website/src/app/api/file/route.ts index 914fd6e2..35010107 100644 --- a/website/src/app/api/file/route.ts +++ b/website/src/app/api/file/route.ts @@ -28,7 +28,8 @@ export async function POST(request: NextRequest) { {status: HTTPStatus.OK}, ); } catch (error) { - console.log(error); + console.error(error); + return NextResponse.json( {code: ErrorCode.TRANSACTION_ERROR, error}, {status: HTTPStatus.InternalServerError}, From ba5bb44e64633adcb42f4bb174a4e7f0a94fcd3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fur=20Eren?= Date: Wed, 24 Jul 2024 12:50:45 +0300 Subject: [PATCH 6/6] Fix modal scroll --- .../src/modules/TipModal/index.tsx | 181 +++++++++--------- 1 file changed, 89 insertions(+), 92 deletions(-) diff --git a/JoyboyCommunity/src/modules/TipModal/index.tsx b/JoyboyCommunity/src/modules/TipModal/index.tsx index 33410415..c4c6c2f5 100644 --- a/JoyboyCommunity/src/modules/TipModal/index.tsx +++ b/JoyboyCommunity/src/modules/TipModal/index.tsx @@ -2,7 +2,6 @@ import {NDKEvent} from '@nostr-dev-kit/ndk'; import {useAccount} from '@starknet-react/core'; import {forwardRef, useState} from 'react'; import {View} from 'react-native'; -import {SafeAreaView} from 'react-native-safe-area-context'; import {CallData, uint256} from 'starknet'; import {Avatar, Button, Input, Modalize, Picker, Text} from '../../components'; @@ -115,111 +114,109 @@ export const TipModal = forwardRef( }; return ( - - - - - - - - - - {profile?.displayName ?? profile?.name ?? event?.pubkey} - + + + + + + + + + {profile?.displayName ?? profile?.name ?? event?.pubkey} + - {profile?.nip05 && ( - - @{profile?.nip05} - - )} - + {profile?.nip05 && ( + + @{profile?.nip05} + + )} - - - {event?.content} - - - - setToken(itemValue as TokenSymbol)} - > - {Object.values(TOKENS).map((tkn) => ( - - ))} - - - - + + {event?.content} + + + + + + setToken(itemValue as TokenSymbol)} + > + {Object.values(TOKENS).map((tkn) => ( + + ))} + - - - - Sending - + + - {amount.length > 0 && token.length > 0 ? ( - - {amount} {token} - - ) : ( - - ... - - )} - + + + + Sending + - - - to + {amount.length > 0 && token.length > 0 ? ( + + {amount} {token} - - {(profile?.nip05 && `@${profile.nip05}`) ?? - profile?.displayName ?? - profile?.name ?? - event?.pubkey} + ) : ( + + ... - + )} - - + + + to + + + {(profile?.nip05 && `@${profile.nip05}`) ?? + profile?.displayName ?? + profile?.name ?? + event?.pubkey} + - - - Tip friends and support creators with your favorite tokens. - - + + + + + + + + Tip friends and support creators with your favorite tokens. + ); },