Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PWA + Metadata + Sorting + UI + Backend indexer #512

Merged
merged 7 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion apps/mobile/src/app/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ import { Community } from '../screens/Community';
import { AuthStackParams, HomeBottomStackParams, MainStackParams, RootStackParams } from '../types';
import { initGoogleAnalytics, logPageView } from '../utils/analytics';
import { ScreenRecordStream } from '../modules/Studio/ScreenRecord';
import { DAOScreen } from '../screens/DAO';

type TabBarIconProps = {
focused: boolean;
Expand Down Expand Up @@ -343,6 +344,7 @@ const MainNavigator: React.FC = () => {
<MainStack.Screen name="Nameservice" component={NameserviceScreen} />
<MainStack.Screen name="ReceiveEcash" component={ReceiveEcash} />
<MainStack.Screen name="Community" component={Community} />
<MainStack.Screen name="DAO" component={DAOScreen} />

</MainStack.Navigator>
);
Expand Down Expand Up @@ -484,7 +486,14 @@ const linking = {
token: (token: string) => `${token}`,
},
},
Community: 'app/community'
Community: 'app/community',
DAO: 'app/dao',
// DAODetail: {
// path: 'app/dao/:daoId',
// parse: {
// daoId: (daoId: string) => `${daoId}`,
// },
// },
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/components/search/TokenCard/form-metadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,14 @@ export const FormMetadata: React.FC<LaunchCoinProps> = ({
</Pressable>
)}
</View>
<TouchableOpacity
{/* <TouchableOpacity
style={styles.uploadButton}
onPress={() => {
// Handle media upload
}}
>
<Text style={styles.uploadButtonText}>Upload Image/Video</Text>
</TouchableOpacity>
</TouchableOpacity> */}
</View>
</View>

Expand Down
56 changes: 1 addition & 55 deletions apps/mobile/src/components/search/TokenCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const TokenCard: React.FC<LaunchCoinProps> = ({


// console.log("token", token)
console.log("url metadata", token?.url)
// console.log("url metadata", token?.url)

return (
<View style={styles.container}>
Expand All @@ -123,60 +123,6 @@ export const TokenCard: React.FC<LaunchCoinProps> = ({
setIsModalVisibleProps={setIsModalVisible}
isButtonOpenVisible={true}
/>
// <Modal
// >
// <View>
// <View style={styles.modalContent}>
// <Text style={styles.modalTitle}>Add Token Metadata</Text>


// <View style={styles.formGroup}>
// <Text style={styles.label}>Description</Text>
// <TextInput
// style={[styles.input, styles.textArea]}
// placeholder="Nostr event id"
// multiline
// numberOfLines={4}
// value={metadata.nostr_event_id}
// onChangeText={(text) => setMetadata({ ...metadata, nostr_event_id: text })}
// />
// </View>

// <View style={styles.formGroup}>
// <Text style={styles.label}>Media</Text>
// <View style={styles.mediaUpload}>
// <TouchableOpacity
// style={styles.uploadButton}
// onPress={() => {
// // Handle media upload
// }}
// >
// <Text style={styles.uploadButtonText}>Upload Image/Video</Text>
// </TouchableOpacity>
// </View>
// </View>

// <View style={styles.buttonGroup}>
// <TouchableOpacity
// style={styles.cancelButton}
// onPress={() => setIsModalVisible(false)}
// >
// <Text style={styles.buttonText}>Cancel</Text>
// </TouchableOpacity>

// <TouchableOpacity
// style={styles.submitButton}
// onPress={() => {
// // Handle form submission
// // setIsModalVisible(false);
// }}
// >
// <Text style={styles.buttonText}>Submit</Text>
// </TouchableOpacity>
// </View>
// </View>
// </View>
// </Modal>
)}
<View
style={{
Expand Down
71 changes: 71 additions & 0 deletions apps/mobile/src/modules/DAO/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { useNavigation } from '@react-navigation/native';
import { useState } from 'react';
import { View, Text } from 'react-native';
import { useStyles, useTheme } from '../../hooks';
import { MainStackNavigationProps } from '../../types';
import { SelectedTab, TABS_COMMUNITY, TABS_TIP_LIST } from '../../types/tab';
import stylesheet from './styles';
import { Button, Input, Modal } from '../../components';

export const DAOComponent: React.FC = () => {
const styles = useStyles(stylesheet);
const theme = useTheme();
const navigation = useNavigation<MainStackNavigationProps>();
const [selectedTab, setSelectedTab] = useState<SelectedTab | undefined>(SelectedTab.ALL_GROUP);
const handleTabSelected = (tab: string | SelectedTab, screen?: string) => {
setSelectedTab(tab as any);
if (screen) {
navigation.navigate(screen as any);
}
};


const [isFormCreateDao, setIsFormCreateDao] = useState(false);
const handleFormCreateDao = () => {

setIsFormCreateDao(!isFormCreateDao);
// navigation.navigate('MainStack', { screen: 'CreateForm' });
}

const handleCallbackCreateDao = () => {

}
return (
<View style={styles.container}>

{isFormCreateDao && (
<View>
<Text style={styles.text}>Create DAO</Text>
<Modal
style={{ height: "90%" }}
// style={styles.modal}
>
<View>


<Input>
</Input>


<Button
onPress={handleCallbackCreateDao}
>
<Text>Create</Text>
</Button>
</View>
</Modal>
</View>
)}

<Text style={styles.text}>DAO coming soon</Text>


<Button
onPress={handleFormCreateDao}
>
<Text>Create DAO</Text>

</Button>
</View>
);
};
66 changes: 66 additions & 0 deletions apps/mobile/src/modules/DAO/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import {Spacing, ThemedStyleSheet} from '../../styles';

export default ThemedStyleSheet((theme) => ({
container: {
flex: 1,
backgroundColor: theme.colors.background,
paddingVertical: Spacing.xxxsmall,
paddingHorizontal: Spacing.normal,
},
text: {
color: theme.colors.text,
},

flatListContent: {
paddingHorizontal: Spacing.pagePadding,
paddingVertical: Spacing.medium,
},

separator: {
height: 1,
backgroundColor: theme.colors.divider,
},

tip: {
flexDirection: 'row',
justifyContent: 'space-between',
backgroundColor: theme.colors.surface,
padding: Spacing.xsmall,
borderRadius: 8,
gap: Spacing.xsmall,
},
tipInfo: {
gap: Spacing.xxsmall,
},
token: {
flex: 1,
flexDirection: 'row',
gap: Spacing.xsmall,
},

senderInfo: {
flex: 1,
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
gap: Spacing.medium,
},
sender: {
flex: 1,
},

buttonIndicator: {
marginRight: Spacing.xsmall,
},
createPostButton: {
position: 'absolute',
bottom: Spacing.large,
right: Spacing.pagePadding,
},
modal: {
// backgroundColor: theme.colors.background,
// padding: Spacing.normal,
// borderRadius: 8,
height: '100%',
},
}));
40 changes: 40 additions & 0 deletions apps/mobile/src/screens/DAO/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import {useState} from 'react';
import {KeyboardAvoidingView, ScrollView, Text, View} from 'react-native';
import {SafeAreaView} from 'react-native-safe-area-context';
import {TextButton} from '../../components';
import {useStyles, useTheme} from '../../hooks';
import { DAOScreenProps} from '../../types';
import {SelectedTab, TABS_CONSOLE} from '../../types/tab';
import stylesheet from './styles';
import { DAOComponent } from '../../modules/DAO';

export const DAOScreen: React.FC<DAOScreenProps> = ({navigation}) => {
const theme = useTheme();
const styles = useStyles(stylesheet);
const [selectedTab, setSelectedTab] = useState<SelectedTab | undefined>(
SelectedTab.LAUNCHPAD_VIEW,
);
const handleTabSelected = (tab: string | SelectedTab, screen?: string) => {
setSelectedTab(tab as any);
if (screen) {
navigation.navigate(screen as any);
}
};
return (
<View style={styles.container}>
<SafeAreaView edges={['top', 'left', 'right']} style={styles.header}>
<TextButton style={styles.cancelButton} onPress={navigation.goBack}>
Cancel
</TextButton>
</SafeAreaView>
<KeyboardAvoidingView behavior="padding" style={styles.content}>

<SafeAreaView edges={['bottom', 'left', 'right']} style={styles.viewContent}>
<ScrollView>
<DAOComponent />
</ScrollView>
</SafeAreaView>
</KeyboardAvoidingView>
</View>
);
};
76 changes: 76 additions & 0 deletions apps/mobile/src/screens/DAO/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// import {StyleSheet} from 'react-native';

import {Spacing, ThemedStyleSheet, Typography} from '../../styles';

export default ThemedStyleSheet((theme) => ({
container: {
flex: 1,
color: theme.colors.text,
backgroundColor: theme.colors.background,
},
header: {
flexDirection: 'row',
justifyContent: 'space-between',
backgroundColor: theme.colors.surface,
paddingHorizontal: Spacing.pagePadding,
// borderBottomWidth: StyleSheet.hairlineWidth,
// borderBottomColor: theme.colors.divider,
},
cancelButton: {
paddingVertical: Spacing.small,
paddingHorizontal: Spacing.xsmall,
},
content: {
flex: 1,
backgroundColor: theme.colors.background,
margin: Spacing.pagePadding,
// color: theme.colors.text,
},
viewContent: {
flex: 1,
backgroundColor: theme.colors.background,
marginTop: Spacing.pagePadding,
marginBottom: Spacing.pagePadding,
// color: theme.colors.text,
},
form: {
flex: 1,
},
input: {
flex: 1,
padding: Spacing.large,
color: theme.colors.inputText,
textAlignVertical: 'top',
fontSize: 16,
lineHeight: 24,
...Typography.medium,
},
imageContainer: {
padding: Spacing.pagePadding,
},
image: {
width: '100%',
resizeMode: 'cover',
borderRadius: 8,
overflow: 'hidden',
},

buttons: {
position: 'relative',
},
mediaButtons: {
flexDirection: 'row',
paddingHorizontal: Spacing.pagePadding,
paddingVertical: Spacing.small,
gap: Spacing.large,
alignItems: 'center',
},
sendButton: {
position: 'absolute',
right: Spacing.pagePadding,
bottom: '110%',
},
text: {
color: theme.colors.text,
},
}));
Loading
Loading