mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 17:08:34 +00:00
This reverts commit f5d8424173.
This commit is contained in:
parent
10fc9635b9
commit
795c925b54
1 changed files with 26 additions and 38 deletions
|
|
@ -11,16 +11,7 @@ const VERTICAL_ALIGNMENT_VS_CSS_VALUE = {
|
|||
bottom: 'flex-end',
|
||||
};
|
||||
|
||||
export const Text = function Text({
|
||||
height,
|
||||
properties,
|
||||
fireEvent,
|
||||
styles,
|
||||
darkMode,
|
||||
setExposedVariable,
|
||||
dataCy,
|
||||
isEditorReady,
|
||||
}) {
|
||||
export const Text = function Text({ height, properties, fireEvent, styles, darkMode, setExposedVariable, dataCy }) {
|
||||
let {
|
||||
textSize,
|
||||
textColor,
|
||||
|
|
@ -57,43 +48,40 @@ export const Text = function Text({
|
|||
}, [properties.visibility, loadingState, disabledState]);
|
||||
|
||||
useEffect(() => {
|
||||
if (isEditorReady) {
|
||||
const text = computeText();
|
||||
const text = computeText();
|
||||
setText(text);
|
||||
setExposedVariable('text', text);
|
||||
|
||||
setExposedVariable('setText', async function (text) {
|
||||
setText(text);
|
||||
setExposedVariable('text', text);
|
||||
});
|
||||
setExposedVariable('clear', async function (text) {
|
||||
setText('');
|
||||
setExposedVariable('text', '');
|
||||
});
|
||||
setExposedVariable('isVisible', properties.visibility);
|
||||
setExposedVariable('isLoading', loadingState);
|
||||
setExposedVariable('isDisabled', disabledState);
|
||||
|
||||
setExposedVariable('setText', async function (text) {
|
||||
setText(text);
|
||||
setExposedVariable('text', text);
|
||||
});
|
||||
setExposedVariable('clear', async function (text) {
|
||||
setText('');
|
||||
setExposedVariable('text', '');
|
||||
});
|
||||
setExposedVariable('isVisible', properties.visibility);
|
||||
setExposedVariable('isLoading', loadingState);
|
||||
setExposedVariable('isDisabled', disabledState);
|
||||
setExposedVariable('visibility', async function (value) {
|
||||
setVisibility(value);
|
||||
});
|
||||
|
||||
setExposedVariable('visibility', async function (value) {
|
||||
setVisibility(value);
|
||||
});
|
||||
setExposedVariable('setVisibility', async function (value) {
|
||||
setVisibility(value);
|
||||
});
|
||||
|
||||
setExposedVariable('setVisibility', async function (value) {
|
||||
setVisibility(value);
|
||||
});
|
||||
setExposedVariable('setLoading', async function (value) {
|
||||
setLoading(value);
|
||||
});
|
||||
|
||||
setExposedVariable('setLoading', async function (value) {
|
||||
setLoading(value);
|
||||
});
|
||||
|
||||
setExposedVariable('setDisable', async function (value) {
|
||||
setIsDisabled(value);
|
||||
});
|
||||
}
|
||||
setExposedVariable('setDisable', async function (value) {
|
||||
setIsDisabled(value);
|
||||
});
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [
|
||||
isEditorReady,
|
||||
properties.text,
|
||||
setText,
|
||||
setVisibility,
|
||||
|
|
|
|||
Loading…
Reference in a new issue