@capytale/meta-player 0.8.2 → 0.8.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/.prettierrc.json +4 -4
- package/LICENSE +674 -674
- package/README.md +12 -12
- package/eslint.config.js +28 -28
- package/index.html +15 -15
- package/package.json +60 -60
- package/public/themes/lara-dark-blue/theme.css +7015 -7015
- package/public/themes/lara-light-blue/theme.css +7005 -7005
- package/src/App.tsx +139 -139
- package/src/AppRedux.css +39 -39
- package/src/MetaPlayer.tsx +170 -170
- package/src/activityJs.ts +7 -7
- package/src/app/createAppSlice.ts +6 -6
- package/src/app/hooks.ts +12 -12
- package/src/app/store.ts +52 -52
- package/src/app.module.scss +80 -80
- package/src/demo.tsx +87 -87
- package/src/external/prime.ts +5 -5
- package/src/features/activityData/ExitWarning.ts +28 -28
- package/src/features/activityData/IsAntiCheatExitDetectionDisabledSetter.tsx +19 -19
- package/src/features/activityData/IsDirtySetter.tsx +17 -17
- package/src/features/activityData/MetaPlayerOptionsSetter.tsx +41 -41
- package/src/features/activityData/activityDataSlice.ts +256 -256
- package/src/features/activityData/activityJsData.ts +82 -82
- package/src/features/activityData/hooks.ts +34 -34
- package/src/features/activityData/metaPlayerOptions.ts +23 -23
- package/src/features/activityData/uiState.ts +20 -20
- package/src/features/activityJS/ActivityJSProvider.tsx +339 -339
- package/src/features/activityJS/AfterResetAction.tsx +23 -23
- package/src/features/activityJS/AfterSaveAction.tsx +23 -23
- package/src/features/activityJS/BeforeResetAction.tsx +23 -23
- package/src/features/activityJS/BeforeSaveAction.tsx +23 -23
- package/src/features/activityJS/Saver.tsx +167 -167
- package/src/features/activityJS/hooks.ts +85 -85
- package/src/features/activityJS/internal-hooks.ts +96 -96
- package/src/features/activityJS/saverSlice.ts +96 -96
- package/src/features/activitySettings/ActivitySettingsSetter.tsx +21 -21
- package/src/features/activitySettings/hooks.ts +12 -12
- package/src/features/activitySettings/index.tsx +43 -43
- package/src/features/activitySettings/store.ts +108 -108
- package/src/features/activitySettings/style.module.scss +8 -8
- package/src/features/activitySettings/types.ts +140 -140
- package/src/features/activitySettings/ui.tsx +299 -299
- package/src/features/functionalities/AttachedFilesFunctionality.ts +23 -23
- package/src/features/functionalities/PreviewDialog.tsx +83 -83
- package/src/features/functionalities/functionalitiesSlice.ts +98 -98
- package/src/features/functionalities/hooks.ts +70 -70
- package/src/features/layout/hooks.ts +7 -7
- package/src/features/layout/layoutSlice.ts +90 -90
- package/src/features/navbar/activity-info/index.tsx +54 -54
- package/src/features/navbar/activity-info/style.module.scss +38 -38
- package/src/features/navbar/activity-menu/ActivityQuickActions.tsx +57 -57
- package/src/features/navbar/activity-menu/index.tsx +154 -153
- package/src/features/navbar/activity-menu/style.module.scss +7 -7
- package/src/features/navbar/capytale-menu/CloneDialog.tsx +75 -75
- package/src/features/navbar/capytale-menu/Countdown.tsx +312 -312
- package/src/features/navbar/capytale-menu/CountdownAndSaveButton.tsx +115 -115
- package/src/features/navbar/capytale-menu/index.tsx +260 -260
- package/src/features/navbar/capytale-menu/style.module.scss +8 -8
- package/src/features/navbar/index.tsx +39 -39
- package/src/features/navbar/navbarSlice.ts +79 -79
- package/src/features/navbar/review-navbar/GradingNav.tsx +128 -128
- package/src/features/navbar/review-navbar/index.tsx +18 -18
- package/src/features/navbar/review-navbar/style.module.scss +22 -22
- package/src/features/navbar/sidebars/ActivitySidebarActions.tsx +57 -57
- package/src/features/navbar/sidebars/AttachedFilesSidebarContent.module.scss +43 -43
- package/src/features/navbar/sidebars/AttachedFilesSidebarContent.tsx +181 -181
- package/src/features/navbar/sidebars/SettingsSidebarContent.tsx +192 -192
- package/src/features/navbar/sidebars/style.module.scss +15 -15
- package/src/features/navbar/student-utils.ts +11 -11
- package/src/features/navbar/style.module.scss +65 -65
- package/src/features/pedago/InstructionsEditor.tsx +102 -102
- package/src/features/pedago/PdfEditor.tsx +91 -91
- package/src/features/pedago/PedagoCommands.tsx +353 -353
- package/src/features/pedago/SharedNotesEditor.tsx +144 -144
- package/src/features/pedago/index.tsx +207 -204
- package/src/features/pedago/style.module.scss +233 -233
- package/src/features/theming/ThemeSwitcher.tsx +51 -51
- package/src/features/theming/hooks.ts +6 -6
- package/src/features/theming/themingSlice.ts +93 -93
- package/src/features/toast.tsx +38 -38
- package/src/hooks/index.ts +16 -16
- package/src/index.css +132 -132
- package/src/index.ts +90 -90
- package/src/logo.svg +1 -1
- package/src/my_json_data.js +4146 -4146
- package/src/settings.ts +6 -6
- package/src/types.ts +9 -9
- package/src/utils/ButtonDoubleIcon.tsx +35 -35
- package/src/utils/CardSelector.tsx +41 -41
- package/src/utils/ErrorBoundary.tsx +41 -41
- package/src/utils/PopupButton.tsx +134 -134
- package/src/utils/activity.ts +8 -8
- package/src/utils/breakpoints.ts +4 -4
- package/src/utils/capytale.ts +10 -10
- package/src/utils/clipboard.ts +11 -11
- package/src/utils/download.ts +7 -7
- package/src/utils/equality.ts +32 -32
- package/src/utils/server-clock.ts +42 -42
- package/src/utils/style.module.scss +45 -45
- package/src/utils/useFullscreen.ts +65 -65
- package/src/vite-env.d.ts +1 -1
- package/tsconfig.json +28 -28
- package/tsconfig.node.json +9 -9
- package/vite.config.ts +11 -11
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
import type { PayloadAction } from "@reduxjs/toolkit";
|
|
2
|
-
import { createAppSlice } from "../../app/createAppSlice";
|
|
3
|
-
|
|
4
|
-
export type Orientation = "horizontal" | "vertical";
|
|
5
|
-
|
|
6
|
-
export type PedagoTab = "instructions" | "sharedNotes" | "pdf";
|
|
7
|
-
|
|
8
|
-
export interface LayoutState {
|
|
9
|
-
orientation: Orientation;
|
|
10
|
-
isPedagoVisible: boolean;
|
|
11
|
-
isGradingVisible: boolean;
|
|
12
|
-
pedagoTab: PedagoTab;
|
|
13
|
-
showWorkflow: boolean;
|
|
14
|
-
showSaveForStudents: boolean;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const initialState: LayoutState = {
|
|
18
|
-
orientation: "horizontal",
|
|
19
|
-
isPedagoVisible: true,
|
|
20
|
-
isGradingVisible: true,
|
|
21
|
-
pedagoTab: "instructions",
|
|
22
|
-
showWorkflow: true,
|
|
23
|
-
showSaveForStudents: true,
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
// If you are not using async thunks you can use the standalone `createSlice`.
|
|
27
|
-
export const layoutSlice = createAppSlice({
|
|
28
|
-
name: "layout",
|
|
29
|
-
// `createSlice` will infer the state type from the `initialState` argument
|
|
30
|
-
initialState,
|
|
31
|
-
// The `reducers` field lets us define reducers and generate associated actions
|
|
32
|
-
reducers: (create) => ({
|
|
33
|
-
toggleLayout: create.reducer((state) => {
|
|
34
|
-
// Redux Toolkit allows us to write "mutating" logic in reducers. It
|
|
35
|
-
// doesn't actually mutate the state because it uses the Immer library,
|
|
36
|
-
// which detects changes to a "draft state" and produces a brand new
|
|
37
|
-
// immutable state based off those changes
|
|
38
|
-
state.orientation =
|
|
39
|
-
state.orientation === "horizontal" ? "vertical" : "horizontal";
|
|
40
|
-
}),
|
|
41
|
-
// Use the `PayloadAction` type to declare the contents of `action.payload`
|
|
42
|
-
setLayout: create.reducer((state, action: PayloadAction<Orientation>) => {
|
|
43
|
-
state.orientation = action.payload;
|
|
44
|
-
}),
|
|
45
|
-
toggleIsPedagoVisible: create.reducer((state) => {
|
|
46
|
-
state.isPedagoVisible = !state.isPedagoVisible;
|
|
47
|
-
}),
|
|
48
|
-
setIsGradingVisible: create.reducer(
|
|
49
|
-
(state, action: PayloadAction<boolean>) => {
|
|
50
|
-
state.isGradingVisible = action.payload;
|
|
51
|
-
},
|
|
52
|
-
),
|
|
53
|
-
toggleIsGradingVisible: create.reducer((state) => {
|
|
54
|
-
state.isGradingVisible = !state.isGradingVisible;
|
|
55
|
-
}),
|
|
56
|
-
setPedagoTab: create.reducer((state, action: PayloadAction<PedagoTab>) => {
|
|
57
|
-
state.pedagoTab = action.payload;
|
|
58
|
-
}),
|
|
59
|
-
}),
|
|
60
|
-
// You can define your selectors here. These selectors receive the slice
|
|
61
|
-
// state as their first argument.
|
|
62
|
-
selectors: {
|
|
63
|
-
selectOrientation: (layout) => layout.orientation,
|
|
64
|
-
selectIsPedagoVisible: (layout) => layout.isPedagoVisible,
|
|
65
|
-
selectIsGradingVisible: (layout) => layout.isGradingVisible,
|
|
66
|
-
selectPedagoTab: (layout) => layout.pedagoTab,
|
|
67
|
-
selectShowWorkflow: (layout) => layout.showWorkflow,
|
|
68
|
-
selectShowSaveForStudents: (layout) => layout.showSaveForStudents,
|
|
69
|
-
},
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
// Action creators are generated for each case reducer function.
|
|
73
|
-
export const {
|
|
74
|
-
toggleLayout,
|
|
75
|
-
setLayout,
|
|
76
|
-
toggleIsPedagoVisible,
|
|
77
|
-
setIsGradingVisible,
|
|
78
|
-
toggleIsGradingVisible,
|
|
79
|
-
setPedagoTab,
|
|
80
|
-
} = layoutSlice.actions;
|
|
81
|
-
|
|
82
|
-
// Selectors returned by `slice.selectors` take the root state as their first argument.
|
|
83
|
-
export const {
|
|
84
|
-
selectOrientation,
|
|
85
|
-
selectIsPedagoVisible,
|
|
86
|
-
selectIsGradingVisible,
|
|
87
|
-
selectPedagoTab,
|
|
88
|
-
selectShowWorkflow,
|
|
89
|
-
selectShowSaveForStudents,
|
|
90
|
-
} = layoutSlice.selectors;
|
|
1
|
+
import type { PayloadAction } from "@reduxjs/toolkit";
|
|
2
|
+
import { createAppSlice } from "../../app/createAppSlice";
|
|
3
|
+
|
|
4
|
+
export type Orientation = "horizontal" | "vertical";
|
|
5
|
+
|
|
6
|
+
export type PedagoTab = "instructions" | "sharedNotes" | "pdf";
|
|
7
|
+
|
|
8
|
+
export interface LayoutState {
|
|
9
|
+
orientation: Orientation;
|
|
10
|
+
isPedagoVisible: boolean;
|
|
11
|
+
isGradingVisible: boolean;
|
|
12
|
+
pedagoTab: PedagoTab;
|
|
13
|
+
showWorkflow: boolean;
|
|
14
|
+
showSaveForStudents: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const initialState: LayoutState = {
|
|
18
|
+
orientation: "horizontal",
|
|
19
|
+
isPedagoVisible: true,
|
|
20
|
+
isGradingVisible: true,
|
|
21
|
+
pedagoTab: "instructions",
|
|
22
|
+
showWorkflow: true,
|
|
23
|
+
showSaveForStudents: true,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// If you are not using async thunks you can use the standalone `createSlice`.
|
|
27
|
+
export const layoutSlice = createAppSlice({
|
|
28
|
+
name: "layout",
|
|
29
|
+
// `createSlice` will infer the state type from the `initialState` argument
|
|
30
|
+
initialState,
|
|
31
|
+
// The `reducers` field lets us define reducers and generate associated actions
|
|
32
|
+
reducers: (create) => ({
|
|
33
|
+
toggleLayout: create.reducer((state) => {
|
|
34
|
+
// Redux Toolkit allows us to write "mutating" logic in reducers. It
|
|
35
|
+
// doesn't actually mutate the state because it uses the Immer library,
|
|
36
|
+
// which detects changes to a "draft state" and produces a brand new
|
|
37
|
+
// immutable state based off those changes
|
|
38
|
+
state.orientation =
|
|
39
|
+
state.orientation === "horizontal" ? "vertical" : "horizontal";
|
|
40
|
+
}),
|
|
41
|
+
// Use the `PayloadAction` type to declare the contents of `action.payload`
|
|
42
|
+
setLayout: create.reducer((state, action: PayloadAction<Orientation>) => {
|
|
43
|
+
state.orientation = action.payload;
|
|
44
|
+
}),
|
|
45
|
+
toggleIsPedagoVisible: create.reducer((state) => {
|
|
46
|
+
state.isPedagoVisible = !state.isPedagoVisible;
|
|
47
|
+
}),
|
|
48
|
+
setIsGradingVisible: create.reducer(
|
|
49
|
+
(state, action: PayloadAction<boolean>) => {
|
|
50
|
+
state.isGradingVisible = action.payload;
|
|
51
|
+
},
|
|
52
|
+
),
|
|
53
|
+
toggleIsGradingVisible: create.reducer((state) => {
|
|
54
|
+
state.isGradingVisible = !state.isGradingVisible;
|
|
55
|
+
}),
|
|
56
|
+
setPedagoTab: create.reducer((state, action: PayloadAction<PedagoTab>) => {
|
|
57
|
+
state.pedagoTab = action.payload;
|
|
58
|
+
}),
|
|
59
|
+
}),
|
|
60
|
+
// You can define your selectors here. These selectors receive the slice
|
|
61
|
+
// state as their first argument.
|
|
62
|
+
selectors: {
|
|
63
|
+
selectOrientation: (layout) => layout.orientation,
|
|
64
|
+
selectIsPedagoVisible: (layout) => layout.isPedagoVisible,
|
|
65
|
+
selectIsGradingVisible: (layout) => layout.isGradingVisible,
|
|
66
|
+
selectPedagoTab: (layout) => layout.pedagoTab,
|
|
67
|
+
selectShowWorkflow: (layout) => layout.showWorkflow,
|
|
68
|
+
selectShowSaveForStudents: (layout) => layout.showSaveForStudents,
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// Action creators are generated for each case reducer function.
|
|
73
|
+
export const {
|
|
74
|
+
toggleLayout,
|
|
75
|
+
setLayout,
|
|
76
|
+
toggleIsPedagoVisible,
|
|
77
|
+
setIsGradingVisible,
|
|
78
|
+
toggleIsGradingVisible,
|
|
79
|
+
setPedagoTab,
|
|
80
|
+
} = layoutSlice.actions;
|
|
81
|
+
|
|
82
|
+
// Selectors returned by `slice.selectors` take the root state as their first argument.
|
|
83
|
+
export const {
|
|
84
|
+
selectOrientation,
|
|
85
|
+
selectIsPedagoVisible,
|
|
86
|
+
selectIsGradingVisible,
|
|
87
|
+
selectPedagoTab,
|
|
88
|
+
selectShowWorkflow,
|
|
89
|
+
selectShowSaveForStudents,
|
|
90
|
+
} = layoutSlice.selectors;
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { useAppSelector } from "../../../app/hooks";
|
|
2
|
-
import {
|
|
3
|
-
selectActivityInfo,
|
|
4
|
-
selectIcon,
|
|
5
|
-
selectMode,
|
|
6
|
-
} from "../../activityData/activityDataSlice";
|
|
7
|
-
import { studentNameFromInfo } from "../student-utils";
|
|
8
|
-
import styles from "./style.module.scss";
|
|
9
|
-
|
|
10
|
-
const ActivityInfo: React.FC = () => {
|
|
11
|
-
const icon = useAppSelector(selectIcon);
|
|
12
|
-
const mode = useAppSelector(selectMode);
|
|
13
|
-
const activityInfo = useAppSelector(selectActivityInfo);
|
|
14
|
-
const studentName = studentNameFromInfo(activityInfo.studentInfo);
|
|
15
|
-
return (
|
|
16
|
-
<div className={styles.activityInfo}>
|
|
17
|
-
<div className={styles.activityInfoText}>
|
|
18
|
-
<div
|
|
19
|
-
className={styles.activityInfoTitle}
|
|
20
|
-
aria-label="Titre de l'activité"
|
|
21
|
-
>
|
|
22
|
-
{activityInfo.title}
|
|
23
|
-
</div>
|
|
24
|
-
{mode === "assignment" && studentName && (
|
|
25
|
-
<div
|
|
26
|
-
className={styles.activityInfoStudentName}
|
|
27
|
-
aria-label="Nom de l'élève"
|
|
28
|
-
>
|
|
29
|
-
{studentName}
|
|
30
|
-
</div>
|
|
31
|
-
)}
|
|
32
|
-
{mode === "create" && (
|
|
33
|
-
<div className={styles.activityInfoStudentName} aria-label="Mode">
|
|
34
|
-
Création d'activité
|
|
35
|
-
</div>
|
|
36
|
-
)}
|
|
37
|
-
</div>
|
|
38
|
-
{icon?.path && (
|
|
39
|
-
<img
|
|
40
|
-
className={styles.activityLogo}
|
|
41
|
-
aria-label="Logo de l'activité"
|
|
42
|
-
src={icon.path}
|
|
43
|
-
style={{
|
|
44
|
-
backgroundColor: icon.style
|
|
45
|
-
? icon.style["background-color"] || "white"
|
|
46
|
-
: "white",
|
|
47
|
-
}}
|
|
48
|
-
/>
|
|
49
|
-
)}
|
|
50
|
-
</div>
|
|
51
|
-
);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export default ActivityInfo;
|
|
1
|
+
import { useAppSelector } from "../../../app/hooks";
|
|
2
|
+
import {
|
|
3
|
+
selectActivityInfo,
|
|
4
|
+
selectIcon,
|
|
5
|
+
selectMode,
|
|
6
|
+
} from "../../activityData/activityDataSlice";
|
|
7
|
+
import { studentNameFromInfo } from "../student-utils";
|
|
8
|
+
import styles from "./style.module.scss";
|
|
9
|
+
|
|
10
|
+
const ActivityInfo: React.FC = () => {
|
|
11
|
+
const icon = useAppSelector(selectIcon);
|
|
12
|
+
const mode = useAppSelector(selectMode);
|
|
13
|
+
const activityInfo = useAppSelector(selectActivityInfo);
|
|
14
|
+
const studentName = studentNameFromInfo(activityInfo.studentInfo);
|
|
15
|
+
return (
|
|
16
|
+
<div className={styles.activityInfo}>
|
|
17
|
+
<div className={styles.activityInfoText}>
|
|
18
|
+
<div
|
|
19
|
+
className={styles.activityInfoTitle}
|
|
20
|
+
aria-label="Titre de l'activité"
|
|
21
|
+
>
|
|
22
|
+
{activityInfo.title}
|
|
23
|
+
</div>
|
|
24
|
+
{mode === "assignment" && studentName && (
|
|
25
|
+
<div
|
|
26
|
+
className={styles.activityInfoStudentName}
|
|
27
|
+
aria-label="Nom de l'élève"
|
|
28
|
+
>
|
|
29
|
+
{studentName}
|
|
30
|
+
</div>
|
|
31
|
+
)}
|
|
32
|
+
{mode === "create" && (
|
|
33
|
+
<div className={styles.activityInfoStudentName} aria-label="Mode">
|
|
34
|
+
Création d'activité
|
|
35
|
+
</div>
|
|
36
|
+
)}
|
|
37
|
+
</div>
|
|
38
|
+
{icon?.path && (
|
|
39
|
+
<img
|
|
40
|
+
className={styles.activityLogo}
|
|
41
|
+
aria-label="Logo de l'activité"
|
|
42
|
+
src={icon.path}
|
|
43
|
+
style={{
|
|
44
|
+
backgroundColor: icon.style
|
|
45
|
+
? icon.style["background-color"] || "white"
|
|
46
|
+
: "white",
|
|
47
|
+
}}
|
|
48
|
+
/>
|
|
49
|
+
)}
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default ActivityInfo;
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
.activityInfo {
|
|
2
|
-
flex-shrink: 1 !important;
|
|
3
|
-
flex-grow: 1;
|
|
4
|
-
display: flex;
|
|
5
|
-
justify-content: center;
|
|
6
|
-
align-items: center;
|
|
7
|
-
overflow: hidden;
|
|
8
|
-
gap: 12px;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.activityInfoText {
|
|
12
|
-
display: flex;
|
|
13
|
-
flex-direction: column;
|
|
14
|
-
justify-content: center;
|
|
15
|
-
align-items: center;
|
|
16
|
-
overflow: hidden;
|
|
17
|
-
& > * {
|
|
18
|
-
overflow: hidden;
|
|
19
|
-
text-overflow: ellipsis;
|
|
20
|
-
white-space: nowrap;
|
|
21
|
-
max-width: 100%;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.activityInfoTitle {
|
|
26
|
-
font-size: 20px;
|
|
27
|
-
font-weight: 500;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.activityLogo {
|
|
31
|
-
width: 35px;
|
|
32
|
-
height: 37px;
|
|
33
|
-
border-radius: 6px;
|
|
34
|
-
flex-shrink: 0;
|
|
35
|
-
@media only screen and (max-width: 992px) {
|
|
36
|
-
display: none;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
1
|
+
.activityInfo {
|
|
2
|
+
flex-shrink: 1 !important;
|
|
3
|
+
flex-grow: 1;
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
align-items: center;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
gap: 12px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.activityInfoText {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
align-items: center;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
& > * {
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
text-overflow: ellipsis;
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
max-width: 100%;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.activityInfoTitle {
|
|
26
|
+
font-size: 20px;
|
|
27
|
+
font-weight: 500;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.activityLogo {
|
|
31
|
+
width: 35px;
|
|
32
|
+
height: 37px;
|
|
33
|
+
border-radius: 6px;
|
|
34
|
+
flex-shrink: 0;
|
|
35
|
+
@media only screen and (max-width: 992px) {
|
|
36
|
+
display: none;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import { FC, useEffect } from "react";
|
|
2
|
-
import { useAppDispatch, useAppSelector } from "../../../app/hooks";
|
|
3
|
-
import {
|
|
4
|
-
QuickAction,
|
|
5
|
-
selectQuickActions,
|
|
6
|
-
setQuickActions,
|
|
7
|
-
usePerformQuickAction,
|
|
8
|
-
} from "../navbarSlice";
|
|
9
|
-
import { Button } from "primereact/button";
|
|
10
|
-
import settings from "../../../settings";
|
|
11
|
-
|
|
12
|
-
const ActivityQuickActions: FC<{}> = () => {
|
|
13
|
-
const quickActions = useAppSelector(selectQuickActions);
|
|
14
|
-
const performQuickAction = usePerformQuickAction();
|
|
15
|
-
return (
|
|
16
|
-
<>
|
|
17
|
-
{quickActions.map((action) => (
|
|
18
|
-
<Button
|
|
19
|
-
aria-label={action.title}
|
|
20
|
-
key={action.title}
|
|
21
|
-
severity="secondary"
|
|
22
|
-
size="small"
|
|
23
|
-
icon={action.icon}
|
|
24
|
-
onClick={() => {
|
|
25
|
-
performQuickAction(action);
|
|
26
|
-
}}
|
|
27
|
-
outlined
|
|
28
|
-
tooltip={action.title}
|
|
29
|
-
tooltipOptions={{
|
|
30
|
-
position: "bottom",
|
|
31
|
-
showDelay: settings.TOOLTIP_SHOW_DELAY,
|
|
32
|
-
}}
|
|
33
|
-
/>
|
|
34
|
-
))}
|
|
35
|
-
</>
|
|
36
|
-
);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
type ActivityQuickActionsSetterProps = {
|
|
40
|
-
actions: QuickAction[];
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export const ActivityQuickActionsSetter: FC<ActivityQuickActionsSetterProps> = (
|
|
44
|
-
props,
|
|
45
|
-
) => {
|
|
46
|
-
const dispatch = useAppDispatch();
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
dispatch(setQuickActions(props.actions));
|
|
49
|
-
return () => {
|
|
50
|
-
dispatch(setQuickActions([]));
|
|
51
|
-
};
|
|
52
|
-
}, [props.actions]);
|
|
53
|
-
|
|
54
|
-
return <></>;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export default ActivityQuickActions;
|
|
1
|
+
import { FC, useEffect } from "react";
|
|
2
|
+
import { useAppDispatch, useAppSelector } from "../../../app/hooks";
|
|
3
|
+
import {
|
|
4
|
+
QuickAction,
|
|
5
|
+
selectQuickActions,
|
|
6
|
+
setQuickActions,
|
|
7
|
+
usePerformQuickAction,
|
|
8
|
+
} from "../navbarSlice";
|
|
9
|
+
import { Button } from "primereact/button";
|
|
10
|
+
import settings from "../../../settings";
|
|
11
|
+
|
|
12
|
+
const ActivityQuickActions: FC<{}> = () => {
|
|
13
|
+
const quickActions = useAppSelector(selectQuickActions);
|
|
14
|
+
const performQuickAction = usePerformQuickAction();
|
|
15
|
+
return (
|
|
16
|
+
<>
|
|
17
|
+
{quickActions.map((action) => (
|
|
18
|
+
<Button
|
|
19
|
+
aria-label={action.title}
|
|
20
|
+
key={action.title}
|
|
21
|
+
severity="secondary"
|
|
22
|
+
size="small"
|
|
23
|
+
icon={action.icon}
|
|
24
|
+
onClick={() => {
|
|
25
|
+
performQuickAction(action);
|
|
26
|
+
}}
|
|
27
|
+
outlined
|
|
28
|
+
tooltip={action.title}
|
|
29
|
+
tooltipOptions={{
|
|
30
|
+
position: "bottom",
|
|
31
|
+
showDelay: settings.TOOLTIP_SHOW_DELAY,
|
|
32
|
+
}}
|
|
33
|
+
/>
|
|
34
|
+
))}
|
|
35
|
+
</>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
type ActivityQuickActionsSetterProps = {
|
|
40
|
+
actions: QuickAction[];
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const ActivityQuickActionsSetter: FC<ActivityQuickActionsSetterProps> = (
|
|
44
|
+
props,
|
|
45
|
+
) => {
|
|
46
|
+
const dispatch = useAppDispatch();
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
dispatch(setQuickActions(props.actions));
|
|
49
|
+
return () => {
|
|
50
|
+
dispatch(setQuickActions([]));
|
|
51
|
+
};
|
|
52
|
+
}, [props.actions]);
|
|
53
|
+
|
|
54
|
+
return <></>;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export default ActivityQuickActions;
|