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

feat(DIA-1064): add another works by artist tab on Infinite Discovery #11487

Merged

Conversation

araujobarret
Copy link
Contributor

@araujobarret araujobarret commented Feb 5, 2025

This PR resolves DIA-1064 DIA-1065 DIA-1066

Description

This PR wraps up most of the work of the bottom sheet in the infinite discovery:

  • Adds the other works from artists tab
  • reactors the bottom sheet to use the normal one instead of the modal
  • wraps some animations within the elements of the bottom sheet when expanding/collapsing
  • fixes some bugs of flickering screen when swiping the artworks

iOS

Simulator.Screen.Recording.-.iPhone.14.Pro.-.2025-02-05.at.10.16.14.mp4

PR Checklist

  • I have tested my changes on iOS and Android.
  • I hid my changes behind a feature flag, or they don't need one.
  • I have included screenshots or videos, or I have not changed the UI.
  • I have added tests, or my changes don't require any.
  • I added an app state migration, or my changes do not require one.
  • I have documented any follow-up work that this PR will require, or it does not require any.
  • I have added a changelog entry below, or my changes do not require one.

To the reviewers 👀

  • I would like at least one of the reviewers to run this PR on the simulator or device.
Changelog updates

Changelog updates

Cross-platform user-facing changes

  • feat: add another works by artist to infinite discovery

iOS user-facing changes

Android user-facing changes

Dev changes

Need help with something? Have a look at our docs, or get in touch with us.

@araujobarret araujobarret requested a review from a team February 5, 2025 09:59
@araujobarret araujobarret self-assigned this Feb 5, 2025
@araujobarret araujobarret changed the title Araujobarret/feat/bottom sheet tab and animations feat(DIA-1064): add another works by artist tab on Infinite Discovery Feb 5, 2025
@ArtsyOpenSource
Copy link
Contributor

ArtsyOpenSource commented Feb 5, 2025

This PR contains the following changes:

  • Cross-platform user-facing changes (feat: add another works by artist to infinite discovery - araujobarret)

Generated by 🚫 dangerJS against 1a09d3f

}) => {
const color = useColor()

// animated variables
const containerAnimatedStyle = useAnimatedStyle(() => {
"worklet"

if (appearsOnIndex === undefined || disappearsOnIndex === undefined) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extended the backdrop to be able to control the animation if wanted given appearing/disappearing properties

</LinkText>
</Text>
</Flex>
<ElementInView onVisible={handleOnVisible}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tried to compare the Sentinel vs ElementInView to see which one is simpler to read and understand and ended up picking ElementInView because it's simpler to read/understand

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, I didn't know about this component!

nickskalkin
nickskalkin previously approved these changes Feb 6, 2025
Copy link
Contributor

@nickskalkin nickskalkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, left a few questions

}

export const DefaultBottomSheetBackdrop: React.FC<DefaultBottomSheetBackdrop> = ({
animatedIndex,
onClose,
pressBehavior,
style,
appearsOnIndex,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: should we add a note what these options do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you think we should we can add, but that's from the original API https://gorhom.dev/react-native-bottom-sheet/components/bottomsheetbackdrop#appearsonindex

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah interesting, I thought this is our own thing. nevermind then

</LinkText>
</Text>
</Flex>
<ElementInView onVisible={handleOnVisible}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, I didn't know about this component!

import { useRecordViewArtwork } from "app/utils/mutations/useRecordArtworkView"
import { useState } from "react"

export const useSetArtworkAsRecentlyViewed = (artworkId?: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: why ? here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bc it might be undefined since we use it as a hook we can't conditionally call this hook if artworkId is present

@araujobarret araujobarret merged commit a9cf9b2 into main Feb 6, 2025
7 checks passed
@araujobarret araujobarret deleted the araujobarret/feat/bottom-sheet-tab-and-animations branch February 6, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants