-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
FalkWolsky
committed
Jul 26, 2024
1 parent
0b99e61
commit 38b391c
Showing
10 changed files
with
222 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
client/packages/lowcoder/src/comps/utils/supademoDisplay.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React, { useState } from 'react'; | ||
import { Modal, Button, Tooltip } from 'antd'; | ||
import { InfoCircleOutlined } from '@ant-design/icons'; | ||
import { trans } from 'i18n'; // Adjust this import according to your project's structure | ||
|
||
interface SupaDemoDisplayProps { | ||
url: string; | ||
modalWidth?: string; | ||
modalTop?: string; | ||
showText?: boolean; | ||
} | ||
|
||
const SupaDemoDisplay = ({ url, modalWidth = '75%', modalTop = '6%', showText = true }: SupaDemoDisplayProps) => { | ||
const [isOpen, setIsOpen] = useState(false); | ||
|
||
const handleOpen = () => { | ||
setIsOpen(true); | ||
}; | ||
|
||
const handleClose = () => { | ||
setIsOpen(false); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<Tooltip title={trans("editorTutorials.interactiveDemoToolTip")}> | ||
<Button type="primary" shape="circle" icon={<InfoCircleOutlined />} style={{ paddingTop: "5px" }} onClick={handleOpen} /> | ||
{ showText && <span style={{ marginLeft: 8 }} onClick={handleOpen}>{trans("editorTutorials.interactiveDemo")}</span> } | ||
</Tooltip> | ||
<Modal | ||
title={trans("editorTutorials.interactiveDemo")} | ||
open={isOpen} | ||
onCancel={handleClose} | ||
width={modalWidth} | ||
style={{ top: modalTop }} | ||
okButtonProps={{ style: { display: 'none' } }} | ||
cancelButtonProps={{ style: { display: 'none' } }} | ||
bodyStyle={{ padding: 0 }} | ||
> | ||
<div style={{ position: 'relative', boxSizing: 'content-box', maxHeight: '80vh', width: '100%', aspectRatio: '1.7712177121771218', padding: '40px 0' }}> | ||
<iframe | ||
src={url} | ||
loading="lazy" | ||
title="Temporary State Usage" | ||
allow="clipboard-write" | ||
frameBorder="0" | ||
allowFullScreen | ||
style={{ position: 'absolute', top: 0, left: 0, width: '100%', height: '100%' }} | ||
></iframe> | ||
</div> | ||
</Modal> | ||
</div> | ||
); | ||
}; | ||
|
||
export default SupaDemoDisplay; |
Oops, something went wrong.