diff --git a/src/components/MySuspenseFallback.tsx b/src/components/MySuspenseFallback.tsx new file mode 100644 index 0000000..67c8ba2 --- /dev/null +++ b/src/components/MySuspenseFallback.tsx @@ -0,0 +1,13 @@ +import {Suspense} from 'react'; +import {Text} from 'react-native'; + +export function MySuspenseFallback({children}: {children: React.ReactNode}) { + console.log('MySuspenseFallback'); + + return ( + loading...}> + {children} + + ); +} diff --git a/src/event/types.ts b/src/event/types.ts index 35cfa87..f9c4b99 100644 --- a/src/event/types.ts +++ b/src/event/types.ts @@ -46,6 +46,9 @@ export interface PAEvent { UserLength: BasicEventProp; EventBannerPicture: EventBannerPicture; ButtonAction: BasicEventProp; + //isJoined + //minAge + //AddressText } export function NumToEventType(num: number): EventType { @@ -68,4 +71,4 @@ export function EventTypeToNum(type: EventType): number { default: return 0; } -} \ No newline at end of file +} diff --git a/src/navigation/tabs/main/ProfileTab.tsx b/src/navigation/tabs/main/ProfileTab.tsx index c971c6c..c22c778 100644 --- a/src/navigation/tabs/main/ProfileTab.tsx +++ b/src/navigation/tabs/main/ProfileTab.tsx @@ -6,21 +6,76 @@ import {useSelector} from 'react-redux'; import {RootState} from '@redux/store'; import {MyIconButton} from '@components/MyButton'; import {useNavigation} from '@react-navigation/native'; -import { - ProfileOverview, - UpdatePassword, - UpdateUsername, -} from '@pages/profile/profile'; -import {Help} from '@pages/profile/help'; -import {About} from '@pages/profile/about'; -import {lazy, Suspense} from 'react'; +import {ProfileOverview} from '@pages/profile/profile'; +import {lazy} from 'react'; +import {MySuspenseFallback} from '@components/MySuspenseFallback'; -const ProfileSettings = lazy(() => +const LazyProfileSettings = lazy(() => import('@pages/profile/profile').then(module => ({ default: module.ProfileSettings, })), ); +const LazyUpdateUsername = lazy(() => + import('@pages/profile/profile').then(module => ({ + default: module.UpdateUsername, + })), +); + +const LazyUpdatePassword = lazy(() => + import('@pages/profile/profile').then(module => ({ + default: module.UpdatePassword, + })), +); + +const LazyHelp = lazy(() => + import('@pages/profile/help').then(module => ({default: module.Help})), +); + +const Help = () => { + return ( + + + + ); +}; + +const LazyAbout = lazy(() => + import('@pages/profile/about').then(module => ({default: module.About})), +); + +const About = () => { + return ( + + + + ); +}; + +const ProfileSettings = () => { + return ( + + + + ); +}; + +const UpdateUsername = () => { + return ( + + + + ); +}; + +const UpdatePassword = () => { + return ( + + + + ); +}; + export const ProfileTabName = 'Profile'; export type ProfileStackNavigatorParamList = { diff --git a/src/pages/event/EventPage.tsx b/src/pages/event/EventPage.tsx index 15acd35..353f56e 100644 --- a/src/pages/event/EventPage.tsx +++ b/src/pages/event/EventPage.tsx @@ -29,6 +29,23 @@ function EventPage({route}: {route: {params: {eventID: EventID}}}) { image = event.EventBannerPicture.lq; } + const imageUrl = + 'https://res.cloudinary.com/coin-nft/image/upload/c_limit,q_auto,w_329/f_auto/v1/cache/1/f2/65/f26573682335fe72b50f0f74041736905308345d6043abbac832856b3a4d2246-ZGMwNDMxZTktYTY4NS00OTQ1LWJiYmUtMDRhY2Q0YzUzMjAy?_a=ATCkFAA0'; + + useEffect(() => { + // Fetch the image dimensions and calculate the aspect ratio + Image.getSize( + imageUrl, + (width, height) => { + const calculatedAspectRatio = width / height; + setAspectRatio(calculatedAspectRatio); + }, + error => { + console.error('Error getting image size: ', error); + }, + ); + }, [imageUrl]); + return ( { @@ -36,7 +53,7 @@ function EventPage({route}: {route: {params: {eventID: EventID}}}) { {event.Name.data} Event banner