From 62651a0e00f53d536890489280bc29cc629218e9 Mon Sep 17 00:00:00 2001 From: kirillzyusko Date: Wed, 14 Feb 2024 14:13:37 +0100 Subject: [PATCH] fix: consistent comments --- .../Pager/AttachmentCarouselPagerContext.ts | 8 ++------ .../AttachmentCarousel/Pager/index.tsx | 20 ++++++------------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/src/components/Attachments/AttachmentCarousel/Pager/AttachmentCarouselPagerContext.ts b/src/components/Attachments/AttachmentCarousel/Pager/AttachmentCarouselPagerContext.ts index 1f4fb78f723b..fd9b57511cc4 100644 --- a/src/components/Attachments/AttachmentCarousel/Pager/AttachmentCarouselPagerContext.ts +++ b/src/components/Attachments/AttachmentCarousel/Pager/AttachmentCarouselPagerContext.ts @@ -3,9 +3,7 @@ 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; @@ -13,9 +11,7 @@ type AttachmentCarouselPagerItems = { /** 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; }; diff --git a/src/components/Attachments/AttachmentCarousel/Pager/index.tsx b/src/components/Attachments/AttachmentCarousel/Pager/index.tsx index 99ac7c18fefb..7e5612238609 100644 --- a/src/components/Attachments/AttachmentCarousel/Pager/index.tsx +++ b/src/components/Attachments/AttachmentCarousel/Pager/index.tsx @@ -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; /** @@ -147,7 +139,7 @@ function AttachmentCarouselPager({items, activeSource, initialPage, onPageSelect [], ); - const Content = useMemo( + const carouselItems = useMemo( () => items.map((item, index) => ( - {Content} + {carouselItems} );