Skip to content

Commit

Permalink
Improve test, fix bug, add comments and others stuff (#471)
Browse files Browse the repository at this point in the history
* improve test and comments

* fix timestamp ui

* adding comment and format

* ui and ux fix stuff

* fmt

* fmt afk repo too

* start change ui feed

* fix default value sort

* fix package issue -- reused workspace

* add others state needed

* add comment and stuff for AA DAO

* fix and fmt
  • Loading branch information
MSghais authored Feb 8, 2025
1 parent f0164a2 commit 9d4d1aa
Show file tree
Hide file tree
Showing 36 changed files with 982 additions and 525 deletions.
4 changes: 2 additions & 2 deletions apps/data-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@
"fluent-ffmpeg": "^2.1.3",
"graphql": "^16.9.0",
"helmet": "^7.2.0",
"indexer-prisma": "^1.0.0",
"indexer-prisma": "workspace:*",
"jsonwebtoken": "^9.0.2",
"nodemailer": "^6.9.16",
"pg": "^8.13.1",
"pg-promise": "^11.10.1",
"prisma-db": "^1.0.0",
"prisma-db": "workspace:*",
"socket.io": "^4.8.1",
"stripe": "^17.3.1",
"telegraf": "^4.16.3",
Expand Down
3 changes: 3 additions & 0 deletions apps/data-backend/src/routes/indexer/deploy-launch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ async function deployLaunchRoute(fastify: FastifyInstance, options: RouteOptions
threshold_liquidity:true,
bonding_type:true,
total_token_holded:true,
block_timestamp:true,
},
});

Expand Down Expand Up @@ -65,6 +66,7 @@ async function deployLaunchRoute(fastify: FastifyInstance, options: RouteOptions
threshold_liquidity:true,
bonding_type:true,
total_token_holded:true,
block_timestamp:true,
},
});

Expand Down Expand Up @@ -105,6 +107,7 @@ async function deployLaunchRoute(fastify: FastifyInstance, options: RouteOptions
threshold_liquidity:true,
bonding_type:true,
total_token_holded:true,
block_timestamp:true,
},
});

Expand Down
21 changes: 17 additions & 4 deletions apps/mobile/src/app/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import {Search} from '../screens/Search';
import {Settings} from '../screens/Settings';
import {TagsView} from '../screens/Tags';
import {Tips} from '../screens/Tips';
import {Community} from '../screens/Community';
import {Wallet} from '../screens/Wallet';
import {WalletBTC} from '../screens/WalletBTC';
import {ThemedStyleSheet} from '../styles';
Expand Down Expand Up @@ -121,12 +122,12 @@ const HomeBottomTabNavigator: React.FC = () => {
/>

<HomeBottomTabsStack.Screen
name="Tips"
component={Tips}
name="Community"
component={Community}
options={{
tabBarActiveTintColor: 'white',
tabBarInactiveTintColor: 'grey',
tabBarIcon: ({focused}) => <TabBarIcon focused={focused} name="CoinIcon" />,
tabBarIcon: ({focused}) => <TabBarIcon focused={focused} name="CommunityIcon" />,
}}
/>

Expand All @@ -141,14 +142,24 @@ const HomeBottomTabNavigator: React.FC = () => {
/>

<HomeBottomTabsStack.Screen
name="Wallet"
component={Wallet}
options={{
tabBarActiveTintColor: 'white',
tabBarInactiveTintColor: theme.colors.background,
tabBarIcon: ({focused}) => <TabBarIcon focused={focused} name="WalletIcon" />,
}}
/>

{/* <HomeBottomTabsStack.Screen
name="Defi"
component={Defi}
options={{
tabBarActiveTintColor: 'white',
tabBarInactiveTintColor: theme.colors.background,
tabBarIcon: ({focused}) => <TabBarIcon focused={focused} name="WalletIcon" />,
}}
/>
/> */}

{publicKey ? (
<HomeBottomTabsStack.Screen
Expand Down Expand Up @@ -325,6 +336,7 @@ const MainNavigator: React.FC = () => {
<MainStack.Screen name="Launchpad" component={LaunchpadScreen} />
<MainStack.Screen name="Nameservice" component={NameserviceScreen} />
<MainStack.Screen name="ReceiveEcash" component={ReceiveEcash} />
<MainStack.Screen name="Community" component={Community} />
</MainStack.Navigator>
);
};
Expand Down Expand Up @@ -510,6 +522,7 @@ const linking = {
},
},
SocialPayment: 'SocialPayment',
Community: 'community',
},
},
},
Expand Down
18 changes: 18 additions & 0 deletions apps/mobile/src/assets/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -945,3 +945,21 @@ H176.182z"
/>
</Svg>
);

export const CommunityIcon: React.FC<SvgProps> = (props) => (
<Svg viewBox="0 0 24 24" fill="none" {...props}>
<Path
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"
fill="currentColor"
/>
</Svg>
);

export const GroupIcon: React.FC<SvgProps> = (props) => (
<Svg viewBox="0 0 24 24" fill="none" {...props}>
<Path
d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5s-3 1.34-3 3 1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"
fill="currentColor"
/>
</Svg>
);
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const TokenLaunchCard: React.FC<LaunchCoinProps> = ({
<View style={styles.header}>
{token?.created_at ? (
<Text style={styles.creationTime}>
{getElapsedTimeStringFull(new Date(token.created_at).getTime())}
{getElapsedTimeStringFull(new Date(token.block_timestamp).getTime())}
</Text>
) : null}
<Text style={styles.tokenName}>{token?.name || 'Unnamed Token'}</Text>
Expand Down
13 changes: 4 additions & 9 deletions apps/mobile/src/components/search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {Pressable, Text, TextInput, View} from 'react-native';
import Svg, {Path} from 'react-native-svg';

import {useStyles, useWindowDimensions} from '../../hooks';
import {SORT_OPTION_EVENT_NOSTR} from '../../types/nostr';
import {SORT_OPTION_EVENT_NOSTR, SORT_OPTIONS} from '../../types/nostr';
import FilterMenu from '../Filter';
import stylesheet from './styles';
import {Icon} from '../Icon';
Expand All @@ -20,12 +20,6 @@ interface ISearchComponent {
sortBy?: string;
}

const SORT_OPTIONS = [
{label: 'Recent', value: SORT_OPTION_EVENT_NOSTR.TIME},
{label: 'Trending', value: SORT_OPTION_EVENT_NOSTR.TRENDING},
{label: 'For You', value: SORT_OPTION_EVENT_NOSTR.FOR_YOU},
];

const SearchComponent: React.FC<ISearchComponent> = ({
searchQuery,
setSearchQuery,
Expand All @@ -38,7 +32,8 @@ const SearchComponent: React.FC<ISearchComponent> = ({
const styles = useStyles(stylesheet);
const [debouncedQuery, setDebouncedQuery] = useState(searchQuery);
const [isOpenFilter, setIsOpenFilter] = useState(false);
const [activeSortBy, setActiveSortBy] = useState<string>(sortBy ?? 'trending');
const [activeSortBy, setActiveSortBy] = useState<string>(sortBy ?? 'recent');
// const [activeSortBy, setActiveSortBy] = useState<string>(sortBy ?? 'trending');

const handleSortChange = (sortBy: string) => {
setActiveSortBy(sortBy);
Expand Down Expand Up @@ -79,7 +74,7 @@ const SearchComponent: React.FC<ISearchComponent> = ({
key={option.value}
style={[
styles.button,
activeSortBy.toLowerCase() === option.label.toLowerCase() && styles.activeButton,
activeSortBy?.toLowerCase() === option.label.toLowerCase() && styles.activeButton,
]}
onPress={() => handleSortChange(option.label)}
>
Expand Down
43 changes: 31 additions & 12 deletions apps/mobile/src/modules/Layout/sidebar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
// import { useAuth } from '../../../store/auth';
import {useAuth, useNostrContext} from 'afk_nostr_sdk';
import React, {useEffect, useMemo, useState} from 'react';
import {Image, Platform, Pressable, ScrollView, Text, View} from 'react-native';
import { useAuth, useNostrContext } from 'afk_nostr_sdk';
import React, { useEffect, useMemo, useState } from 'react';
import { Image, Platform, Pressable, ScrollView, Text, View } from 'react-native';

import {Icon} from '../../../components/Icon';
import {useStyles, useTheme, useWindowDimensions} from '../../../hooks';
import { Icon } from '../../../components/Icon';
import { useStyles, useTheme, useWindowDimensions } from '../../../hooks';
import stylesheet from './styles';

interface SidebarInterface {
// navigation:MainStackNavigationProps | DrawerNavigationHelpers
navigation: any;
}
const Sidebar = ({navigation}: SidebarInterface) => {
const Sidebar = ({ navigation }: SidebarInterface) => {
const styles = useStyles(stylesheet);
const publicKey = useAuth((state) => state.publicKey);
const ndk = useNostrContext();
// const navigation = useNavigation<MainStackNavigationProps>()
// const navigation = useNavigation<DrawerStackNavigationProps>()
const handleNavigateProfile = () => {
navigation.navigate('Profile', {publicKey});
navigation.navigate('Profile', { publicKey });
};

const handleAuth = () => {
Expand All @@ -45,6 +45,10 @@ const Sidebar = ({navigation}: SidebarInterface) => {
const handleTipsScreen = () => {
navigation.navigate('Tips');
};

const handleCommunityScreen = () => {
navigation.navigate('Community');
};
const handleStudioScreen = () => {
navigation.navigate('StreamStudio');
};
Expand Down Expand Up @@ -130,6 +134,21 @@ const Sidebar = ({navigation}: SidebarInterface) => {
</Pressable>

<Pressable
onPress={handleCommunityScreen}
onHoverIn={() => setHoveredKey('Community')}
onHoverOut={() => setHoveredKey('')}
style={[
isDesktop ? styles.itemDesktop : styles.itemMobile,
currentRouteKey?.includes('Community') || hoveredKey === 'Community'
? styles.activeItem
: styles.inactiveItem,
]}
>
<Icon name="CommunityIcon" size={isDesktop ? 30 : 25} />
<Text style={[isDesktop ? styles.textItemDesktop : styles.textItemMobile]}>Community</Text>
</Pressable>

{/* <Pressable
onPress={handleTipsScreen}
onHoverIn={() => setHoveredKey('Tips')}
onHoverOut={() => setHoveredKey('')}
Expand All @@ -142,7 +161,7 @@ const Sidebar = ({navigation}: SidebarInterface) => {
>
<Icon name="CoinIcon" size={isDesktop ? 30 : 25} />
<Text style={[isDesktop ? styles.textItemDesktop : styles.textItemMobile]}>Tips</Text>
</Pressable>
</Pressable> */}

<Pressable
onPress={handleGameScreen}
Expand All @@ -159,7 +178,7 @@ const Sidebar = ({navigation}: SidebarInterface) => {
<Text style={[isDesktop ? styles.textItemDesktop : styles.textItemMobile]}>?</Text>
</Pressable>

<Pressable
{/* <Pressable
onPress={handleDefiScreen}
onHoverIn={() => setHoveredKey('Defi')}
onHoverOut={() => setHoveredKey('')}
Expand All @@ -172,7 +191,7 @@ const Sidebar = ({navigation}: SidebarInterface) => {
>
<Icon name="CoinIcon" size={isDesktop ? 30 : 25} />
<Text style={[isDesktop ? styles.textItemDesktop : styles.textItemMobile]}>DeFi</Text>
</Pressable>
</Pressable> */}

<Pressable
onPress={handleWallet}
Expand Down Expand Up @@ -205,7 +224,7 @@ const Sidebar = ({navigation}: SidebarInterface) => {
<Text style={[isDesktop ? styles.textItemDesktop : styles.textItemMobile]}>Studio</Text>
</Pressable>
)}

{/*
<Pressable
onPress={handleSocialScreen}
onHoverIn={() => setHoveredKey('SocialPayment')}
Expand All @@ -219,7 +238,7 @@ const Sidebar = ({navigation}: SidebarInterface) => {
>
<Icon name="SunIcon" size={isDesktop ? 30 : 25} />
<Text style={[isDesktop ? styles.textItemDesktop : styles.textItemMobile]}>Socials</Text>
</Pressable>
</Pressable> */}

{publicKey && (
<Pressable
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/modules/Login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,11 @@ export const LoginNostrModule: React.FC<ILoginNostr> = ({
<Text>Nostr Extension</Text>
</View>
</Button>
<LoginStarknet
{/* <LoginStarknet
handleNavigation={() => navigationProps?.navigate('Feed')}
btnText={'Starknet Account'}
useCustomBtn
/>
/> */}
</View>
<Text style={styles.passwordLabel}>Password</Text>
<View style={styles.passwordInputContainer}>
Expand Down
Loading

0 comments on commit 9d4d1aa

Please sign in to comment.