-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Able to add multiple token into gallery
- Loading branch information
1 parent
35e47fc
commit 1f69a5b
Showing
9 changed files
with
299 additions
and
23 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
apps/mobile/src/components/NftSelector/NftSelectorSelectionIndicator.tsx
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,30 @@ | ||
import clsx from 'clsx'; | ||
import Animated, { useAnimatedStyle, withTiming } from 'react-native-reanimated'; | ||
import { CheckIcon } from 'src/icons/CheckIcon'; | ||
|
||
type Props = { | ||
selected: boolean; | ||
}; | ||
|
||
export function NftSelectorSelectionIndicator({ selected }: Props) { | ||
const animateStyle = useAnimatedStyle(() => { | ||
return { | ||
opacity: withTiming(selected ? 1 : 0), | ||
}; | ||
}); | ||
|
||
return ( | ||
<Animated.View | ||
className={clsx( | ||
'absolute top-1 right-1 h-3 w-3 rounded-full border border-white shadow flex items-center justify-center', | ||
selected ? 'bg-activeBlue' : 'bg-white/30' | ||
)} | ||
> | ||
{selected ? ( | ||
<Animated.View style={animateStyle}> | ||
<CheckIcon /> | ||
</Animated.View> | ||
) : null} | ||
</Animated.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Svg, { Path,SvgProps } from 'react-native-svg'; | ||
|
||
export function MultiSelectIcon(props: SvgProps) { | ||
return ( | ||
<Svg width={16} height={16} fill="none" {...props}> | ||
<Path stroke="#000" d="M13.667 2.332H5v8.667h8.667V2.332Z" /> | ||
<Path stroke="#000" d="M11 11v2.667H2.334V5H5" /> | ||
</Svg> | ||
); | ||
} |
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
41 changes: 41 additions & 0 deletions
41
apps/mobile/src/screens/GalleryScreen/GalleryEditorNftSelectorContractScreen.tsx
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,41 @@ | ||
import { RouteProp, useNavigation, useRoute } from '@react-navigation/native'; | ||
import { useCallback } from 'react'; | ||
import { graphql, useLazyLoadQuery } from 'react-relay'; | ||
|
||
import { NftSelectorContract } from '~/components/NftSelector/NftSelectorContract/NftSelectorContract'; | ||
import { GalleryEditorNftSelectorContractScreenQuery } from '~/generated/GalleryEditorNftSelectorContractScreenQuery.graphql'; | ||
import { RootStackNavigatorParamList, RootStackNavigatorProp } from '~/navigation/types'; | ||
|
||
export function GalleryEditorNftSelectorContractScreen() { | ||
const query = useLazyLoadQuery<GalleryEditorNftSelectorContractScreenQuery>( | ||
graphql` | ||
query GalleryEditorNftSelectorContractScreenQuery { | ||
...NftSelectorContractFragment | ||
} | ||
`, | ||
{} | ||
); | ||
|
||
const navigation = useNavigation<RootStackNavigatorProp>(); | ||
const route = | ||
useRoute<RouteProp<RootStackNavigatorParamList, 'NftSelectorContractGalleryEditor'>>(); | ||
|
||
const handleSelectNft = useCallback( | ||
(tokenId: string) => { | ||
navigation.navigate('PostComposer', { | ||
tokenId, | ||
}); | ||
}, | ||
[navigation] | ||
); | ||
|
||
return ( | ||
<NftSelectorContract | ||
contractAddress={route.params.contractAddress} | ||
onSelectNft={handleSelectNft} | ||
queryRef={query} | ||
isCreator={route.params.ownerFilter === 'Created'} | ||
isFullScreen | ||
/> | ||
); | ||
} |
Oops, something went wrong.