Skip to content

Commit

Permalink
fix: consistent comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillzyusko committed Feb 14, 2024
1 parent 39a65a6 commit 62651a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,15 @@ import {createContext} from 'react';
import type PagerView from 'react-native-pager-view';
import type {SharedValue} from 'react-native-reanimated';

/**
* The pager items array is used within the pager to render and navigate between the images
*/
/** The pager items array is used within the pager to render and navigate between the images */
type AttachmentCarouselPagerItems = {
/** The source of the image is used to identify each attachment/page in the pager */
source: string;

/** The index of the pager item determines the order of the images in the pager */
index: number;

/**
* The active state of the pager item determines whether the image is currently transformable with pinch, pan and tap gestures
*/
/** The active state of the pager item determines whether the image is currently transformable with pinch, pan and tap gestures */
isActive: boolean;
};

Expand Down
20 changes: 6 additions & 14 deletions src/components/Attachments/AttachmentCarousel/Pager/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,16 @@ type Attachment = {
};

type AttachmentCarouselPagerProps = {
/**
* The attachments to be rendered in the pager.
*/
/** The attachments to be rendered in the pager. */
items: Attachment[];

/**
* The source (URL) of the currently active attachment.
*/
/** The source (URL) of the currently active attachment. */
activeSource: string;

/**
* The index of the initial page to be rendered.
*/
/** The index of the initial page to be rendered. */
initialPage: number;

/**
* A callback to be called when the page is changed.
*/
/** A callback to be called when the page is changed. */
onPageSelected: () => void;

/**
Expand Down Expand Up @@ -147,7 +139,7 @@ function AttachmentCarouselPager({items, activeSource, initialPage, onPageSelect
[],
);

const Content = useMemo(
const carouselItems = useMemo(
() =>
items.map((item, index) => (
<View
Expand Down Expand Up @@ -178,7 +170,7 @@ function AttachmentCarouselPager({items, activeSource, initialPage, onPageSelect
animatedProps={animatedProps}
ref={pagerRef}
>
{Content}
{carouselItems}
</AnimatedPagerView>
</AttachmentCarouselPagerContext.Provider>
);
Expand Down

0 comments on commit 62651a0

Please sign in to comment.