@capytale/meta-player 0.1.4 → 0.1.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capytale/meta-player",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -1,4 +1,4 @@
1
- import { memo, useState } from "react";
1
+ import { memo, useMemo, useState } from "react";
2
2
  import styles from "./style.module.scss";
3
3
 
4
4
  import { Button } from "primereact/button";
@@ -17,6 +17,7 @@ const ActivityMenu: React.FC = memo(() => {
17
17
  const isFullscreen = useFullscreen(wantFullscreen, () =>
18
18
  setWantFullscreen(false),
19
19
  );
20
+ const isInIframe = useMemo(() => capytaleUI.isInCapytaletIframe(), []);
20
21
  const [helpDialogVisible, setHelpDialogVisible] = useState(false);
21
22
  const activityJS = useActivityJS();
22
23
  return (
@@ -46,18 +47,20 @@ const ActivityMenu: React.FC = memo(() => {
46
47
  }}
47
48
  onClick={() => setWantFullscreen((prev) => !prev)}
48
49
  />
49
- <Button
50
- severity="secondary"
51
- size="small"
52
- icon={"pi pi-times"}
53
- text
54
- tooltip="Retour à la liste des activités"
55
- tooltipOptions={{
56
- position: "left",
57
- showDelay: settings.TOOLTIP_SHOW_DELAY,
58
- }}
59
- onClick={() => capytaleUI.closeCapytaleIframe()}
60
- />
50
+ {isInIframe && (
51
+ <Button
52
+ severity="secondary"
53
+ size="small"
54
+ icon={"pi pi-times"}
55
+ text
56
+ tooltip="Retour à la liste des activités"
57
+ tooltipOptions={{
58
+ position: "left",
59
+ showDelay: settings.TOOLTIP_SHOW_DELAY,
60
+ }}
61
+ onClick={() => capytaleUI.closeCapytaleIframe()}
62
+ />
63
+ )}
61
64
  <Sidebar
62
65
  header="Paramètres"
63
66
  visible={settingsSidebarVisible}