Skip to content

feat: bottom sheet component #45

Open
loido wants to merge 12 commits intodevelopfrom
feat/bottom_sheet
Open

feat: bottom sheet component #45
loido wants to merge 12 commits intodevelopfrom
feat/bottom_sheet

Conversation

@loido
Copy link
Copy Markdown
Contributor

@loido loido commented Sep 22, 2023

Summary

Features

Bugs

Check List

  • Your code builds clean without any errors or warnings.
  • Check coding convention.
  • Updated Storybook components and stories to reflect any changes made to the UI.
  • Test covers all edge cases and coverage is greater than or equal to 80%.

Proof of Completeness

Screenshot changes introduced

OR Video link IOS
Screen.Recording.2023-09-25.at.10.26.49.mov

ANDROID

Screen.Recording.2023-09-25.at.10.28.16.mov

position: 'absolute',
}))

const BottomSheetComponent = (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Where is type for Props

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it's here

image

Comment on lines +195 to +198
// containerHeight={_providedContainerHeight}
// containerOffset={animatedContainerOffset}
// topInset={topInset}
// bottomInset={bottomInset}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please refactor to remove those unused comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this component isn't final and that comment is helpful for the next update

return animatedContainerTranslateY.value - animatedKeyboardHeight.value
}, [])

// const animatedSnapPoints = useNormalizedSnapPoints(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same as above

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

same as above


return (
<>
<Button text="wefiowejfi" onPress={() => ref?.current?.open?.()} />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I know the text wefiowejfi is just dummy text to display storybook but can we change the text for more clearly and and relate to bottom sheet?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oke, updated

detached,
style,
children,
}: BottomSheetContainerProps) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please change to use this config instead because we already agreed on it
const Component: React.FC<ComponentProps> = ({}) => {}

import {View, Text} from 'react-native'
import React from 'react'

const BottomSheetContent = () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need this one? If not please remove it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, we do

"styled-components": "^5.3.9",
"react-native-gesture-handler": "^2.9.0",
"react-native-reanimated": "^3.0.2",
"react-native-reanimated": "3.0.2",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why we need react-native-reanimated as a dev dependencies?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

same below

component: BottomSheet,
} as ComponentMeta<typeof BottomSheet>

export const Basic: ComponentStory<typeof BottomSheet> = args => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please use rest instead of args

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated

"react-native": "0.71.4",
"react-native-builder-bob": "^0.20.4",
"react-native-gesture-handler": "^2.13.1",
"react-native-reanimated": "^3.5.4",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why we need this lib in dev dependencies?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

because i'll get an error 'not found lib'. if i don't add 2 libs in dev

[animatedIsVisible, handleClose, handleOpen],
)

useImperativeHandle(ref, () => contextValues)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why we need export contextValues?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

because we can use this context inside and we can custom component outside

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't get what you mean. can you give some example?

padding: theme?.sizes?.petite,
}))

const BottomSheetContentComponent: React.FC<BottomSheetContentProps> = ({style, children}) => (
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why we need BottomSheetContentComponent? Can we use direct Container?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

because BottomSheetContent only show content. BottomSheetContentContainer has calculate content height

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I mean Container not BottomSheetContentContainer. because the implement for BottomSheetContentComponent just render the Container

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

okay we will talk about it at meeting


return (
<Container style={style}>
<Title style={animatedTitleStyle} numberOfLines={1}>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Title use the Text component

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Text component it's not support animated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what is animation you apply for this title?

import type {ViewStyle} from 'react-native'
import type {BottomSheetContextType} from './contexts/BottomSheetProvider'

export interface BottomSheetProps {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There are lots of type you put inside the component so why this type you create new file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

because a type file it's help us clean code in that component

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should make it consistent. All the component that we already implemented don't have type.ts

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated


return (
<Container style={style}>
<Title style={animatedTitleStyle} numberOfLines={1}>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what is animation you apply for this title?

[animatedIsVisible, handleClose, handleOpen],
)

useImperativeHandle(ref, () => contextValues)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't get what you mean. can you give some example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants