refresh 수정

This commit is contained in:
focp212@naver.com
2025-11-18 13:44:53 +09:00
parent 8e32512884
commit 194f7fe214
3 changed files with 43 additions and 8 deletions

View File

@@ -1,5 +1,3 @@
/* eslint-disable react-hooks/exhaustive-deps */
/* eslint-disable @cspell/spellchecker */
// import './main.scss';
import { JSX } from 'react/jsx-runtime';
import { DIRECTION } from './types';
@@ -209,7 +207,7 @@ export const PullToRefresh: React.FC<PullToRefreshProps> = ({
// pullDownRef.current!.style.opacity = (yDistanceMoved / 65).toString();
childrenRef.current!.style.overflow = 'visible';
childrenRef.current!.style.transform = `translate(0px, ${appr(yDistanceMoved)}px)`;
// pullDownRef.current!.style.visibility = 'visible';
pullDownRef.current!.style.visibility = 'visible';
};
const onEnd = (): void => {
@@ -235,11 +233,18 @@ export const PullToRefresh: React.FC<PullToRefreshProps> = ({
return (
<div className={`ptr ${className}`} style={{ backgroundColor }} ref={containerRef}>
{
/*
<div className="ptr__pull-down" ref={pullDownRef}>
<div className="ptr__loader ptr__pull-down--loading">{refreshingContent}</div>
<div
className="ptr__pull-down"
ref={pullDownRef}
style={{ position: 'absolute', width: '100%' }}
>
<div
className="ptr__loader ptr__pull-down--loading"
style={{ width: '100%', textAlign: 'center', position: 'relative'}}
>{refreshingContent}</div>
</div>
*/
}
<div className="ptr__children" ref={childrenRef}>
{children}

View File

@@ -4,7 +4,10 @@ import './refreshing-content.scss';
export const RefreshingContent = () => {
return (
<div className="lds-ellipsis">
<div
className="lds-ellipsis"
style={{margin: '0 auto'}}
>
<div></div>
<div></div>
<div></div>

View File

@@ -0,0 +1,27 @@
import { CSSProperties, useState } from 'react';
import { FadeLoader } from 'react-spinners';
const override: CSSProperties = {
position: 'fixed',
display: 'block',
margin: '0 auto',
top: '50%',
left: '50%',
zIndex: 2000
};
export const RefreshingLoading = () => {
let [loading, setLoading] = useState<boolean>(false);
let [color, setColor] = useState<string>('#0b0606');
return (
<>
<FadeLoader
color={color}
loading={loading}
cssOverride={override}
aria-label="Loading Spinner"
data-testid="loader"
/>
</>
);
};