Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
hyochan committed Feb 4, 2024
1 parent c190091 commit edd174b
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 61 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"lint:ci": "commitlint --from HEAD~0 --to HEAD --verbose",
"tsc": "tsc",
"start": "expo start",
"start:reset": "watchman watch-del-all && lsof -t -i :8081 | xargs kill && expo start-c",
"start:reset": "watchman watch-del-all && lsof -t -i :8081 | xargs kill && expo start -c",
"jest": "jest --runInBand",
"android": "expo start --android",
"ios": "expo start --ios",
Expand Down
26 changes: 13 additions & 13 deletions packages/CalendarCarousel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,16 @@ function CalendarCarousel({
data={dates}
horizontal
keyExtractor={(_, i) => `calendar-${i}`}
onScrollEndDrag={() => {
if (index !== 1) {
setCurrentDate(
index === 0
? subMonths(currentDate, 1)
: addMonths(currentDate, 1),
);
flatListRef.current?.scrollToIndex({index: 1, animated: false});
}
}}
onScrollToIndexFailed={() => {
const wait = new Promise((resolve) => setTimeout(resolve, 500));
wait.then(() => {
Expand All @@ -159,6 +169,7 @@ function CalendarCarousel({
ref={flatListRef}
renderItem={({item}) => (
<CalendarItem
dateObjects={item}
events={events}
onDatePress={(selectedDateObj) => {
onSelectDate?.(selectedDateObj.date);
Expand All @@ -169,26 +180,15 @@ function CalendarCarousel({
flatListRef.current?.scrollToIndex({index: 1, animated: false});
}
}}
dateObjects={item}
width={width}
renderDate={renderDate}
selectedDateObject={selectedDateObject}
showNextDates={showNextDates}
showPrevDates={showPrevDates}
renderDate={renderDate}
styles={styles?.date}
width={width}
/>
)}
scrollEventThrottle={16}
onScrollEndDrag={() => {
if (index !== 1) {
setCurrentDate(
index === 0
? subMonths(currentDate, 1)
: addMonths(currentDate, 1),
);
flatListRef.current?.scrollToIndex({index: 1, animated: false});
}
}}
// https://stackoverflow.com/a/60320726/8841562
showsHorizontalScrollIndicator={false}
viewabilityConfigCallbackPairs={viewabilityConfigCallbackPairs.current}
Expand Down
29 changes: 29 additions & 0 deletions stories/packages/PinchZoomStories/PinchZoom.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type {ComponentProps} from 'react';
import type {Meta, StoryObj} from '@storybook/react';

import {DoobooProvider} from '../../../main';
import type {PinchZoom} from '../../../packages/PinchZoom';

import Component from './PinchZoomImageListStory';

const meta = {
title: 'PinchZoom',
// @ts-ignore
component: Component,
argTypes: {},
decorators: [
(Story) => (
<DoobooProvider>
<Story />
</DoobooProvider>
),
],
} satisfies Meta<ComponentProps<typeof PinchZoom>>;

export default meta;

type Story = StoryObj<typeof meta>;

export const Basic: Story = {
args: {},
};
27 changes: 0 additions & 27 deletions stories/packages/PinchZoomStories/PinchZoomArticleStory.tsx

This file was deleted.

14 changes: 0 additions & 14 deletions stories/packages/PinchZoomStories/index.tsx

This file was deleted.

7 changes: 1 addition & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1947,7 +1947,7 @@
dependencies:
regenerator-runtime "^0.14.0"

"@babel/runtime@^7.12.0", "@babel/runtime@^7.13.10":
"@babel/runtime@^7.12.0", "@babel/runtime@^7.13.10", "@babel/runtime@^7.21.0":
version "7.23.9"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.9.tgz#47791a15e4603bb5f905bc0753801cf21d6345f7"
integrity sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw==
Expand Down Expand Up @@ -11103,11 +11103,6 @@ internal-slot@^1.0.5:
has "^1.0.3"
side-channel "^1.0.4"

intl@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/intl/-/intl-1.2.5.tgz#82244a2190c4e419f8371f5aa34daa3420e2abde"
integrity sha512-rK0KcPHeBFBcqsErKSpvZnrOmWOj+EmDkyJ57e90YWaQNqbcivcqmKDlHEeNprDWOsKzPsh1BfSpPQdDvclHVw==

invariant@^2.2.4:
version "2.2.4"
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
Expand Down

0 comments on commit edd174b

Please sign in to comment.