react-intl#FormattedHTMLMessage JavaScript Examples
The following examples show how to use
react-intl#FormattedHTMLMessage.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Tooltip.js From Edlib with GNU General Public License v3.0 | 6 votes |
render() {
let message = '';
if (this.props.message) {
message = this.props.message;
} else if (this.props.messageId) {
message = <FormattedHTMLMessage id={this.props.messageId}/>;
}
return (
<OverlayTrigger
placement="bottom"
overlay={
<ToolTip id="tooltip">
{message}
</ToolTip>
}
>
{this.props.children}
</OverlayTrigger>
);
}
Example #2
Source File: H5PQuizLayout.js From Edlib with GNU General Public License v3.0 | 5 votes |
H5PQuizLayout.defaultProps = {
cards: [],
backButtonText: <FormattedMessage id="H5PQUIZ.GO_BACK_TO_ORIGINAL_QUESTION_SET" />,
generateButtonText: <FormattedMessage id="H5PQUIZ.GENERATE_QUIZ" />,
infoText: <FormattedHTMLMessage id="H5PQUIZ.WE_HAVE_ADDED_SOME_WRONG_ALTERNATIVES" />,
processingForm: false,
};
Example #3
Source File: MillionaireLayout.js From Edlib with GNU General Public License v3.0 | 5 votes |
MillionaireLayout.defaultProps = {
cards: [],
backButtonText: <FormattedMessage id="MILLIONAIRE.GO_BACK_TO_ORIGINAL_QUESTION_SET" />,
generateButtonText: <FormattedMessage id="MILLIONAIRE.GENERATE_GAME" />,
infoText: <FormattedHTMLMessage id="MILLIONAIRE.WE_HAVE_ADDED_SOME_WRONG_ALTERNATIVES" />,
processingForm: false,
editMode: false,
};
Example #4
Source File: index.js From bank-client with MIT License | 5 votes |
export default function Privacy() {
return (
<StyledPrivacyWrapper>
<FormattedHTMLMessage {...messages.privacy} />
</StyledPrivacyWrapper>
);
}
Example #5
Source File: ContentUpgradeContainer.js From Edlib with GNU General Public License v3.0 | 4 votes |
ContentUpgradeContainer = ({
libraries = [],
intl,
onBeforeUpgrade,
onStageUpgrade,
initIframeEditor,
getIframeEditor,
}) => {
const translations = useMemo(() => {
const translations = getTranslations(intl);
translations.undoTextHTML = (<FormattedHTMLMessage id="H5PCONTENTUPGRADE.UNDO-TEXT" />);
return translations;
}, [intl]);
const [state, dispatch] = useReducer(store, null, () => {
return Object.assign({}, initialState, { libraries });
});
if (libraries.length === 0) {
return (
<ContentNoUpgrades
noUpgradeAvailable={translations.noUpgradesAvailable}
/>
);
}
const handleUpgradeReady = () => {
dispatch({ type: actions.readyForUpgrades, payload: true });
};
const handleStartUpgrade = event => {
dispatch({
type: actions.handleStartUpgrade,
payload: {
selectedVersion: event.target.value,
confirmationShow: true,
},
});
};
const handleToggleConfirmModal = () => {
dispatch({ type: actions.toggleConfirm });
};
const handleConfirmUpgrade = () => {
const _existingValues = onBeforeUpgrade();
dispatch({
type: actions.handleConfirm,
payload: {
originalParameters: _existingValues.params,
originalLibrary: _existingValues.library,
},
});
};
const handleUpgradeComplete = (contentParams) => {
onStageUpgrade(state.selectedVersion.name, contentParams);
dispatch({ type: actions.upgradeComplete });
};
const handleUndoUpgrade = () => {
onStageUpgrade(state.originalLibrary, state.originalParameters);
dispatch({ type: actions.undoUpgrade });
};
useEffect(() => {
initIframeEditor(handleUpgradeReady);
}, []);
useEffect(() => {
if (state.inProgress === true && state.percentComplete === 0) {
const iframeEditor = getIframeEditor();
const library = new iframeEditor.ContentType(state.originalLibrary);
const upgradeLibrary = iframeEditor.ContentType.getPossibleUpgrade(library, libraries.filter(library => state.selectedVersion.id === library.id));
iframeEditor.upgradeContent(library, upgradeLibrary, JSON.parse(state.originalParameters), (err, result) => {
if (err) {
// eslint-disable-next-line no-undef
onError(err);
} else {
handleUpgradeComplete(result);
}
});
}
}, [state]);
return (
<ContentUpgradeLayout
onClick={handleStartUpgrade}
libraries={libraries}
showConfirm={state.confirmationShow}
onConfirm={handleConfirmUpgrade}
upgradeComplete={state.upgradeComplete}
onToggleConfirm={handleToggleConfirmModal}
onUndoUpgrade={handleUndoUpgrade}
percentProgress={state.percentComplete}
inProgress={state.inProgress}
translations={translations}
readyForUpgrade={state.readyForUpgrade}
selectedLibraryId={state.libraryId}
/>
);
}