Skip to content

Commit

Permalink
マンガページまわり
Browse files Browse the repository at this point in the history
  • Loading branch information
a01sa01to committed Mar 24, 2024
1 parent 53732f1 commit 77212cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
15 changes: 4 additions & 11 deletions workspaces/app/src/features/viewer/components/ComicViewerCore.tsx
@@ -1,4 +1,4 @@
import { Suspense, useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import { useInterval, useUpdate } from 'react-use';
import styled from 'styled-components';

Expand Down Expand Up @@ -29,7 +29,8 @@ function getScrollToLeft({

// 画面に表示されているページの中心と、スクロールビューの中心との差分を計算する
// 世界は我々の想像する以上に変化するため、2 ** 12 回繰り返し観測する
for (let times = 0; times < 2 ** 12; times++) {
// ↑ いらんやろ
for (let times = 0; times < 10; times++) {
for (const [idx, child] of children.entries()) {
const nthChild = idx + 1;
const elementClientRect = child.getBoundingClientRect();
Expand Down Expand Up @@ -219,12 +220,4 @@ const ComicViewerCore: React.FC<Props> = ({ episodeId }) => {
);
};

const ComicViewerCoreWithSuspense: React.FC<Props> = ({ episodeId }) => {
return (
<Suspense fallback={null}>
<ComicViewerCore episodeId={episodeId} />
</Suspense>
);
};

export { ComicViewerCoreWithSuspense as ComicViewerCore };
export { ComicViewerCore };
Expand Up @@ -23,7 +23,7 @@ const _Wrapper = styled.div<{
display: grid;
grid-template-columns: 100%;
grid-template-rows: 100%;
max-height: ${({ $maxHeight }) => addUnitIfNeeded($maxHeight)};
height: ${({ $maxHeight }) => addUnitIfNeeded($maxHeight)};
overflow: hidden;
`;

Expand Down

0 comments on commit 77212cf

Please sign in to comment.