@nualang/nualang-ui-components 0.1.1385 → 0.1.1386
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Exercises/PhraseGroup/PhraseGroupGameOptions/PhraseGroupGame/PhraseGroupGame.js
CHANGED
|
@@ -168,10 +168,11 @@ function PhraseGroupGame({
|
|
|
168
168
|
const theme = useTheme();
|
|
169
169
|
const hasKeyboard = gameId === "translation";
|
|
170
170
|
const hasWordBank = gameId === "translation" || gameId === "listening";
|
|
171
|
-
const isDefinitionsDisabled = gameId
|
|
171
|
+
const isDefinitionsDisabled = gameId.includes("meaning") && isDefinitionsEmpty && !isPhrasesEmpty;
|
|
172
|
+
const isDefinitionsHidden = gameId.includes("meaning") && isDefinitionsEmpty && !isPhrasesEmpty && !isCreator;
|
|
172
173
|
const isDisabled = isPhrasesEmpty || isDefinitionsDisabled || isGameHidden && !isCreator;
|
|
173
174
|
const disabledTooltip = isPhrasesEmpty ? t("topic_no_phrases") : isDefinitionsDisabled ? t("meaning_no_definitions") : "";
|
|
174
|
-
return /*#__PURE__*/_jsx(Tooltip, {
|
|
175
|
+
return !isDefinitionsHidden && /*#__PURE__*/_jsx(Tooltip, {
|
|
175
176
|
title: disabledTooltip,
|
|
176
177
|
placement: "top",
|
|
177
178
|
children: /*#__PURE__*/_jsx("span", {
|
|
@@ -179,7 +180,7 @@ function PhraseGroupGame({
|
|
|
179
180
|
alignItems: "center",
|
|
180
181
|
disabled: isDisabled,
|
|
181
182
|
onClick: () => {
|
|
182
|
-
const canPlay = !
|
|
183
|
+
const canPlay = !isDisabled;
|
|
183
184
|
if (canPlay) {
|
|
184
185
|
handleSelectPhraseGroupGame(gameId);
|
|
185
186
|
}
|