-
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.
Add contract nft selector to gallery editor
- Loading branch information
1 parent
23cf5ec
commit b8d1465
Showing
7 changed files
with
251 additions
and
39 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
65 changes: 65 additions & 0 deletions
65
apps/mobile/src/components/NftSelector/NftSelectorContract/NftSelectorContractToolbar.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,65 @@ | ||
import { useCallback } from 'react'; | ||
import { View } from 'react-native'; | ||
import { contexts } from 'shared/analytics/constants'; | ||
import { MultiSelectIcon } from 'src/icons/MultiSelectIcon'; | ||
|
||
import { AnimatedRefreshIcon } from '~/components/AnimatedRefreshIcon'; | ||
import { GalleryTouchableOpacity } from '~/components/GalleryTouchableOpacity'; | ||
import { IconContainer } from '~/components/IconContainer'; | ||
import { BaseM } from '~/components/Text'; | ||
|
||
type Props = { | ||
contractName: string; | ||
isMultiselectMode: boolean; | ||
setIsMultiselectMode: (value: boolean) => void; | ||
onSelectedAllPress: () => void; | ||
hasSelectedItems: boolean; | ||
}; | ||
|
||
export function NftSelectorContractToolbar({ | ||
contractName, | ||
isMultiselectMode, | ||
setIsMultiselectMode, | ||
onSelectedAllPress, | ||
hasSelectedItems, | ||
}: Props) { | ||
const handleMultiselectPress = useCallback(() => { | ||
setIsMultiselectMode?.(!isMultiselectMode); | ||
}, [isMultiselectMode, setIsMultiselectMode]); | ||
|
||
return ( | ||
<View className="flex-row justify-between px-4 pt-4"> | ||
<BaseM weight="Bold">{contractName}</BaseM> | ||
|
||
<View className="flex-row space-x-2 items-center"> | ||
<GalleryTouchableOpacity | ||
onPress={onSelectedAllPress} | ||
eventElementId={null} | ||
eventName={null} | ||
eventContext={null} | ||
> | ||
<BaseM weight="Bold" classNameOverride="text-shadow"> | ||
{hasSelectedItems ? 'Deselect All' : 'Select All'} | ||
</BaseM> | ||
</GalleryTouchableOpacity> | ||
<IconContainer | ||
size="sm" | ||
onPress={handleMultiselectPress} | ||
icon={<MultiSelectIcon />} | ||
eventElementId="NftSelectorSelectorSettingsButton" | ||
eventName="NftSelectorSelectorSettingsButton pressed" | ||
eventContext={contexts.Posts} | ||
color={isMultiselectMode ? 'active' : 'default'} | ||
/> | ||
<AnimatedRefreshIcon | ||
// onSync={handleSync} | ||
// isSyncing={ownershipTypeFilter === 'Collected' ? isSyncing : isSyncingCreatedTokens} | ||
onSync={() => {}} | ||
isSyncing={false} | ||
eventElementId="NftSelectorSelectorRefreshButton" | ||
eventName="NftSelectorSelectorRefreshButton pressed" | ||
/> | ||
</View> | ||
</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
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
Oops, something went wrong.