@magmamath/students-features 0.5.5 → 0.5.6
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/commonjs/features/celebrations/components/ParticleBatch.js.map +1 -1
- package/dist/commonjs/features/celebrations/components/Spark.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js +42 -21
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/ui/SparkIcon.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/ui/ThumbUpIcon.js.map +1 -1
- package/dist/commonjs/index.js +0 -12
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/shared/icons/Halloween.js.map +1 -1
- package/dist/commonjs/shared/icons/MessageBubbleIcon.js.map +1 -1
- package/dist/commonjs/shared/icons/Pi.js.map +1 -1
- package/dist/commonjs/shared/icons/Star.js.map +1 -1
- package/dist/commonjs/shared/icons/Valentine.js.map +1 -1
- package/dist/commonjs/shared/icons/Winter.js.map +1 -1
- package/dist/commonjs/shared/icons/XCloseIcon.js.map +1 -1
- package/dist/module/features/celebrations/components/ParticleBatch.js.map +1 -1
- package/dist/module/features/celebrations/components/Spark.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js +43 -22
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -1
- package/dist/module/features/endOfAssignment/ui/SparkIcon.js.map +1 -1
- package/dist/module/features/endOfAssignment/ui/ThumbUpIcon.js.map +1 -1
- package/dist/module/index.js +0 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/shared/icons/Halloween.js.map +1 -1
- package/dist/module/shared/icons/MessageBubbleIcon.js.map +1 -1
- package/dist/module/shared/icons/Pi.js.map +1 -1
- package/dist/module/shared/icons/Star.js.map +1 -1
- package/dist/module/shared/icons/Valentine.js.map +1 -1
- package/dist/module/shared/icons/Winter.js.map +1 -1
- package/dist/module/shared/icons/XCloseIcon.js.map +1 -1
- package/dist/typescript/commonjs/features/celebrations/components/ParticleBatch.d.ts +1 -1
- package/dist/typescript/commonjs/features/celebrations/components/ParticleBatch.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/celebrations/components/Spark.d.ts +1 -1
- package/dist/typescript/commonjs/features/celebrations/components/Spark.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/ui/SparkIcon.d.ts +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/ui/SparkIcon.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/ui/ThumbUpIcon.d.ts +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/ui/ThumbUpIcon.d.ts.map +1 -1
- package/dist/typescript/commonjs/index.d.ts +0 -1
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/Halloween.d.ts +1 -1
- package/dist/typescript/commonjs/shared/icons/Halloween.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/MessageBubbleIcon.d.ts +1 -1
- package/dist/typescript/commonjs/shared/icons/MessageBubbleIcon.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/Pi.d.ts +1 -1
- package/dist/typescript/commonjs/shared/icons/Pi.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/Star.d.ts +1 -1
- package/dist/typescript/commonjs/shared/icons/Star.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/Valentine.d.ts +1 -1
- package/dist/typescript/commonjs/shared/icons/Valentine.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/Winter.d.ts +1 -1
- package/dist/typescript/commonjs/shared/icons/Winter.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/XCloseIcon.d.ts +1 -1
- package/dist/typescript/commonjs/shared/icons/XCloseIcon.d.ts.map +1 -1
- package/dist/typescript/module/features/celebrations/components/ParticleBatch.d.ts +1 -1
- package/dist/typescript/module/features/celebrations/components/ParticleBatch.d.ts.map +1 -1
- package/dist/typescript/module/features/celebrations/components/Spark.d.ts +1 -1
- package/dist/typescript/module/features/celebrations/components/Spark.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/ui/SparkIcon.d.ts +1 -1
- package/dist/typescript/module/features/endOfAssignment/ui/SparkIcon.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/ui/ThumbUpIcon.d.ts +1 -1
- package/dist/typescript/module/features/endOfAssignment/ui/ThumbUpIcon.d.ts.map +1 -1
- package/dist/typescript/module/index.d.ts +0 -1
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/Halloween.d.ts +1 -1
- package/dist/typescript/module/shared/icons/Halloween.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/MessageBubbleIcon.d.ts +1 -1
- package/dist/typescript/module/shared/icons/MessageBubbleIcon.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/Pi.d.ts +1 -1
- package/dist/typescript/module/shared/icons/Pi.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/Star.d.ts +1 -1
- package/dist/typescript/module/shared/icons/Star.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/Valentine.d.ts +1 -1
- package/dist/typescript/module/shared/icons/Valentine.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/Winter.d.ts +1 -1
- package/dist/typescript/module/shared/icons/Winter.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/XCloseIcon.d.ts +1 -1
- package/dist/typescript/module/shared/icons/XCloseIcon.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/features/celebrations/components/ParticleBatch.tsx +1 -1
- package/src/features/celebrations/components/Spark.tsx +4 -4
- package/src/features/endOfAssignment/components/Modal/assets/SunrisingIcon.tsx +74 -74
- package/src/features/endOfAssignment/components/Modal/assets/TrophyIcon.tsx +24 -24
- package/src/features/endOfAssignment/components/NoAnswer/NoAnswer.tsx +52 -25
- package/src/features/endOfAssignment/ui/SparkIcon.tsx +2 -1
- package/src/features/endOfAssignment/ui/ThumbUpIcon.tsx +2 -2
- package/src/index.ts +0 -1
- package/src/shared/icons/Halloween.tsx +2 -2
- package/src/shared/icons/MessageBubbleIcon.tsx +5 -6
- package/src/shared/icons/Pi.tsx +1 -2
- package/src/shared/icons/Star.tsx +1 -2
- package/src/shared/icons/Valentine.tsx +1 -2
- package/src/shared/icons/Winter.tsx +2 -2
- package/src/shared/icons/XCloseIcon.tsx +3 -4
- package/dist/commonjs/features/formulaSheet/components/FormulaSheet.js +0 -52
- package/dist/commonjs/features/formulaSheet/components/FormulaSheet.js.map +0 -1
- package/dist/commonjs/features/formulaSheet/components/FormulaSheetModal.js +0 -64
- package/dist/commonjs/features/formulaSheet/components/FormulaSheetModal.js.map +0 -1
- package/dist/commonjs/features/formulaSheet/index.js +0 -20
- package/dist/commonjs/features/formulaSheet/index.js.map +0 -1
- package/dist/commonjs/features/formulaSheet/model/api.model.js +0 -15
- package/dist/commonjs/features/formulaSheet/model/api.model.js.map +0 -1
- package/dist/commonjs/features/formulaSheet/model/file.model.js +0 -19
- package/dist/commonjs/features/formulaSheet/model/file.model.js.map +0 -1
- package/dist/commonjs/features/formulaSheet/model/modal.model.js +0 -15
- package/dist/commonjs/features/formulaSheet/model/modal.model.js.map +0 -1
- package/dist/commonjs/features/formulaSheet/model/model.js +0 -35
- package/dist/commonjs/features/formulaSheet/model/model.js.map +0 -1
- package/dist/module/features/formulaSheet/components/FormulaSheet.js +0 -46
- package/dist/module/features/formulaSheet/components/FormulaSheet.js.map +0 -1
- package/dist/module/features/formulaSheet/components/FormulaSheetModal.js +0 -58
- package/dist/module/features/formulaSheet/components/FormulaSheetModal.js.map +0 -1
- package/dist/module/features/formulaSheet/index.js +0 -5
- package/dist/module/features/formulaSheet/index.js.map +0 -1
- package/dist/module/features/formulaSheet/model/api.model.js +0 -10
- package/dist/module/features/formulaSheet/model/api.model.js.map +0 -1
- package/dist/module/features/formulaSheet/model/file.model.js +0 -14
- package/dist/module/features/formulaSheet/model/file.model.js.map +0 -1
- package/dist/module/features/formulaSheet/model/modal.model.js +0 -10
- package/dist/module/features/formulaSheet/model/modal.model.js.map +0 -1
- package/dist/module/features/formulaSheet/model/model.js +0 -30
- package/dist/module/features/formulaSheet/model/model.js.map +0 -1
- package/dist/typescript/commonjs/features/formulaSheet/components/FormulaSheet.d.ts +0 -15
- package/dist/typescript/commonjs/features/formulaSheet/components/FormulaSheet.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/formulaSheet/components/FormulaSheetModal.d.ts +0 -10
- package/dist/typescript/commonjs/features/formulaSheet/components/FormulaSheetModal.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/formulaSheet/index.d.ts +0 -3
- package/dist/typescript/commonjs/features/formulaSheet/index.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/formulaSheet/model/api.model.d.ts +0 -9
- package/dist/typescript/commonjs/features/formulaSheet/model/api.model.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/formulaSheet/model/file.model.d.ts +0 -14
- package/dist/typescript/commonjs/features/formulaSheet/model/file.model.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/formulaSheet/model/modal.model.d.ts +0 -7
- package/dist/typescript/commonjs/features/formulaSheet/model/modal.model.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/formulaSheet/model/model.d.ts +0 -14
- package/dist/typescript/commonjs/features/formulaSheet/model/model.d.ts.map +0 -1
- package/dist/typescript/module/features/formulaSheet/components/FormulaSheet.d.ts +0 -15
- package/dist/typescript/module/features/formulaSheet/components/FormulaSheet.d.ts.map +0 -1
- package/dist/typescript/module/features/formulaSheet/components/FormulaSheetModal.d.ts +0 -10
- package/dist/typescript/module/features/formulaSheet/components/FormulaSheetModal.d.ts.map +0 -1
- package/dist/typescript/module/features/formulaSheet/index.d.ts +0 -3
- package/dist/typescript/module/features/formulaSheet/index.d.ts.map +0 -1
- package/dist/typescript/module/features/formulaSheet/model/api.model.d.ts +0 -9
- package/dist/typescript/module/features/formulaSheet/model/api.model.d.ts.map +0 -1
- package/dist/typescript/module/features/formulaSheet/model/file.model.d.ts +0 -14
- package/dist/typescript/module/features/formulaSheet/model/file.model.d.ts.map +0 -1
- package/dist/typescript/module/features/formulaSheet/model/modal.model.d.ts +0 -7
- package/dist/typescript/module/features/formulaSheet/model/modal.model.d.ts.map +0 -1
- package/dist/typescript/module/features/formulaSheet/model/model.d.ts +0 -14
- package/dist/typescript/module/features/formulaSheet/model/model.d.ts.map +0 -1
- package/src/features/formulaSheet/components/FormulaSheet.tsx +0 -74
- package/src/features/formulaSheet/components/FormulaSheetModal.tsx +0 -64
- package/src/features/formulaSheet/index.ts +0 -2
- package/src/features/formulaSheet/model/api.model.ts +0 -13
- package/src/features/formulaSheet/model/file.model.ts +0 -18
- package/src/features/formulaSheet/model/modal.model.ts +0 -10
- package/src/features/formulaSheet/model/model.ts +0 -31
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { LoaderColor } from '@magmamath/react-native-ui';
|
|
3
|
-
type FormulaSheetModalProps = {
|
|
4
|
-
isLoading: boolean;
|
|
5
|
-
loaderColor: LoaderColor;
|
|
6
|
-
onClose: () => void;
|
|
7
|
-
};
|
|
8
|
-
export declare const FormulaSheetModal: ({ children, loaderColor, isLoading, onClose, }: PropsWithChildren<FormulaSheetModalProps>) => React.JSX.Element;
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=FormulaSheetModal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormulaSheetModal.d.ts","sourceRoot":"","sources":["../../../../../../src/features/formulaSheet/components/FormulaSheetModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAEhD,OAAO,EAIL,WAAW,EAIZ,MAAM,4BAA4B,CAAA;AAEnC,KAAK,sBAAsB,GAAG;IAC5B,SAAS,EAAE,OAAO,CAAA;IAClB,WAAW,EAAE,WAAW,CAAA;IACxB,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,iBAAiB,mDAK3B,iBAAiB,CAAC,sBAAsB,CAAC,sBAkB3C,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/formulaSheet/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Effect } from 'effector';
|
|
2
|
-
export type FormulaSheetApiProps = {
|
|
3
|
-
getPDFFileBlob: (id: string) => Promise<string>;
|
|
4
|
-
};
|
|
5
|
-
export declare class FormulaSheetAPI {
|
|
6
|
-
readonly getPDFFileBlobFx: Effect<string, string>;
|
|
7
|
-
setupRequests(api: FormulaSheetApiProps): void;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=api.model.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.model.d.ts","sourceRoot":"","sources":["../../../../../../src/features/formulaSheet/model/api.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,UAAU,CAAA;AAE/C,MAAM,MAAM,oBAAoB,GAAG;IACjC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CAChD,CAAA;AAED,qBAAa,eAAe;IAC1B,SAAgB,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAiB;IAElE,aAAa,CAAC,GAAG,EAAE,oBAAoB;CAG/C"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { StoreWritable } from 'effector';
|
|
2
|
-
import { FormulaSheetAPI } from './api.model';
|
|
3
|
-
type FormulaSheetFileProps = {
|
|
4
|
-
api: FormulaSheetAPI;
|
|
5
|
-
};
|
|
6
|
-
export declare class FormulaSheetFile {
|
|
7
|
-
readonly reset: import("effector").EventCallable<void>;
|
|
8
|
-
readonly $blob: StoreWritable<string | null>;
|
|
9
|
-
readonly setId: import("effector").EventCallable<string>;
|
|
10
|
-
readonly $id: StoreWritable<string | null>;
|
|
11
|
-
constructor({ api }: FormulaSheetFileProps);
|
|
12
|
-
}
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=file.model.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file.model.d.ts","sourceRoot":"","sources":["../../../../../../src/features/formulaSheet/model/file.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,aAAa,EAAE,MAAM,UAAU,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C,KAAK,qBAAqB,GAAG;IAC3B,GAAG,EAAE,eAAe,CAAA;CACrB,CAAA;AAED,qBAAa,gBAAgB;IAC3B,SAAgB,KAAK,yCAAgB;IACrC,SAAgB,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IAEnD,SAAgB,KAAK,2CAAwB;IAC7C,SAAgB,GAAG,+BAA4B;gBAEnC,EAAE,GAAG,EAAE,EAAE,qBAAqB;CAG3C"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare class FormulaSheetModal {
|
|
2
|
-
readonly reset: import("effector").EventCallable<void>;
|
|
3
|
-
readonly toggle: import("effector").EventCallable<void>;
|
|
4
|
-
readonly setIsOpen: import("effector").EventCallable<boolean>;
|
|
5
|
-
readonly $isOpen: import("effector").StoreWritable<boolean>;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=modal.model.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modal.model.d.ts","sourceRoot":"","sources":["../../../../../../src/features/formulaSheet/model/modal.model.ts"],"names":[],"mappings":"AAEA,qBAAa,iBAAiB;IAC5B,SAAgB,KAAK,yCAAgB;IACrC,SAAgB,MAAM,yCAAgB;IACtC,SAAgB,SAAS,4CAAyB;IAClD,SAAgB,OAAO,4CAEH;CACrB"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FormulaSheetAPI, type FormulaSheetApiProps } from './api.model';
|
|
2
|
-
import { FormulaSheetModal } from './modal.model';
|
|
3
|
-
import { FormulaSheetFile } from './file.model';
|
|
4
|
-
type FormulaSheetModelProps = {
|
|
5
|
-
api: FormulaSheetApiProps;
|
|
6
|
-
};
|
|
7
|
-
export declare class FormulaSheetModel {
|
|
8
|
-
readonly api: FormulaSheetAPI;
|
|
9
|
-
readonly modal: FormulaSheetModal;
|
|
10
|
-
readonly file: FormulaSheetFile;
|
|
11
|
-
constructor({ api }: FormulaSheetModelProps);
|
|
12
|
-
}
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=model.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../../src/features/formulaSheet/model/model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAA;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAE/C,KAAK,sBAAsB,GAAG;IAC5B,GAAG,EAAE,oBAAoB,CAAA;CAC1B,CAAA;AAED,qBAAa,iBAAiB;IAC5B,SAAgB,GAAG,kBAAwB;IAC3C,SAAgB,KAAK,oBAA0B;IAC/C,SAAgB,IAAI,mBAA0C;gBAElD,EAAE,GAAG,EAAE,EAAE,sBAAsB;CAgB5C"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef, ReactNode, useEffect } from 'react'
|
|
2
|
-
import { useUnit } from 'effector-react'
|
|
3
|
-
import {
|
|
4
|
-
Button,
|
|
5
|
-
ButtonColor,
|
|
6
|
-
ButtonSize,
|
|
7
|
-
ButtonVariant,
|
|
8
|
-
COLORS,
|
|
9
|
-
TheoryIcon,
|
|
10
|
-
ButtonRef,
|
|
11
|
-
LoaderColor,
|
|
12
|
-
} from '@magmamath/react-native-ui'
|
|
13
|
-
import { FormulaSheetModel } from '../model/model'
|
|
14
|
-
import { FormulaSheetModal } from './FormulaSheetModal'
|
|
15
|
-
|
|
16
|
-
type FormulaSheetProps = {
|
|
17
|
-
model: FormulaSheetModel
|
|
18
|
-
fileId: string
|
|
19
|
-
renderer: (fileBlob: string) => ReactNode
|
|
20
|
-
buttonSize: ButtonSize
|
|
21
|
-
buttonColor: ButtonColor
|
|
22
|
-
loaderColor: LoaderColor
|
|
23
|
-
onPress?: () => void
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export const FormulaSheet = forwardRef<ButtonRef | null, FormulaSheetProps>(
|
|
27
|
-
(
|
|
28
|
-
{
|
|
29
|
-
model,
|
|
30
|
-
fileId,
|
|
31
|
-
renderer,
|
|
32
|
-
buttonSize = ButtonSize.MEDIUM,
|
|
33
|
-
buttonColor = ButtonColor.BLUE,
|
|
34
|
-
loaderColor = LoaderColor.BLUE,
|
|
35
|
-
onPress,
|
|
36
|
-
},
|
|
37
|
-
ref,
|
|
38
|
-
) => {
|
|
39
|
-
const isOpen = useUnit(model.modal.$isOpen)
|
|
40
|
-
const sheetFileBlob = useUnit(model.file.$blob)
|
|
41
|
-
const isRequestPending = useUnit(model.api.getPDFFileBlobFx.pending)
|
|
42
|
-
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
model.file.setId(fileId ?? null)
|
|
45
|
-
}, [fileId])
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<>
|
|
49
|
-
<Button
|
|
50
|
-
ref={ref}
|
|
51
|
-
size={buttonSize}
|
|
52
|
-
variant={ButtonVariant.SECONDARY}
|
|
53
|
-
colorScheme={buttonColor}
|
|
54
|
-
isActive={isOpen}
|
|
55
|
-
onPress={() => {
|
|
56
|
-
model.modal.toggle()
|
|
57
|
-
onPress?.()
|
|
58
|
-
}}
|
|
59
|
-
icon={<TheoryIcon color={isOpen ? COLORS.NEUTRAL_1 : undefined} size={20} />}
|
|
60
|
-
/>
|
|
61
|
-
|
|
62
|
-
{isOpen && (
|
|
63
|
-
<FormulaSheetModal
|
|
64
|
-
isLoading={isRequestPending}
|
|
65
|
-
loaderColor={loaderColor}
|
|
66
|
-
onClose={() => model.modal.setIsOpen(false)}
|
|
67
|
-
>
|
|
68
|
-
{renderer(sheetFileBlob ?? '')}
|
|
69
|
-
</FormulaSheetModal>
|
|
70
|
-
)}
|
|
71
|
-
</>
|
|
72
|
-
)
|
|
73
|
-
},
|
|
74
|
-
)
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react'
|
|
2
|
-
import { View, Modal, StyleSheet, TouchableWithoutFeedback } from 'react-native'
|
|
3
|
-
import {
|
|
4
|
-
BORDER_RADIUS,
|
|
5
|
-
COLORS,
|
|
6
|
-
Loader,
|
|
7
|
-
LoaderColor,
|
|
8
|
-
LoaderSize,
|
|
9
|
-
LoaderType,
|
|
10
|
-
SPACING,
|
|
11
|
-
} from '@magmamath/react-native-ui'
|
|
12
|
-
|
|
13
|
-
type FormulaSheetModalProps = {
|
|
14
|
-
isLoading: boolean
|
|
15
|
-
loaderColor: LoaderColor
|
|
16
|
-
onClose: () => void
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const FormulaSheetModal = ({
|
|
20
|
-
children,
|
|
21
|
-
loaderColor,
|
|
22
|
-
isLoading,
|
|
23
|
-
onClose,
|
|
24
|
-
}: PropsWithChildren<FormulaSheetModalProps>) => {
|
|
25
|
-
return (
|
|
26
|
-
<Modal visible transparent animationType="none" onRequestClose={onClose}>
|
|
27
|
-
<TouchableWithoutFeedback onPress={onClose}>
|
|
28
|
-
<View style={styles.container}>
|
|
29
|
-
<TouchableWithoutFeedback onPress={(event) => event.stopPropagation()}>
|
|
30
|
-
<View style={styles.content}>
|
|
31
|
-
{isLoading ? (
|
|
32
|
-
<Loader type={LoaderType.PRIMARY} color={loaderColor} size={LoaderSize.LARGE} />
|
|
33
|
-
) : (
|
|
34
|
-
children
|
|
35
|
-
)}
|
|
36
|
-
</View>
|
|
37
|
-
</TouchableWithoutFeedback>
|
|
38
|
-
</View>
|
|
39
|
-
</TouchableWithoutFeedback>
|
|
40
|
-
</Modal>
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const styles = StyleSheet.create({
|
|
45
|
-
container: {
|
|
46
|
-
width: '100%',
|
|
47
|
-
height: '100%',
|
|
48
|
-
alignItems: 'center',
|
|
49
|
-
justifyContent: 'center',
|
|
50
|
-
backgroundColor: 'rgba(0, 0, 0, 0.25)',
|
|
51
|
-
},
|
|
52
|
-
content: {
|
|
53
|
-
width: '100%',
|
|
54
|
-
maxWidth: 720,
|
|
55
|
-
height: '100%',
|
|
56
|
-
maxHeight: '80%',
|
|
57
|
-
alignItems: 'center',
|
|
58
|
-
justifyContent: 'center',
|
|
59
|
-
paddingHorizontal: SPACING['800'],
|
|
60
|
-
paddingVertical: SPACING['400'],
|
|
61
|
-
borderRadius: BORDER_RADIUS['400'],
|
|
62
|
-
backgroundColor: COLORS.NEUTRAL_1,
|
|
63
|
-
},
|
|
64
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createEffect, Effect } from 'effector'
|
|
2
|
-
|
|
3
|
-
export type FormulaSheetApiProps = {
|
|
4
|
-
getPDFFileBlob: (id: string) => Promise<string>
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export class FormulaSheetAPI {
|
|
8
|
-
public readonly getPDFFileBlobFx: Effect<string, string> = createEffect()
|
|
9
|
-
|
|
10
|
-
public setupRequests(api: FormulaSheetApiProps) {
|
|
11
|
-
this.getPDFFileBlobFx.use(api.getPDFFileBlob)
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { createEvent, restore, StoreWritable } from 'effector'
|
|
2
|
-
import { FormulaSheetAPI } from './api.model'
|
|
3
|
-
|
|
4
|
-
type FormulaSheetFileProps = {
|
|
5
|
-
api: FormulaSheetAPI
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export class FormulaSheetFile {
|
|
9
|
-
public readonly reset = createEvent()
|
|
10
|
-
public readonly $blob: StoreWritable<string | null>
|
|
11
|
-
|
|
12
|
-
public readonly setId = createEvent<string>()
|
|
13
|
-
public readonly $id = restore(this.setId, null)
|
|
14
|
-
|
|
15
|
-
constructor({ api }: FormulaSheetFileProps) {
|
|
16
|
-
this.$blob = restore(api.getPDFFileBlobFx.doneData, null).reset(this.reset)
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { createEvent, restore } from 'effector'
|
|
2
|
-
|
|
3
|
-
export class FormulaSheetModal {
|
|
4
|
-
public readonly reset = createEvent()
|
|
5
|
-
public readonly toggle = createEvent()
|
|
6
|
-
public readonly setIsOpen = createEvent<boolean>()
|
|
7
|
-
public readonly $isOpen = restore(this.setIsOpen, false)
|
|
8
|
-
.on(this.toggle, (state) => !state)
|
|
9
|
-
.reset(this.reset)
|
|
10
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { sample } from 'effector'
|
|
2
|
-
import { FormulaSheetAPI, type FormulaSheetApiProps } from './api.model'
|
|
3
|
-
import { FormulaSheetModal } from './modal.model'
|
|
4
|
-
import { FormulaSheetFile } from './file.model'
|
|
5
|
-
|
|
6
|
-
type FormulaSheetModelProps = {
|
|
7
|
-
api: FormulaSheetApiProps
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export class FormulaSheetModel {
|
|
11
|
-
public readonly api = new FormulaSheetAPI()
|
|
12
|
-
public readonly modal = new FormulaSheetModal()
|
|
13
|
-
public readonly file = new FormulaSheetFile({ api: this.api })
|
|
14
|
-
|
|
15
|
-
constructor({ api }: FormulaSheetModelProps) {
|
|
16
|
-
this.api.setupRequests(api)
|
|
17
|
-
|
|
18
|
-
sample({
|
|
19
|
-
clock: this.modal.$isOpen,
|
|
20
|
-
source: [this.file.$id, this.file.$blob],
|
|
21
|
-
filter: ([fileId, blob], isOpen) => !!(isOpen && fileId && !blob),
|
|
22
|
-
fn: ([fileId]) => fileId as string,
|
|
23
|
-
target: this.api.getPDFFileBlobFx,
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
sample({
|
|
27
|
-
clock: this.file.$id,
|
|
28
|
-
target: [this.file.reset, this.modal.reset],
|
|
29
|
-
})
|
|
30
|
-
}
|
|
31
|
-
}
|