Skip to content

Commit

Permalink
Feat/sprint lfg time (#200)
Browse files Browse the repository at this point in the history
* fix docs build

* add img tuto + css

* start test dapp browser

* start add iframe

* start ui qrcode

* qr code and send to contact

* onpress hashtag

* login module and refacto

* add login modal if not connected

* fix lint and prettier
  • Loading branch information
MSghais authored Oct 23, 2024
1 parent 2b0434f commit 213f14d
Show file tree
Hide file tree
Showing 138 changed files with 1,613 additions and 1,186 deletions.
5 changes: 2 additions & 3 deletions apps/mobile/src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import {starknetChainId, useAccount} from '@starknet-react/core';
import * as Font from 'expo-font';
import * as SplashScreen from 'expo-splash-screen';
import {useCallback, useEffect, useState} from 'react';
import {View, Platform} from 'react-native';
import {useNavigationContainerRef} from '@react-navigation/native';
import {View} from 'react-native';

import {useTips} from '../hooks';
import {useDialog, useToast} from '../hooks/modals';
import {Router} from './Router';
import {initGoogleAnalytics} from '../utils/analytics';

SplashScreen.preventAutoHideAsync();

Expand Down
47 changes: 22 additions & 25 deletions apps/mobile/src/app/Router.tsx
Original file line number Diff line number Diff line change
@@ -1,68 +1,62 @@
// Hooks
import {useEffect, useMemo, useRef} from 'react';
import {useWindowDimensions, View, Platform} from 'react-native';
import {useStyles, useTheme} from '../hooks';

// Navigation Components
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import {createDrawerNavigator} from '@react-navigation/drawer';
import {NavigationContainer, useNavigation, useRoute} from '@react-navigation/native';
import {useNavigationContainerRef} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import {useAuth} from 'afk_nostr_sdk';
import {useEffect, useMemo, useRef} from 'react';
import {Platform, useWindowDimensions, View} from 'react-native';
// Styles
import {StyleSheet} from 'react-native';

// import RightSidebar from '../modules/Layout/RightSideBar';
// Components
import {Icon} from '../components';
// import { retrievePublicKey } from '../utils/storage';
// Icons
import {IconNames} from '../components/Icon';
import {Navbar} from '../components/Navbar';
import {useStyles, useTheme} from '../hooks';
// Modules and Layout
import GroupChatDetail from '../modules/Group/groupDetail/GroupChatDetail';
import GroupChatGroupRequest from '../modules/Group/memberAction/ViewRequest';
import GroupChat from '../modules/Group/message/GroupMessage';
import AuthSidebar from '../modules/Layout/auth-sidebar';
import Sidebar from '../modules/Layout/sidebar';
import RightSidebar from '../modules/Layout/RightSideBar';
import ShortVideosModule from '../modules/ShortVideos';
// import RightSidebar from '../modules/Layout/RightSideBar';

// Components
import {Icon} from '../components';
import {Navbar} from '../components/Navbar';

// Screens
import {CreateAccount} from '../screens/Auth/nostr/CreateAccount';
import {ImportKeys} from '../screens/Auth/nostr/ImportKeys';
import {LoginNostr} from '../screens/Auth/nostr/LoginNostr';
import {SaveKeys} from '../screens/Auth/nostr/SaveKeys';
import {CashuScreen} from '../screens/Cashu';
import {ChannelDetail} from '../screens/ChannelDetail';
import {ChannelsFeed} from '../screens/ChannelsFeed';
import {CreateChannel} from '../screens/CreateChannel';
import {CreateForm} from '../screens/CreateForm';
import {CreatePost} from '../screens/CreatePost';
import {DappBrowserScreen} from '../screens/DappBrowser';
import {Defi} from '../screens/Defi';
import {EditProfile} from '../screens/EditProfile';
import {Feed} from '../screens/Feed';
import {Games} from '../screens/Games';
import {LaunchDetail} from '../screens/LaunchDetail';
import {LightningNetworkScreen} from '../screens/Lightning';
import {Onboarding} from '../screens/Onboarding';
import {PostDetail} from '../screens/PostDetail';
import {Profile} from '../screens/Profile';
import {Search} from '../screens/Search';
import {Settings} from '../screens/Settings';
import {TagsView} from '../screens/Tags';
import {Tips} from '../screens/Tips';
import {CashuScreen} from '../screens/Cashu';
import {WalletBTC} from '../screens/WalletBTC';
import {Wallet} from '../screens/Wallet';

// Styles
import {StyleSheet} from 'react-native';
import {WalletBTC} from '../screens/WalletBTC';
import {ThemedStyleSheet} from '../styles';

// Utilities
import {AuthStackParams, HomeBottomStackParams, MainStackParams, RootStackParams} from '../types';
import {useNavigationContainerRef} from '@react-navigation/native';
// import { retrievePublicKey } from '../utils/storage';

// Icons
import {IconNames} from '../components/Icon';
import {useAuth} from 'afk_nostr_sdk';
import {Onboarding} from '../screens/Onboarding';
import {initGoogleAnalytics, logPageView} from '../utils/analytics';
import {TagsView} from '../screens/Tags';

type TabBarIconProps = {
focused: boolean;
Expand Down Expand Up @@ -312,6 +306,7 @@ const MainNavigator: React.FC = () => {

<MainStack.Screen name="ShortVideos" component={ShortVideosModule} />
<MainStack.Screen name="Onboarding" component={Onboarding} />
<MainStack.Screen name="DappBrowser" component={DappBrowserScreen} />
</MainStack.Navigator>
);
};
Expand Down Expand Up @@ -403,6 +398,7 @@ const linking = {
CreateAccount: 'create-account',
SaveKeys: 'save-keys',
ImportKeys: 'import-keys',
DappBrowser: 'browser',
},
},
MainStack: {
Expand Down Expand Up @@ -471,6 +467,7 @@ const linking = {
Wallet: 'wallet',
Portfolio: 'portfolio',
ShortVideos: 'shorts',
DappBrowser: 'browser',
},
},
},
Expand Down
9 changes: 5 additions & 4 deletions apps/mobile/src/app/SiweUtils.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/* eslint-disable @typescript-eslint/no-unused-vars */

import {generateRandomBytes32} from '@walletconnect/utils';
import AsyncStorage from '@react-native-async-storage/async-storage';
import {
type SIWECreateMessageArgs,
type SIWEVerifyMessageArgs,
createSIWEConfig,
formatMessage,
type SIWEVerifyMessageArgs,
type SIWECreateMessageArgs,
} from '@reown/appkit-siwe-react-native';
import {generateRandomBytes32} from '@walletconnect/utils';

import {chains} from './WagmiUtils';
import AsyncStorage from '@react-native-async-storage/async-storage';

const LOGGED_IN_KEY = '@appkit/logged_in';
const SESSION_KEY = '@appkit/session';
Expand Down
56 changes: 25 additions & 31 deletions apps/mobile/src/app/StripeProviderContext.tsx
Original file line number Diff line number Diff line change
@@ -1,35 +1,29 @@
import { StripeProvider } from '@stripe/stripe-react-native';
import { PropsWithChildren, useEffect, useState } from 'react';
import * as Linking from 'expo-linking';
import {StripeProvider} from '@stripe/stripe-react-native';
import Constants from 'expo-constants';
const EXPO_PUBLIC_MERCHANT_ID_APPLE = process.env.EXPO_PUBLIC_MERCHANT_ID_APPLE
export const StripeProviderContext: React.FC<PropsWithChildren> = ({ children }) => {
const [publishableKey, setPublishableKey] = useState('');

const fetchPublishableKey = async () => {
// const key = await fetchKey(); // fetch key from your server here
// setPublishableKey(key);
};

useEffect(() => {
fetchPublishableKey();
}, []);
import * as Linking from 'expo-linking';
import {PropsWithChildren, useEffect, useState} from 'react';
const EXPO_PUBLIC_MERCHANT_ID_APPLE = process.env.EXPO_PUBLIC_MERCHANT_ID_APPLE;
export const StripeProviderContext: React.FC<PropsWithChildren> = ({children}) => {
const [publishableKey, setPublishableKey] = useState('');

const urlScheme =
Constants.appOwnership === 'expo'
? Linking.createURL('/--/')
: Linking.createURL('')
return (
<StripeProvider
publishableKey={publishableKey}
merchantIdentifier={EXPO_PUBLIC_MERCHANT_ID_APPLE ?? "merchant.identifier"} // required for Apple Pay
urlScheme={urlScheme ?? "your-url-scheme"}// required for 3D Secure and bank redirects
>
const fetchPublishableKey = async () => {
// const key = await fetchKey(); // fetch key from your server here
// setPublishableKey(key);
};

<>
{children}
</>
useEffect(() => {
fetchPublishableKey();
}, []);

</StripeProvider>
);
}
const urlScheme =
Constants.appOwnership === 'expo' ? Linking.createURL('/--/') : Linking.createURL('');
return (
<StripeProvider
publishableKey={publishableKey}
merchantIdentifier={EXPO_PUBLIC_MERCHANT_ID_APPLE ?? 'merchant.identifier'} // required for Apple Pay
urlScheme={urlScheme ?? 'your-url-scheme'} // required for 3D Secure and bank redirects
>
<>{children}</>
</StripeProvider>
);
};
14 changes: 7 additions & 7 deletions apps/mobile/src/app/WagmiUtils.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import {CreateConfigParameters} from 'wagmi';
import {
arbitrum,
mainnet,
polygon,
aurora,
avalanche,
bsc,
optimism,
gnosis,
zora,
base,
bsc,
celo,
aurora,
gnosis,
mainnet,
optimism,
polygon,
sepolia,
zora,
} from 'wagmi/chains';

export const chains = [
Expand Down
16 changes: 9 additions & 7 deletions apps/mobile/src/app/Wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ import {SafeAreaProvider} from 'react-native-safe-area-context';
import {RootScreenContainer} from '../components';
import {DialogProvider} from '../context/Dialog';
import {KeyModalProvider} from '../context/KeysModal';
import {LoginModalProvider} from '../context/LoginModalProvider';
import {ModalParentProvider} from '../context/modal/ModalParent';
import {SwapModalEVMProvider} from '../context/SwapModalProvider';
import {ThemeProvider} from '../context/Theme';
import {TipModalProvider} from '../context/TipModal';
import {TipModalStarknetProvider} from '../context/TipModalStarknet';
import {ToastProvider} from '../context/Toast/ToastContext';
import {TokenCreateModalProvider} from '../context/TokenCreateModal';
import {TransactionModalProvider} from '../context/TransactionModal';
import {WalletModalProvider} from '../context/WalletModal';
import App from './App';
import {StarknetProvider} from './StarknetProvider';
import {ModalParentProvider} from '../context/modal/ModalParent';
import {EVMProvider} from './EVMProvider';
import {WalletModalEVMProvider} from '../context/WalletModalEvmProvider';
import {CashuProvider} from '../providers/CashuProvider';
import {dynamicClient} from './DynamicClient';
import {SwapModalEVMProvider} from '../context/SwapModalProvider';
import App from './App';
import {EVMProvider} from './EVMProvider';
import {StarknetProvider} from './StarknetProvider';

const queryClient = new QueryClient({
defaultOptions: {queries: {retry: 2}},
Expand All @@ -39,7 +39,9 @@ const ModalProviders = ({children}: {children: React.ReactNode}) => {
<TipModalStarknetProvider>
<TokenCreateModalProvider>
<KeyModalProvider>
<ModalParentProvider>{children}</ModalParentProvider>
<LoginModalProvider>
<ModalParentProvider>{children}</ModalParentProvider>
</LoginModalProvider>
</KeyModalProvider>
</TokenCreateModalProvider>
</TipModalStarknetProvider>
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/src/assets/icons.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Svg, {G, Path, Polygon, Rect, SvgProps} from 'react-native-svg';
import Svg, {G, Path, Rect, SvgProps} from 'react-native-svg';

export const AddPostIcon: React.FC<SvgProps> = (props) => (
<Svg viewBox="0 0 72 72" fill="none" {...props}>
Expand Down
7 changes: 4 additions & 3 deletions apps/mobile/src/components/AddressComponent/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from 'react';
import {View, Text, TouchableOpacity, StyleSheet, Alert} from 'react-native';
// import Clipboard from '@react-native-clipboard/clipboard';
import {MaterialIcons} from '@expo/vector-icons';
import stylesheet from './styles';
import React from 'react';
import {Alert, Text, TouchableOpacity, View} from 'react-native';

import {useStyles} from '../../hooks';
import stylesheet from './styles';

interface AddressProps {
address: string;
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/src/components/AddressComponent/styles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Spacing, ThemedStyleSheet} from '../../styles';
import {ThemedStyleSheet} from '../../styles';

export default ThemedStyleSheet((theme) => ({
container: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {feltToAddress} from 'common';
import {FlatList, View} from 'react-native';

import {useStyles} from '../../../hooks';
import {TokenHoldersInterface} from '../../../types/keys';
import {AddressComponent} from '../../AddressComponent';
import Loading from '../../Loading';
import {Text} from '../../Text';
import stylesheet from './styles';
import Loading from '../../Loading';
import {feltToAddress} from 'common';
import {AddressComponent} from '../../AddressComponent';

export type HoldersProps = {
loading: boolean;
Expand Down
7 changes: 3 additions & 4 deletions apps/mobile/src/components/LaunchPad/TokenStats/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import {FlatList, View} from 'react-native';
import {View} from 'react-native';

import {useStyles} from '../../../hooks';
import {TokenStatsInterface} from '../../../types/keys';
import Loading from '../../Loading';
import {Text} from '../../Text';
import stylesheet from './styles';
import {Fraction} from '@uniswap/sdk-core';
import {decimalsScale} from '../../../utils/helpers';
import Loading from '../../Loading';

export type TokenStatsProps = {
loading: boolean;
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/src/components/LaunchPad/TokenStats/styles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Spacing, ThemedStyleSheet} from '../../../styles';
import {ThemedStyleSheet} from '../../../styles';
export default ThemedStyleSheet((theme) => ({
card: {
backgroundColor: theme.colors.background,
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/src/components/LaunchPad/TokenTx/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import {FlatList, View} from 'react-native';

import {useStyles} from '../../../hooks';
import {TokenTxInterface} from '../../../types/keys';
import Loading from '../../Loading';
import {Text} from '../../Text';
import stylesheet from './styles';
import Loading from '../../Loading';

export type TokenTxProps = {
loading: boolean;
Expand Down
12 changes: 6 additions & 6 deletions apps/mobile/src/components/LaunchPad/UserShare/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {FlatList, Pressable, View} from 'react-native';
import {useEffect, useState} from 'react';
import {Pressable, View} from 'react-native';
import {useAccount} from 'wagmi';

import {useStyles, useWaitConnection} from '../../../hooks';
import {useGetShares} from '../../../hooks/api/indexer/useUserShare';
import {useWalletModal} from '../../../hooks/modals';
import {TokenStatsInterface, UserShareInterface} from '../../../types/keys';
import Loading from '../../Loading';
import {Text} from '../../Text';
import stylesheet from './styles';
import Loading from '../../Loading';
import {useGetShares} from '../../../hooks/api/indexer/useUserShare';
import {useAccount} from 'wagmi';
import {useEffect, useState} from 'react';
import {useWalletModal} from '../../../hooks/modals';

export type UserShareProps = {
loading: boolean;
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/components/Modalize/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const Modalize = forwardRef<RNModalize, ModalizeProps>((props, ref) => {
ref={ref}
handlePosition={Platform.OS === 'ios' ? 'inside' : 'outside'}
adjustToContentHeight
// withReactModal={true}
modalStyle={[styles.modal, modalStyleProp]}
{...modalizeProps}
>
Expand Down
Loading

0 comments on commit 213f14d

Please sign in to comment.