Skip to content

Commit de8c107

Browse files
committed
#RIVS-304 - Auto refresh
1 parent ce5df8e commit de8c107

File tree

6 files changed

+12
-23
lines changed

6 files changed

+12
-23
lines changed

src/webviews/src/modules/key-details/components/list-details/ListDetails.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { PropsWithChildren, useState } from 'react'
1+
import React, { PropsWithChildren, useCallback, useState } from 'react'
22
import cx from 'classnames'
33
import * as l10n from '@vscode/l10n'
44

@@ -44,11 +44,11 @@ const ListDetails = (props: Props) => {
4444
setIsRemoveItemPanelOpen(true)
4545
}
4646

47-
const Actions = ({ children }: PropsWithChildren) => ([
47+
const Actions = useCallback(({ children }: PropsWithChildren) => ([
4848
children,
4949
<AddItemsAction key={1} title={l10n.t('Add Elements')} openAddItemPanel={openAddItemPanel} />,
5050
<RemoveItemsAction key={2} title={l10n.t('Remove Elements')} openRemoveItemPanel={openRemoveItemPanel} />,
51-
])
51+
]), [])
5252

5353
return (
5454
<div className="fluid flex-column relative">

src/webviews/src/modules/key-details/components/rejson-details/RejsonDetailsWrapper.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { sendEventTelemetry, TelemetryEvent, stringToBuffer } from 'uiSrc/utils'
66
import { KeyDetailsHeader, KeyDetailsHeaderProps } from 'uiSrc/modules'
77
import { KeyTypes } from 'uiSrc/constants'
88
import { useDatabasesStore, useSelectedKeyStore } from 'uiSrc/store'
9-
import { Spinner } from 'uiSrc/ui'
109

1110
import { IJSONData } from './interfaces'
1211
import { RejsonDetails } from './rejson-details'
@@ -91,8 +90,6 @@ const RejsonDetailsWrapper = (props: Props) => {
9190
data-testid="json-details"
9291
className={styles.container}
9392
>
94-
{loading && <div className={styles.keySpinner}><Spinner /></div>}
95-
9693
{!isUndefined(data) && (
9794
<RejsonDetails
9895
selectedKey={selectedKey || stringToBuffer('')}

src/webviews/src/modules/key-details/components/rejson-details/styles.module.scss

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,6 @@
149149
}
150150
}
151151

152-
.keySpinner {
153-
@apply absolute w-full;
154-
155-
span {
156-
@apply w-full #{!important};
157-
}
158-
}
159-
160152
.fullWidthTextArea {
161153
@apply h-[150px] w-full pb-[30px] max-w-none scroll-pb-5;
162154
}

src/webviews/src/modules/key-details/components/set-details/SetDetails.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { PropsWithChildren, useState } from 'react'
1+
import React, { PropsWithChildren, useCallback, useState } from 'react'
22
import cx from 'classnames'
33
import * as l10n from '@vscode/l10n'
44

@@ -54,10 +54,10 @@ export const SetDetails = (props: Props) => {
5454
addSetMembersAction(data, () => onSuccessAdded(data.members))
5555
}
5656

57-
const Actions = ({ children }: PropsWithChildren) => ([
57+
const Actions = useCallback(({ children }: PropsWithChildren) => ([
5858
children,
5959
<AddItemsAction key={1} title={l10n.t('Add Members')} openAddItemPanel={openAddItemPanel} />,
60-
])
60+
]), [])
6161

6262
return (
6363
<div className="fluid flex-column relative">

src/webviews/src/modules/key-details/components/string-details/StringDetails.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { PropsWithChildren, useEffect, useState } from 'react'
1+
import React, { PropsWithChildren, useCallback, useEffect, useState } from 'react'
22
import { useShallow } from 'zustand/react/shallow'
33
import * as l10n from '@vscode/l10n'
44

@@ -92,7 +92,7 @@ const StringDetails = (props: Props) => {
9292
})
9393
}
9494

95-
const Actions = ({ children }: PropsWithChildren) => ([
95+
const Actions = useCallback(({ children }: PropsWithChildren) => ([
9696
children,
9797
<EditItemAction
9898
key={1}
@@ -103,7 +103,7 @@ const StringDetails = (props: Props) => {
103103
setEditItem(!editItem)
104104
}}
105105
/>,
106-
])
106+
]), [])
107107

108108
return (
109109
<div className="fluid flex-column relative">

src/webviews/src/modules/key-details/components/zset-details/ZSetDetails.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { ReactNode, useState } from 'react'
1+
import React, { ReactNode, useCallback, useState } from 'react'
22
import cx from 'classnames'
33
import * as l10n from '@vscode/l10n'
44

@@ -52,10 +52,10 @@ const ZSetDetails = (props: Props) => {
5252
updateZSetMembersAction(data, true, () => onSuccessAdded(data.members))
5353
}
5454

55-
const Actions = ({ children }: { children: ReactNode }) => ([
55+
const Actions = useCallback(({ children }: { children: ReactNode }) => ([
5656
children,
5757
<AddItemsAction key={1} title={l10n.t('Add Members')} openAddItemPanel={openAddItemPanel} />,
58-
])
58+
]), [])
5959

6060
return (
6161
<div className="fluid flex-column relative">

0 commit comments

Comments
 (0)