File tree Expand file tree Collapse file tree 2 files changed +2
-14
lines changed
src/components/ChangelogDialog Expand file tree Collapse file tree 2 files changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ export function ChangelogDialog({
43
43
onClose,
44
44
onStoryClick,
45
45
onLinkClick,
46
- loading = true ,
46
+ loading,
47
47
} : ChangelogDialogProps ) {
48
48
const idRef = React . useRef < number > ( ) ;
49
49
idRef . current = idRef . current || getNextId ( ) ;
Original file line number Diff line number Diff line change 1
- import React , { useEffect } from 'react' ;
1
+ import React from 'react' ;
2
2
3
3
import { Button } from '@gravity-ui/uikit' ;
4
4
import type { Meta , StoryFn } from '@storybook/react' ;
@@ -79,22 +79,11 @@ const items: ChangelogItem[] = [
79
79
80
80
const DefaultTemplate : StoryFn < ChangelogDialogProps > = ( props : ChangelogDialogProps ) => {
81
81
const [ visible , setVisible ] = React . useState ( props . open ) ;
82
- const [ loading , setLoading ] = React . useState ( true ) ;
83
82
84
83
React . useEffect ( ( ) => {
85
84
setVisible ( props . open ) ;
86
85
} , [ props . open ] ) ;
87
86
88
- useEffect ( ( ) => {
89
- if ( ! visible ) return ;
90
- const timeoutId = setTimeout ( ( ) => setLoading ( false ) , 1000 ) ;
91
- // eslint-disable-next-line consistent-return
92
- return ( ) => {
93
- clearTimeout ( timeoutId ) ;
94
- setLoading ( true ) ;
95
- } ;
96
- } , [ visible ] ) ;
97
-
98
87
return (
99
88
< React . Fragment >
100
89
< div >
@@ -109,7 +98,6 @@ const DefaultTemplate: StoryFn<ChangelogDialogProps> = (props: ChangelogDialogPr
109
98
< ChangelogDialog
110
99
{ ...props }
111
100
open = { visible }
112
- loading = { loading }
113
101
onClose = { ( event , reason ) => {
114
102
setVisible ( false ) ;
115
103
props . onClose ?.( event , reason ) ;
You can’t perform that action at this time.
0 commit comments