-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/TERITORI/teritori-dapp into…
… feat/social-feed-update-ai
- Loading branch information
Showing
8 changed files
with
125 additions
and
81 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React, { FC } from "react"; | ||
import { StyleProp, View, ViewStyle } from "react-native"; | ||
|
||
import { useNameSearch } from "../../hooks/search/useNameSearch"; | ||
import { useSelectedNetworkId } from "../../hooks/useSelectedNetwork"; | ||
import { layout } from "../../utils/style/layout"; | ||
import { AvatarWithName } from "../user/AvatarWithName"; | ||
|
||
// Used as a wrapper on a TextInput or something like. It allows to search a name in TNS and returns the address. | ||
export const SearchNSInputContainer: FC<{ | ||
searchText: string; | ||
onPressName: (userId: string) => void; | ||
style?: StyleProp<ViewStyle>; | ||
}> = ({ searchText, onPressName, style, children }) => { | ||
const selectedNetworkId = useSelectedNetworkId(); | ||
const { names } = useNameSearch({ | ||
networkId: selectedNetworkId, | ||
input: searchText, | ||
limit: 12, | ||
}); | ||
const hasNames = !!names.length; | ||
|
||
return ( | ||
<> | ||
{children} | ||
{hasNames && ( | ||
<View | ||
style={[ | ||
{ | ||
flexDirection: "row", | ||
flexWrap: "wrap", | ||
marginTop: layout.padding_x1_5, | ||
}, | ||
style, | ||
]} | ||
> | ||
{names.map((n) => ( | ||
<AvatarWithName | ||
key={n} | ||
networkId={selectedNetworkId} | ||
name={n} | ||
onPress={(userId) => onPressName(userId)} | ||
style={{ marginRight: layout.padding_x1 }} | ||
/> | ||
))} | ||
</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
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 |
---|---|---|
@@ -1,30 +1,32 @@ | ||
import React from "react"; | ||
import { Linking, TouchableOpacity } from "react-native"; | ||
import { Linking, TextStyle, TouchableOpacity } from "react-native"; | ||
import { CreditCardIcon } from "react-native-heroicons/outline"; | ||
|
||
import { primaryColor } from "../../utils/style/colors"; | ||
import { fontBold16 } from "../../utils/style/fonts"; | ||
import { layout } from "../../utils/style/layout"; | ||
import { BrandText } from "../BrandText"; | ||
|
||
export const BuyTokens: React.FC = () => { | ||
export const BuyTokens: React.FC<{ | ||
flexDirection: "row" | "column"; | ||
textStyle: TextStyle; | ||
}> = ({ flexDirection, textStyle }) => { | ||
return ( | ||
<TouchableOpacity | ||
style={{ | ||
justifyContent: "center", | ||
alignItems: "center", | ||
marginBottom: layout.padding_x1, | ||
flexDirection: "row", | ||
flexDirection, | ||
}} | ||
onPress={() => { | ||
Linking.openURL("https://frontier.osmosis.zone/?from=OSMO&to=TORI"); | ||
}} | ||
> | ||
<CreditCardIcon | ||
color={primaryColor} | ||
style={{ marginRight: layout.padding_x1 }} | ||
style={{ marginRight: flexDirection === "row" ? layout.padding_x1 : 0 }} | ||
/> | ||
<BrandText style={fontBold16}>Buy Tokens</BrandText> | ||
<BrandText style={textStyle}>Buy Tokens</BrandText> | ||
</TouchableOpacity> | ||
); | ||
}; |
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
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