@capytale/meta-player 0.7.2 → 0.7.3

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.7.2",
3
+ "version": "0.7.3",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -4,15 +4,26 @@ import {
4
4
  ActivitySettingsOptionsDisplay,
5
5
  } from "./ui";
6
6
  import { useActivitySettingsStore } from "./store";
7
+ import { useAppSelector } from "../../app/hooks";
8
+ import { selectMode } from "../activityData/activityDataSlice";
7
9
 
8
10
  type ActivitySettingsDisplayProps = {};
9
11
 
10
12
  export function ActivitySettingsDisplay({}: ActivitySettingsDisplayProps) {
11
13
  const settings = useActivitySettingsStore((state) => state.settings);
14
+ const mode = useAppSelector(selectMode) as
15
+ | "assignment"
16
+ | "create"
17
+ | "review"
18
+ | "view"
19
+ | null;
12
20
  if (!settings) return null;
13
21
  return (
14
22
  <div>
15
23
  {settings.map((section, i) => {
24
+ if (mode && section.modes && !section.modes.includes(mode)) {
25
+ return null;
26
+ }
16
27
  return (
17
28
  <Fieldset
18
29
  key={`section-${i}`}
@@ -2,4 +2,7 @@
2
2
  }
3
3
  .formGroup {
4
4
  margin-bottom: 1rem;
5
+ display: flex;
6
+ flex-direction: column;
7
+ gap: 0.3rem;
5
8
  }
@@ -92,6 +92,7 @@ export type ActivitySettingsSection = (
92
92
  | ActivitySettingsFormSection
93
93
  ) & {
94
94
  title: string;
95
+ modes?: ("assignment" | "create" | "review" | "view")[];
95
96
  };
96
97
 
97
98
  export type ActivitySettings = ActivitySettingsSection[];