-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ui + embed + drawer * drawer fixed + stack + ui * card slink + cairo fmt * launch basic create token + ui
- Loading branch information
Showing
44 changed files
with
1,793 additions
and
409 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import {NDKEvent, NDKUserProfile} from '@nostr-dev-kit/ndk'; | ||
import {useNavigation} from '@react-navigation/native'; | ||
import {Image, ImageSourcePropType, Pressable, View} from 'react-native'; | ||
|
||
// import {useProfile} from '../../hooks'; | ||
import {MainStackNavigationProps} from '../../types'; | ||
import {Text} from '../Text'; | ||
import styles from './styles'; | ||
import {useProfile} from "afk_nostr_sdk" | ||
|
||
export type StoryProps = { | ||
imageProps?: ImageSourcePropType; | ||
name?: string; | ||
event: NDKEvent; | ||
profileProps?: NDKUserProfile; | ||
}; | ||
|
||
export const BubbleLive: React.FC<StoryProps> = ({imageProps, name, profileProps, event}) => { | ||
const {data: profile} = useProfile({publicKey: event?.pubkey}); | ||
const navigation = useNavigation<MainStackNavigationProps>(); | ||
const handleNavigateToProfile = () => { | ||
if (!event?.id) return; | ||
navigation.navigate('Profile', {publicKey: event?.pubkey}); | ||
}; | ||
return ( | ||
<View style={styles.container}> | ||
<Pressable onPress={handleNavigateToProfile}> | ||
<View style={styles.imageContainer}> | ||
{/* <Image source={profile?.cover ? { uri: profile?.cover } : require('../../../assets/feed/images/story-bg.png')} resizeMode="cover" /> */} | ||
<Image | ||
source={ | ||
profile?.cover ? profile?.cover : require('../../../assets/feed/images/story-bg.png') | ||
} | ||
resizeMode="cover" | ||
/> | ||
<Image | ||
style={styles.image} | ||
source={profile?.image ? profile?.image : require('../../assets/degen-logo.png')} | ||
// resizeMode="cover" | ||
/> | ||
</View> | ||
|
||
<Text weight="medium" fontSize={13} style={styles.name}> | ||
{profile?.name ?? profile?.nip05 ?? profile?.displayName ?? 'Anon AFK'} | ||
</Text> | ||
</Pressable> | ||
</View> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import {StyleSheet} from 'react-native'; | ||
import {Spacing} from '../../styles'; | ||
|
||
export default StyleSheet.create({ | ||
container: { | ||
alignItems: 'center', | ||
// width: 100, // Set a fixed width for each item | ||
// height: 100, // Set a fixed height for each item | ||
// justifyContent: 'center', | ||
// // alignItems: 'center', | ||
// marginHorizontal: 10, | ||
// backgroundColor: '#ddd', | ||
}, | ||
|
||
imageContainer: { | ||
position: 'relative', | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
borderRadius:15 | ||
}, | ||
image: { | ||
position: 'absolute', | ||
width: 35, | ||
height: 35, | ||
borderRadius:15 | ||
}, | ||
|
||
name: { | ||
paddingTop: Spacing.xxsmall, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react'; | ||
import { Platform, StyleSheet, View } from 'react-native'; | ||
import WebView from 'react-native-webview'; | ||
|
||
interface EmbedWebsiteInterface { | ||
uri?: string | ||
} | ||
const EmbedWebsite = ({ uri }: EmbedWebsiteInterface) => { | ||
|
||
const isWeb = Platform.OS == "web" | ||
|
||
if (isWeb) { | ||
return <iframe src={uri} | ||
height={"100%"} | ||
></iframe> | ||
} | ||
return ( | ||
<View style={styles.container}> | ||
<WebView | ||
source={{ uri: uri ?? 'https://example.com' }} // Replace 'https://example.com' with your desired URL | ||
style={{ flex: 1 }} | ||
/> | ||
</View> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
}, | ||
}); | ||
|
||
export default EmbedWebsite; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import React, { useState } from 'react'; | ||
import { Platform, StyleSheet, View, Text, Pressable, Image } from 'react-native'; | ||
import WebView from 'react-native-webview'; | ||
import { Button } from '../Button'; | ||
import EmbedWebsite from './EmbedWebsite'; | ||
import stylesheet from "./styles" | ||
import { useStyles } from '../../hooks'; | ||
import { Link } from '@react-navigation/native'; | ||
import * as Linking from 'expo-linking'; | ||
import { Avatar } from '../Avatar'; | ||
|
||
interface EmbedWebsiteInterface { | ||
uri?: string | ||
title?: string; | ||
twitter?: string; | ||
description?: string; | ||
img?: string; | ||
} | ||
const EmbedCard = ({ uri, title, twitter, description, img }: EmbedWebsiteInterface) => { | ||
const [isOpen, setIsOpen] = useState<boolean>(false) | ||
const styles = useStyles(stylesheet) | ||
const handleOpen = () => { | ||
setIsOpen(!isOpen) | ||
} | ||
|
||
const handleGoTo = () => { | ||
if(uri) { | ||
Linking.openURL(uri) | ||
} | ||
} | ||
return ( | ||
|
||
<View style={styles.container}> | ||
|
||
{img && | ||
<Image | ||
src={ | ||
img ?? require('../../assets/degen-logo.png') | ||
} | ||
/> | ||
} | ||
|
||
|
||
{title && | ||
<Text style={styles.text}>{title}</Text> | ||
} | ||
|
||
{description && | ||
<Text style={styles.text}>{description}</Text> | ||
} | ||
|
||
|
||
|
||
<View style={{ | ||
flex:1, | ||
flexDirection:"row" | ||
}}> | ||
{/* <Button onPress={handleGoTo} >Go</Button> */} | ||
<Button onPress={handleOpen}>Open</Button> | ||
</View> | ||
|
||
|
||
{isOpen && | ||
<View style={{ height: 350 }}> | ||
<EmbedWebsite uri={uri}></EmbedWebsite> | ||
</View> | ||
} | ||
|
||
|
||
</View> | ||
) | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
}, | ||
}); | ||
|
||
export default EmbedCard; |
Oops, something went wrong.