From a804b741b8d13ba16ac7f19269bba5551ef19651 Mon Sep 17 00:00:00 2001 From: Miu Razvan Date: Sun, 11 Oct 2020 20:20:00 +0300 Subject: [PATCH] Updated Iframe --- src/components/manage/Blocks/Iframe/Edit.jsx | 16 ++++++++ src/components/manage/Blocks/Iframe/View.jsx | 42 +++++++++++++------- theme/site/globals/site.overrides | 11 +++-- 3 files changed, 50 insertions(+), 19 deletions(-) diff --git a/src/components/manage/Blocks/Iframe/Edit.jsx b/src/components/manage/Blocks/Iframe/Edit.jsx index 316bcfa..152734f 100644 --- a/src/components/manage/Blocks/Iframe/Edit.jsx +++ b/src/components/manage/Blocks/Iframe/Edit.jsx @@ -21,10 +21,26 @@ const getSchema = (props) => { title: 'Mobile url', type: 'text', }, + iframeId: { + title: 'Id', + type: 'text', + }, title: { title: 'Title', type: 'text', }, + titleClassName: { + title: 'Title classname', + type: 'text', + }, + description: { + title: 'Description', + widget: 'textarea', + }, + descriptionClassName: { + title: 'Description classname', + type: 'text', + }, width: { title: 'Width', type: 'text', diff --git a/src/components/manage/Blocks/Iframe/View.jsx b/src/components/manage/Blocks/Iframe/View.jsx index 066f564..2da2cb5 100644 --- a/src/components/manage/Blocks/Iframe/View.jsx +++ b/src/components/manage/Blocks/Iframe/View.jsx @@ -4,6 +4,7 @@ import { compose } from 'redux'; import { connect } from 'react-redux'; import Iframe from 'react-iframe'; import qs from 'query-string'; +import cx from 'classnames'; import './style.css'; const useWindowSize = () => { @@ -20,7 +21,6 @@ const useWindowSize = () => { }; const View = ({ content, ...props }) => { - let showIframe = true; const [discodataQuery, setDiscodataQuery] = useState({}); const [requiredQueries, setRequiredQueries] = useState([]); const [flags, setFlags] = useState({}); @@ -35,7 +35,11 @@ const View = ({ content, ...props }) => { desktopUrl = '', tabletUrl = '', mobileUrl = '', + iframeId = null, title = '', + titleClassName = '', + description = '', + descriptionClassName = '', width = '100%', height = 'auto', } = data; @@ -174,20 +178,28 @@ const View = ({ content, ...props }) => { {!flagsState && requiredQueries.length === requiredQueries.filter((query) => discodataQuery[query]).length ? ( -