Skip to content

Commit

Permalink
update setToggle name
Browse files Browse the repository at this point in the history
Signed-off-by: huongg <[email protected]>
  • Loading branch information
Huongg committed Jun 5, 2024
1 parent 4c01960 commit 09648e6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/components/shareable-url-modal/main-view/main-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
KEDRO_VIZ_PUBLISH_DOCS_URL,
} from '../../../config';

const renderTextContent = (toggleValue, setTogleValue) => {
const renderTextContent = (isPreviewEnabled, setIsPreviewEnabled) => {
return (
<div className="shareable-url-modal__content-wrapper">
<div className="shareable-url-modal__content-title">
Expand Down Expand Up @@ -50,9 +50,9 @@ const renderTextContent = (toggleValue, setTogleValue) => {
All dataset previews
<Toggle
className="shareable-url-modal__content-toggle"
title={toggleValue ? 'On' : 'Off'}
checked={toggleValue}
onChange={() => setTogleValue((prev) => !prev)}
title={isPreviewEnabled ? 'On' : 'Off'}
checked={isPreviewEnabled}
onChange={() => setIsPreviewEnabled((prev) => !prev)}
/>
</div>
</div>
Expand All @@ -67,16 +67,16 @@ const MainView = ({
onPlatformChange,
onBuckNameChange,
onEndpointChange,
setTogleValue,
toggleValue,
setIsPreviewEnabled,
isPreviewEnabled,
visible,
}) => {
const { platform, bucket_name, endpoint } = inputValues || {};

return (
<>
<div className="shareable-url-modal__content-form-wrapper">
{renderTextContent(toggleValue, setTogleValue)}
{renderTextContent(isPreviewEnabled, setIsPreviewEnabled)}
<div className="shareable-url-modal__form-wrapper">
<p className="shareable-url-modal__form-wrapper-title">
Please enter the required information below.
Expand Down
4 changes: 2 additions & 2 deletions src/components/shareable-url-modal/shareable-url-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ const ShareableUrlModal = ({ onToggleModal, visible }) => {
}}
onBuckNameChange={(value) => onChange('bucket_name', value)}
onEndpointChange={(value) => onChange('endpoint', value)}
setTogleValue={setIsPreviewEnabled}
toggleValue={isPreviewEnabled}
setIsPreviewEnabled={setIsPreviewEnabled}
isPreviewEnabled={isPreviewEnabled}
visible={visible}
/>
)}
Expand Down

0 comments on commit 09648e6

Please sign in to comment.