@magmamath/students-features 0.6.12 → 0.6.13
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/exampleSolution/ExampleSolutionModal.js +31 -0
- package/dist/commonjs/features/exampleSolution/ExampleSolutionModal.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/assets/grid.png +0 -0
- package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js +97 -0
- package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/components/LavaIcon.js +44 -0
- package/dist/commonjs/features/exampleSolution/components/LavaIcon.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/components/MessageBlock.js +61 -0
- package/dist/commonjs/features/exampleSolution/components/MessageBlock.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/components/QuestionSection.js +68 -0
- package/dist/commonjs/features/exampleSolution/components/QuestionSection.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/components/SolutionSection.js +75 -0
- package/dist/commonjs/features/exampleSolution/components/SolutionSection.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/constants.js +13 -0
- package/dist/commonjs/features/exampleSolution/constants.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/hooks/useExampleSolution.js +61 -0
- package/dist/commonjs/features/exampleSolution/hooks/useExampleSolution.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/index.js +39 -0
- package/dist/commonjs/features/exampleSolution/index.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolution.model.js +22 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolution.model.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js +32 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionCache.js +18 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionCache.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/types.js +6 -0
- package/dist/commonjs/features/exampleSolution/types.js.map +1 -0
- package/dist/commonjs/features/problemSelector/components/ProblemSelectorButton.js +1 -1
- package/dist/commonjs/features/problemSelector/components/ProblemSelectorButton.js.map +1 -1
- package/dist/commonjs/index.js +24 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/shared/icons/ExcitedLavaIcon.js +681 -0
- package/dist/commonjs/shared/icons/ExcitedLavaIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/LavaIconInGlasses.js +616 -0
- package/dist/commonjs/shared/icons/LavaIconInGlasses.js.map +1 -0
- package/dist/commonjs/shared/icons/index.js +204 -0
- package/dist/commonjs/shared/icons/index.js.map +1 -0
- package/dist/commonjs/shared/translation/localization/ca.json +6 -0
- package/dist/commonjs/shared/translation/localization/en.json +6 -0
- package/dist/commonjs/shared/translation/localization/gb.json +6 -0
- package/dist/commonjs/shared/translation/localization/sct.json +6 -0
- package/dist/commonjs/shared/translation/localization/sw.json +6 -0
- package/dist/module/features/exampleSolution/ExampleSolutionModal.js +25 -0
- package/dist/module/features/exampleSolution/ExampleSolutionModal.js.map +1 -0
- package/dist/module/features/exampleSolution/assets/grid.png +0 -0
- package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js +91 -0
- package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -0
- package/dist/module/features/exampleSolution/components/LavaIcon.js +36 -0
- package/dist/module/features/exampleSolution/components/LavaIcon.js.map +1 -0
- package/dist/module/features/exampleSolution/components/MessageBlock.js +53 -0
- package/dist/module/features/exampleSolution/components/MessageBlock.js.map +1 -0
- package/dist/module/features/exampleSolution/components/QuestionSection.js +60 -0
- package/dist/module/features/exampleSolution/components/QuestionSection.js.map +1 -0
- package/dist/module/features/exampleSolution/components/SolutionSection.js +67 -0
- package/dist/module/features/exampleSolution/components/SolutionSection.js.map +1 -0
- package/dist/module/features/exampleSolution/constants.js +9 -0
- package/dist/module/features/exampleSolution/constants.js.map +1 -0
- package/dist/module/features/exampleSolution/hooks/useExampleSolution.js +56 -0
- package/dist/module/features/exampleSolution/hooks/useExampleSolution.js.map +1 -0
- package/dist/module/features/exampleSolution/index.js +6 -0
- package/dist/module/features/exampleSolution/index.js.map +1 -0
- package/dist/module/features/exampleSolution/model/ExampleSolution.model.js +17 -0
- package/dist/module/features/exampleSolution/model/ExampleSolution.model.js.map +1 -0
- package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js +27 -0
- package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -0
- package/dist/module/features/exampleSolution/model/ExampleSolutionCache.js +13 -0
- package/dist/module/features/exampleSolution/model/ExampleSolutionCache.js.map +1 -0
- package/dist/module/features/exampleSolution/types.js +4 -0
- package/dist/module/features/exampleSolution/types.js.map +1 -0
- package/dist/module/features/problemSelector/components/ProblemSelectorButton.js +1 -1
- package/dist/module/features/problemSelector/components/ProblemSelectorButton.js.map +1 -1
- package/dist/module/index.js +2 -0
- package/dist/module/index.js.map +1 -1
- package/dist/module/shared/icons/ExcitedLavaIcon.js +673 -0
- package/dist/module/shared/icons/ExcitedLavaIcon.js.map +1 -0
- package/dist/module/shared/icons/LavaIconInGlasses.js +608 -0
- package/dist/module/shared/icons/LavaIconInGlasses.js.map +1 -0
- package/dist/module/shared/icons/index.js +21 -0
- package/dist/module/shared/icons/index.js.map +1 -0
- package/dist/module/shared/translation/localization/ca.json +6 -0
- package/dist/module/shared/translation/localization/en.json +6 -0
- package/dist/module/shared/translation/localization/gb.json +6 -0
- package/dist/module/shared/translation/localization/sct.json +6 -0
- package/dist/module/shared/translation/localization/sw.json +6 -0
- package/dist/typescript/commonjs/features/exampleSolution/ExampleSolutionModal.d.ts +11 -0
- package/dist/typescript/commonjs/features/exampleSolution/ExampleSolutionModal.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts +4 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/LavaIcon.d.ts +10 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/LavaIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/MessageBlock.d.ts +10 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/MessageBlock.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/QuestionSection.d.ts +9 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/QuestionSection.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/SolutionSection.d.ts +9 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/SolutionSection.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/constants.d.ts +6 -0
- package/dist/typescript/commonjs/features/exampleSolution/constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/hooks/useExampleSolution.d.ts +9 -0
- package/dist/typescript/commonjs/features/exampleSolution/hooks/useExampleSolution.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/index.d.ts +4 -0
- package/dist/typescript/commonjs/features/exampleSolution/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolution.model.d.ts +9 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolution.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionApi.d.ts +13 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionApi.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionCache.d.ts +11 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionCache.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/types.d.ts +26 -0
- package/dist/typescript/commonjs/features/exampleSolution/types.d.ts.map +1 -0
- package/dist/typescript/commonjs/index.d.ts +2 -0
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/ExcitedLavaIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/ExcitedLavaIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/LavaIconInGlasses.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/LavaIconInGlasses.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/index.d.ts +19 -0
- package/dist/typescript/commonjs/shared/icons/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts +30 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/model.d.ts +12 -0
- package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
- package/dist/typescript/module/features/exampleSolution/ExampleSolutionModal.d.ts +11 -0
- package/dist/typescript/module/features/exampleSolution/ExampleSolutionModal.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts +4 -0
- package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/LavaIcon.d.ts +10 -0
- package/dist/typescript/module/features/exampleSolution/components/LavaIcon.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/MessageBlock.d.ts +10 -0
- package/dist/typescript/module/features/exampleSolution/components/MessageBlock.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/QuestionSection.d.ts +9 -0
- package/dist/typescript/module/features/exampleSolution/components/QuestionSection.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/SolutionSection.d.ts +9 -0
- package/dist/typescript/module/features/exampleSolution/components/SolutionSection.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/constants.d.ts +6 -0
- package/dist/typescript/module/features/exampleSolution/constants.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/hooks/useExampleSolution.d.ts +9 -0
- package/dist/typescript/module/features/exampleSolution/hooks/useExampleSolution.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/index.d.ts +4 -0
- package/dist/typescript/module/features/exampleSolution/index.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolution.model.d.ts +9 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolution.model.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionApi.d.ts +13 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionApi.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionCache.d.ts +11 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionCache.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/types.d.ts +26 -0
- package/dist/typescript/module/features/exampleSolution/types.d.ts.map +1 -0
- package/dist/typescript/module/index.d.ts +2 -0
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/ExcitedLavaIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/ExcitedLavaIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/LavaIconInGlasses.d.ts +4 -0
- package/dist/typescript/module/shared/icons/LavaIconInGlasses.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/index.d.ts +19 -0
- package/dist/typescript/module/shared/icons/index.d.ts.map +1 -0
- package/dist/typescript/module/shared/translation/constants.d.ts +30 -0
- package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/model.d.ts +12 -0
- package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
- package/package.json +7 -3
- package/src/features/exampleSolution/ExampleSolutionModal.tsx +29 -0
- package/src/features/exampleSolution/assets/grid.png +0 -0
- package/src/features/exampleSolution/components/ExampleSolutionModalContent.tsx +71 -0
- package/src/features/exampleSolution/components/LavaIcon.tsx +35 -0
- package/src/features/exampleSolution/components/MessageBlock.tsx +67 -0
- package/src/features/exampleSolution/components/QuestionSection.tsx +56 -0
- package/src/features/exampleSolution/components/SolutionSection.tsx +69 -0
- package/src/features/exampleSolution/constants.ts +5 -0
- package/src/features/exampleSolution/hooks/useExampleSolution.ts +66 -0
- package/src/features/exampleSolution/index.ts +3 -0
- package/src/features/exampleSolution/model/ExampleSolution.model.ts +12 -0
- package/src/features/exampleSolution/model/ExampleSolutionApi.ts +33 -0
- package/src/features/exampleSolution/model/ExampleSolutionCache.ts +20 -0
- package/src/features/exampleSolution/types.ts +26 -0
- package/src/features/problemSelector/components/ProblemSelectorButton.tsx +1 -1
- package/src/index.ts +2 -0
- package/src/shared/icons/ExcitedLavaIcon.tsx +541 -0
- package/src/shared/icons/LavaIconInGlasses.tsx +489 -0
- package/src/shared/icons/index.ts +18 -0
- package/src/shared/translation/localization/ca.json +6 -0
- package/src/shared/translation/localization/en.json +6 -0
- package/src/shared/translation/localization/gb.json +6 -0
- package/src/shared/translation/localization/sct.json +6 -0
- package/src/shared/translation/localization/sw.json +6 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useExampleSolution.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/hooks/useExampleSolution.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAItD,KAAK,wBAAwB,GAAG;IAC9B,MAAM,EAAE,uBAAuB,GAAG,IAAI,CAAA;IACtC,MAAM,EAAE,uBAAuB,CAAA;CAChC,CAAA;AAED,eAAO,MAAM,kBAAkB,kCAI5B,0BAA0B,KAAG,wBAiD/B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/exampleSolution/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GifCelebrationsModelProps } from '../types';
|
|
2
|
+
import { ExampleSolutionsApi } from './ExampleSolutionApi';
|
|
3
|
+
import { ExampleSolutionCache } from './ExampleSolutionCache';
|
|
4
|
+
export declare class ExampleSolutionModel {
|
|
5
|
+
readonly api: ExampleSolutionsApi;
|
|
6
|
+
readonly cache: ExampleSolutionCache;
|
|
7
|
+
constructor({ api, errorHandler }: GifCelebrationsModelProps);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=ExampleSolution.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleSolution.model.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/model/ExampleSolution.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D,qBAAa,oBAAoB;IAC/B,SAAgB,GAAG,sBAAA;IACnB,SAAgB,KAAK,uBAA6B;gBAEtC,EAAE,GAAG,EAAE,YAAY,EAAE,EAAE,yBAAyB;CAG7D"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExampleSolutionApiRequests, ExampleSolutionErrorHandler } from '../types';
|
|
2
|
+
type ExampleSolutionApiProps = {
|
|
3
|
+
api: ExampleSolutionApiRequests;
|
|
4
|
+
errorHandler?: ExampleSolutionErrorHandler;
|
|
5
|
+
};
|
|
6
|
+
export declare class ExampleSolutionsApi {
|
|
7
|
+
readonly generateExampleSolutionFx: import("./../../../lib/effector/createControllerEffect").ControlledEffect<import("../types").ExampleSolutionPayload, import("../types").ExampleSolutionResponse>;
|
|
8
|
+
readonly errorHandlerFx?: ExampleSolutionErrorHandler;
|
|
9
|
+
readonly errorHandlingFx: import("effector").Effect<void, void, Error>;
|
|
10
|
+
constructor({ api, errorHandler }: ExampleSolutionApiProps);
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=ExampleSolutionApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleSolutionApi.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/model/ExampleSolutionApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAA;AAIlF,KAAK,uBAAuB,GAAG;IAC7B,GAAG,EAAE,0BAA0B,CAAA;IAC/B,YAAY,CAAC,EAAE,2BAA2B,CAAA;CAC3C,CAAA;AAED,qBAAa,mBAAmB;IAC9B,SAAgB,yBAAyB,mKAAA;IACzC,SAAgB,cAAc,CAAC,EAAE,2BAA2B,CAAA;IAE5D,SAAgB,eAAe,+CAO7B;gBAEU,EAAE,GAAG,EAAE,YAAY,EAAE,EAAE,uBAAuB;CAS3D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ExampleSolutionResponse } from '../types';
|
|
2
|
+
type AddExampleSolution = {
|
|
3
|
+
cacheKey: string;
|
|
4
|
+
response: ExampleSolutionResponse;
|
|
5
|
+
};
|
|
6
|
+
export declare class ExampleSolutionCache {
|
|
7
|
+
readonly addExampleSolution: import("effector").EventCallable<AddExampleSolution>;
|
|
8
|
+
readonly $state: import("effector").StoreWritable<Record<string, ExampleSolutionResponse>>;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=ExampleSolutionCache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleSolutionCache.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/model/ExampleSolutionCache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAElD,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,uBAAuB,CAAA;CAClC,CAAA;AAED,qBAAa,oBAAoB;IAC/B,SAAgB,kBAAkB,uDAAoC;IACtE,SAAgB,MAAM,4EAQrB;CACF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ExampleSolutionModel } from './model/ExampleSolution.model';
|
|
2
|
+
export type ExampleSolutionPayload = {
|
|
3
|
+
question: string;
|
|
4
|
+
answer: string;
|
|
5
|
+
language: string;
|
|
6
|
+
altText?: string;
|
|
7
|
+
imageCdnId?: string;
|
|
8
|
+
};
|
|
9
|
+
export type ExampleSolutionResponse = {
|
|
10
|
+
question: string;
|
|
11
|
+
answer: string;
|
|
12
|
+
};
|
|
13
|
+
export type ExampleSolutionApiRequests = {
|
|
14
|
+
generateExampleSolution: (body: ExampleSolutionPayload) => Promise<ExampleSolutionResponse>;
|
|
15
|
+
};
|
|
16
|
+
export type ExampleSolutionErrorHandler = (errorMessage: string) => void;
|
|
17
|
+
export type GifCelebrationsModelProps = {
|
|
18
|
+
api: ExampleSolutionApiRequests;
|
|
19
|
+
errorHandler?: ExampleSolutionErrorHandler;
|
|
20
|
+
};
|
|
21
|
+
export type ExampleSolutionModalParams = {
|
|
22
|
+
cacheKey: string;
|
|
23
|
+
payload: ExampleSolutionPayload;
|
|
24
|
+
model: ExampleSolutionModel;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/exampleSolution/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAA;AAEpE,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AACD,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AACD,MAAM,MAAM,0BAA0B,GAAG;IACvC,uBAAuB,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAA;CAC5F,CAAA;AACD,MAAM,MAAM,2BAA2B,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;AACxE,MAAM,MAAM,yBAAyB,GAAG;IACtC,GAAG,EAAE,0BAA0B,CAAA;IAC/B,YAAY,CAAC,EAAE,2BAA2B,CAAA;CAC3C,CAAA;AACD,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,sBAAsB,CAAA;IAC/B,KAAK,EAAE,oBAAoB,CAAA;CAC5B,CAAA"}
|
|
@@ -7,4 +7,6 @@ export * from './features/endOfAssignment';
|
|
|
7
7
|
export * from './features/formulaSheet';
|
|
8
8
|
export * from './features/problemSelector';
|
|
9
9
|
export * from './features/gifCelebrations';
|
|
10
|
+
export * from './features/exampleSolution';
|
|
11
|
+
export * from './shared/icons';
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,gBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExcitedLavaIcon.d.ts","sourceRoot":"","sources":["../../../../../src/shared/icons/ExcitedLavaIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,eAAO,MAAM,eAAe,sBAAkC,SAAS,sBAwhBtE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LavaIconInGlasses.d.ts","sourceRoot":"","sources":["../../../../../src/shared/icons/LavaIconInGlasses.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,eAAO,MAAM,iBAAiB,sBAAkC,SAAS,sBA4dxE,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from './ArrowRightIcon';
|
|
2
|
+
export * from './ChatbotIcon';
|
|
3
|
+
export * from './CloseIcon';
|
|
4
|
+
export * from './ExcitedLavaIcon';
|
|
5
|
+
export * from './GlobeIcon';
|
|
6
|
+
export * from './Halloween';
|
|
7
|
+
export * from './HighlighterIcon';
|
|
8
|
+
export * from './LavaIconInGlasses';
|
|
9
|
+
export * from './MessageBubbleIcon';
|
|
10
|
+
export * from './PauseIcon';
|
|
11
|
+
export * from './Pi';
|
|
12
|
+
export * from './PlayIcon';
|
|
13
|
+
export * from './SpeakerIcon';
|
|
14
|
+
export * from './Star';
|
|
15
|
+
export * from './StopIcon';
|
|
16
|
+
export * from './Valentine';
|
|
17
|
+
export * from './Winter';
|
|
18
|
+
export * from './XCloseIcon';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/icons/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,MAAM,CAAA;AACpB,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA"}
|
|
@@ -25,6 +25,12 @@ export declare const LOCALIZATION_CONFIGS: {
|
|
|
25
25
|
onTheWay: string;
|
|
26
26
|
almostThere: string;
|
|
27
27
|
};
|
|
28
|
+
exampleSolution: {
|
|
29
|
+
exampleSolution: string;
|
|
30
|
+
letMeThink: string;
|
|
31
|
+
aha: string;
|
|
32
|
+
errorMessage: string;
|
|
33
|
+
};
|
|
28
34
|
};
|
|
29
35
|
"en-GB": {
|
|
30
36
|
"teacherFeedback.noComments": string;
|
|
@@ -52,6 +58,12 @@ export declare const LOCALIZATION_CONFIGS: {
|
|
|
52
58
|
onTheWay: string;
|
|
53
59
|
almostThere: string;
|
|
54
60
|
};
|
|
61
|
+
exampleSolution: {
|
|
62
|
+
exampleSolution: string;
|
|
63
|
+
letMeThink: string;
|
|
64
|
+
aha: string;
|
|
65
|
+
errorMessage: string;
|
|
66
|
+
};
|
|
55
67
|
};
|
|
56
68
|
"sv-SE": {
|
|
57
69
|
"teacherFeedback.noComments": string;
|
|
@@ -79,6 +91,12 @@ export declare const LOCALIZATION_CONFIGS: {
|
|
|
79
91
|
onTheWay: string;
|
|
80
92
|
almostThere: string;
|
|
81
93
|
};
|
|
94
|
+
exampleSolution: {
|
|
95
|
+
exampleSolution: string;
|
|
96
|
+
letMeThink: string;
|
|
97
|
+
aha: string;
|
|
98
|
+
errorMessage: string;
|
|
99
|
+
};
|
|
82
100
|
};
|
|
83
101
|
"en-CA": {
|
|
84
102
|
"teacherFeedback.noComments": string;
|
|
@@ -106,6 +124,12 @@ export declare const LOCALIZATION_CONFIGS: {
|
|
|
106
124
|
onTheWay: string;
|
|
107
125
|
almostThere: string;
|
|
108
126
|
};
|
|
127
|
+
exampleSolution: {
|
|
128
|
+
exampleSolution: string;
|
|
129
|
+
letMeThink: string;
|
|
130
|
+
aha: string;
|
|
131
|
+
errorMessage: string;
|
|
132
|
+
};
|
|
109
133
|
};
|
|
110
134
|
"en-SCT": {
|
|
111
135
|
"teacherFeedback.noComments": string;
|
|
@@ -133,6 +157,12 @@ export declare const LOCALIZATION_CONFIGS: {
|
|
|
133
157
|
onTheWay: string;
|
|
134
158
|
almostThere: string;
|
|
135
159
|
};
|
|
160
|
+
exampleSolution: {
|
|
161
|
+
exampleSolution: string;
|
|
162
|
+
letMeThink: string;
|
|
163
|
+
aha: string;
|
|
164
|
+
errorMessage: string;
|
|
165
|
+
};
|
|
136
166
|
};
|
|
137
167
|
};
|
|
138
168
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/constants.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/constants.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMhC,CAAA"}
|
|
@@ -26,6 +26,12 @@ export declare const setLocalization: import("effector").EventCallable<{
|
|
|
26
26
|
onTheWay: string;
|
|
27
27
|
almostThere: string;
|
|
28
28
|
};
|
|
29
|
+
exampleSolution: {
|
|
30
|
+
exampleSolution: string;
|
|
31
|
+
letMeThink: string;
|
|
32
|
+
aha: string;
|
|
33
|
+
errorMessage: string;
|
|
34
|
+
};
|
|
29
35
|
} | ((config: typeof LOCALIZATION_CONFIGS) => Translations)>;
|
|
30
36
|
export declare const $localization: import("effector").StoreWritable<{
|
|
31
37
|
"teacherFeedback.noComments": string;
|
|
@@ -53,5 +59,11 @@ export declare const $localization: import("effector").StoreWritable<{
|
|
|
53
59
|
onTheWay: string;
|
|
54
60
|
almostThere: string;
|
|
55
61
|
};
|
|
62
|
+
exampleSolution: {
|
|
63
|
+
exampleSolution: string;
|
|
64
|
+
letMeThink: string;
|
|
65
|
+
aha: string;
|
|
66
|
+
errorMessage: string;
|
|
67
|
+
};
|
|
56
68
|
}>;
|
|
57
69
|
//# sourceMappingURL=model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/model.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,YAAY,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAElD,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/model.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,YAAY,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAElD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cACD,OAAO,oBAAoB,KAAK,YAAY,EACpE,CAAA;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMzB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magmamath/students-features",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.13",
|
|
4
4
|
"description": "Magmamath features library",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -24,10 +24,12 @@
|
|
|
24
24
|
"react": "*",
|
|
25
25
|
"react-native": "*",
|
|
26
26
|
"react-native-reanimated": ">=0.3.16",
|
|
27
|
-
"react-native-svg": "^15.10.0"
|
|
27
|
+
"react-native-svg": "^15.10.0",
|
|
28
|
+
"react-native-gesture-handler": "*",
|
|
29
|
+
"react-native-modalfy": "*"
|
|
28
30
|
},
|
|
29
31
|
"devDependencies": {
|
|
30
|
-
"@magmamath/react-native-ui": "0.4.
|
|
32
|
+
"@magmamath/react-native-ui": "0.4.22",
|
|
31
33
|
"effector": "^23.2.3",
|
|
32
34
|
"effector-react": "^23.2.1",
|
|
33
35
|
"@react-native/eslint-config": "^0.73.1",
|
|
@@ -45,6 +47,8 @@
|
|
|
45
47
|
"react-native-builder-bob": "^0.33.3",
|
|
46
48
|
"react-native-reanimated": "^3.17.2",
|
|
47
49
|
"react-native-svg": "^15.10.0",
|
|
50
|
+
"react-native-gesture-handler": "^2.28.0",
|
|
51
|
+
"react-native-modalfy": "^3.7.0",
|
|
48
52
|
"release-it": "^17.10.0",
|
|
49
53
|
"typescript": "^5.2.2"
|
|
50
54
|
},
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { BaseModal, SPACING } from '@magmamath/react-native-ui'
|
|
3
|
+
import { ExampleSolutionModalContent } from './components/ExampleSolutionModalContent'
|
|
4
|
+
import { ExampleSolutionModalParams } from './types'
|
|
5
|
+
|
|
6
|
+
type ExampleSolutionModalComponentProps = {
|
|
7
|
+
modal: {
|
|
8
|
+
closeModal: () => void
|
|
9
|
+
params: ExampleSolutionModalParams
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const ExampleSolutionModal = ({
|
|
14
|
+
modal: { closeModal, params },
|
|
15
|
+
}: ExampleSolutionModalComponentProps) => (
|
|
16
|
+
<BaseModal
|
|
17
|
+
style={{
|
|
18
|
+
container: { paddingHorizontal: SPACING[800] },
|
|
19
|
+
}}
|
|
20
|
+
onClose={closeModal}
|
|
21
|
+
content={
|
|
22
|
+
<ExampleSolutionModalContent
|
|
23
|
+
model={params.model}
|
|
24
|
+
payload={params.payload}
|
|
25
|
+
cacheKey={params.cacheKey}
|
|
26
|
+
/>
|
|
27
|
+
}
|
|
28
|
+
/>
|
|
29
|
+
)
|
|
Binary file
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { StyleSheet, View } from 'react-native'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { COLORS, HeadingVariants, SPACING, Typography } from '@magmamath/react-native-ui'
|
|
4
|
+
import { useUnit } from 'effector-react'
|
|
5
|
+
import { $localization } from '../../../shared/translation'
|
|
6
|
+
import { MessageBlock } from './MessageBlock'
|
|
7
|
+
import { LavaIcon } from './LavaIcon'
|
|
8
|
+
import { ExampleSolutionModalParams } from '../types'
|
|
9
|
+
import { QuestionSection } from './QuestionSection'
|
|
10
|
+
import { SolutionSection } from './SolutionSection'
|
|
11
|
+
import { useExampleSolution } from '../hooks/useExampleSolution'
|
|
12
|
+
|
|
13
|
+
export const ExampleSolutionModalContent = ({
|
|
14
|
+
model,
|
|
15
|
+
payload,
|
|
16
|
+
cacheKey,
|
|
17
|
+
}: ExampleSolutionModalParams) => {
|
|
18
|
+
const { result, status } = useExampleSolution({ model, payload, cacheKey })
|
|
19
|
+
const localization = useUnit($localization)
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<View style={styles.container}>
|
|
23
|
+
<Typography align="center" variant={HeadingVariants.H2} style={{ color: COLORS.NEUTRAL_9 }}>
|
|
24
|
+
{localization.exampleSolution.exampleSolution}
|
|
25
|
+
</Typography>
|
|
26
|
+
<View style={styles.content}>
|
|
27
|
+
<QuestionSection status={status} question={result?.question} />
|
|
28
|
+
<SolutionSection status={status} answer={result?.answer} />
|
|
29
|
+
</View>
|
|
30
|
+
<MessageBlock status={status} style={styles.messageBlock} />
|
|
31
|
+
<LavaIcon status={status} style={styles.lavaIconContainer} />
|
|
32
|
+
</View>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const styles = StyleSheet.create({
|
|
37
|
+
container: {
|
|
38
|
+
width: 880,
|
|
39
|
+
height: 593,
|
|
40
|
+
},
|
|
41
|
+
content: {
|
|
42
|
+
flex: 1,
|
|
43
|
+
flexDirection: 'row',
|
|
44
|
+
marginTop: SPACING[400],
|
|
45
|
+
gap: SPACING[400],
|
|
46
|
+
},
|
|
47
|
+
solutionContainer: {
|
|
48
|
+
width: 351,
|
|
49
|
+
overflow: 'hidden',
|
|
50
|
+
borderRadius: 8,
|
|
51
|
+
borderWidth: 1,
|
|
52
|
+
borderColor: COLORS.NEUTRAL_5,
|
|
53
|
+
},
|
|
54
|
+
lavaIconContainer: {
|
|
55
|
+
position: 'absolute',
|
|
56
|
+
bottom: -54,
|
|
57
|
+
right: -50,
|
|
58
|
+
},
|
|
59
|
+
loaderContainer: {
|
|
60
|
+
paddingTop: 34,
|
|
61
|
+
position: 'absolute',
|
|
62
|
+
width: '100%',
|
|
63
|
+
height: '100%',
|
|
64
|
+
backgroundColor: COLORS.NEUTRAL_1,
|
|
65
|
+
},
|
|
66
|
+
messageBlock: {
|
|
67
|
+
position: 'absolute',
|
|
68
|
+
right: 38,
|
|
69
|
+
bottom: -22,
|
|
70
|
+
},
|
|
71
|
+
})
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { ExcitedLavaIcon } from '../../../shared/icons/ExcitedLavaIcon'
|
|
3
|
+
import { LavaIconInGlasses } from '../../../shared/icons'
|
|
4
|
+
import Animated, { FadeIn, useAnimatedStyle, withTiming } from 'react-native-reanimated'
|
|
5
|
+
import { StyleProp, ViewStyle } from 'react-native'
|
|
6
|
+
import { ExampleSolutionStatuses } from '../constants'
|
|
7
|
+
|
|
8
|
+
const LAVA_ICON_HEIGHT = 112
|
|
9
|
+
|
|
10
|
+
type LavaIconProps = {
|
|
11
|
+
status: ExampleSolutionStatuses
|
|
12
|
+
style?: StyleProp<ViewStyle>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const LavaIcon = ({ status, style }: LavaIconProps) => {
|
|
16
|
+
const opacityAnimation = useAnimatedStyle(() => {
|
|
17
|
+
return {
|
|
18
|
+
opacity: withTiming(status === ExampleSolutionStatuses.LOADING ? 1 : 0, { duration: 500 }),
|
|
19
|
+
}
|
|
20
|
+
}, [status])
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
<Animated.View style={[style, opacityAnimation]}>
|
|
25
|
+
<LavaIconInGlasses height={112} />
|
|
26
|
+
</Animated.View>
|
|
27
|
+
|
|
28
|
+
{status !== ExampleSolutionStatuses.LOADING && (
|
|
29
|
+
<Animated.View style={style} entering={FadeIn}>
|
|
30
|
+
<ExcitedLavaIcon height={LAVA_ICON_HEIGHT} />
|
|
31
|
+
</Animated.View>
|
|
32
|
+
)}
|
|
33
|
+
</>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { StyleProp, StyleSheet, ViewStyle } from 'react-native'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { COLORS, SPACING, Typography } from '@magmamath/react-native-ui'
|
|
4
|
+
import { useUnit } from 'effector-react'
|
|
5
|
+
import { $localization } from '../../../shared/translation'
|
|
6
|
+
import Animated, {
|
|
7
|
+
LinearTransition,
|
|
8
|
+
useAnimatedStyle,
|
|
9
|
+
withDelay,
|
|
10
|
+
withTiming,
|
|
11
|
+
} from 'react-native-reanimated'
|
|
12
|
+
import { ExampleSolutionStatuses } from '../constants'
|
|
13
|
+
|
|
14
|
+
type MessageBlockProps = {
|
|
15
|
+
status: ExampleSolutionStatuses
|
|
16
|
+
style?: StyleProp<ViewStyle>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const MessageBlock = ({ status, style }: MessageBlockProps) => {
|
|
20
|
+
const localization = useUnit($localization)
|
|
21
|
+
|
|
22
|
+
const opacityAnimation = useAnimatedStyle(() => {
|
|
23
|
+
return {
|
|
24
|
+
opacity: withDelay(
|
|
25
|
+
2000,
|
|
26
|
+
withTiming(status === ExampleSolutionStatuses.LOADING ? 1 : 0, { duration: 350 }),
|
|
27
|
+
),
|
|
28
|
+
}
|
|
29
|
+
}, [status])
|
|
30
|
+
|
|
31
|
+
if (status === ExampleSolutionStatuses.CACHE) return null
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<Animated.View
|
|
35
|
+
layout={LinearTransition.duration(250)}
|
|
36
|
+
style={[styles.container, opacityAnimation, style]}
|
|
37
|
+
>
|
|
38
|
+
<Typography variant={'small'} numberOfLines={1}>
|
|
39
|
+
{status === ExampleSolutionStatuses.LOADING
|
|
40
|
+
? localization.exampleSolution.letMeThink
|
|
41
|
+
: localization.exampleSolution.aha}
|
|
42
|
+
</Typography>
|
|
43
|
+
</Animated.View>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const styles = StyleSheet.create({
|
|
48
|
+
container: {
|
|
49
|
+
padding: SPACING[200],
|
|
50
|
+
backgroundColor: COLORS.NEUTRAL_3,
|
|
51
|
+
height: 44,
|
|
52
|
+
borderRadius: 12,
|
|
53
|
+
borderBottomRightRadius: 2,
|
|
54
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
55
|
+
borderColor: COLORS.NEUTRAL_5,
|
|
56
|
+
|
|
57
|
+
shadowColor: COLORS.NEUTRAL_10,
|
|
58
|
+
shadowOffset: {
|
|
59
|
+
width: 0,
|
|
60
|
+
height: 1,
|
|
61
|
+
},
|
|
62
|
+
shadowOpacity: 0.2,
|
|
63
|
+
shadowRadius: 1,
|
|
64
|
+
|
|
65
|
+
elevation: 3,
|
|
66
|
+
},
|
|
67
|
+
})
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { StyleSheet, View, ScrollView } from 'react-native'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { COLORS, Loader, LoaderColor, SPACING, Typography } from '@magmamath/react-native-ui'
|
|
4
|
+
import Animated, { FadeOut } from 'react-native-reanimated'
|
|
5
|
+
import { ExampleSolutionStatuses } from '../constants'
|
|
6
|
+
|
|
7
|
+
type QuestionSectionProps = {
|
|
8
|
+
question?: string
|
|
9
|
+
status: ExampleSolutionStatuses
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const QuestionSection = ({ question, status }: QuestionSectionProps) => {
|
|
13
|
+
return (
|
|
14
|
+
<View style={styles.container}>
|
|
15
|
+
<ScrollView style={styles.scrollView}>
|
|
16
|
+
<Typography>{question}</Typography>
|
|
17
|
+
</ScrollView>
|
|
18
|
+
{status === ExampleSolutionStatuses.LOADING && (
|
|
19
|
+
<Animated.View exiting={FadeOut} style={styles.loaderContainer}>
|
|
20
|
+
<Loader size="large" color={LoaderColor.BLUE} />
|
|
21
|
+
</Animated.View>
|
|
22
|
+
)}
|
|
23
|
+
</View>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const styles = StyleSheet.create({
|
|
28
|
+
container: {
|
|
29
|
+
flex: 1,
|
|
30
|
+
},
|
|
31
|
+
scrollView: {
|
|
32
|
+
flex: 1,
|
|
33
|
+
},
|
|
34
|
+
loaderContainer: {
|
|
35
|
+
paddingTop: 34,
|
|
36
|
+
position: 'absolute',
|
|
37
|
+
width: '100%',
|
|
38
|
+
height: '100%',
|
|
39
|
+
backgroundColor: COLORS.NEUTRAL_1,
|
|
40
|
+
justifyContent: 'flex-start',
|
|
41
|
+
alignItems: 'center',
|
|
42
|
+
},
|
|
43
|
+
errorContainer: {
|
|
44
|
+
position: 'absolute',
|
|
45
|
+
width: '100%',
|
|
46
|
+
height: '100%',
|
|
47
|
+
backgroundColor: COLORS.NEUTRAL_1,
|
|
48
|
+
justifyContent: 'center',
|
|
49
|
+
alignItems: 'center',
|
|
50
|
+
padding: SPACING[400],
|
|
51
|
+
},
|
|
52
|
+
errorText: {
|
|
53
|
+
color: COLORS.PRIMARY_RED,
|
|
54
|
+
textAlign: 'center',
|
|
55
|
+
},
|
|
56
|
+
})
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { StyleSheet, View, Image, Text } from 'react-native'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { COLORS, IS_WEB, SPACING } from '@magmamath/react-native-ui'
|
|
4
|
+
import Animated, { FadeIn } from 'react-native-reanimated'
|
|
5
|
+
import { ExampleSolutionStatuses } from '../constants'
|
|
6
|
+
import gridImage from '../assets/grid.png'
|
|
7
|
+
|
|
8
|
+
type SolutionSectionProps = {
|
|
9
|
+
answer?: string
|
|
10
|
+
status: ExampleSolutionStatuses
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const gridImagePath = !IS_WEB ? Image.resolveAssetSource(gridImage).uri : gridImage
|
|
14
|
+
|
|
15
|
+
export const SolutionSection = ({ answer, status }: SolutionSectionProps) => {
|
|
16
|
+
const shouldShowAnswer =
|
|
17
|
+
answer &&
|
|
18
|
+
(status === ExampleSolutionStatuses.DONE_DATA || status === ExampleSolutionStatuses.CACHE)
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<View style={styles.container}>
|
|
22
|
+
<Image
|
|
23
|
+
source={{ uri: gridImagePath }}
|
|
24
|
+
style={[styles.gridImage, IS_WEB && styles.gridImageWeb]}
|
|
25
|
+
/>
|
|
26
|
+
{shouldShowAnswer && (
|
|
27
|
+
<Animated.ScrollView
|
|
28
|
+
style={styles.solutionScroll}
|
|
29
|
+
contentContainerStyle={styles.solutionScrollContent}
|
|
30
|
+
entering={status === 'cache' ? undefined : FadeIn.delay(1000).duration(500)}
|
|
31
|
+
>
|
|
32
|
+
<Text style={styles.solutionText}>{answer}</Text>
|
|
33
|
+
</Animated.ScrollView>
|
|
34
|
+
)}
|
|
35
|
+
</View>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const styles = StyleSheet.create({
|
|
40
|
+
container: {
|
|
41
|
+
width: 500,
|
|
42
|
+
overflow: 'hidden',
|
|
43
|
+
borderRadius: 8,
|
|
44
|
+
borderWidth: 1,
|
|
45
|
+
borderColor: COLORS.NEUTRAL_5,
|
|
46
|
+
},
|
|
47
|
+
gridImage: {
|
|
48
|
+
width: '100%',
|
|
49
|
+
height: '100%',
|
|
50
|
+
resizeMode: 'cover',
|
|
51
|
+
aspectRatio: 28 / 8,
|
|
52
|
+
},
|
|
53
|
+
gridImageWeb: {
|
|
54
|
+
transform: [{ scale: 3.5 }],
|
|
55
|
+
},
|
|
56
|
+
solutionScroll: {
|
|
57
|
+
position: 'absolute',
|
|
58
|
+
width: '100%',
|
|
59
|
+
height: '100%',
|
|
60
|
+
},
|
|
61
|
+
solutionScrollContent: {
|
|
62
|
+
paddingHorizontal: SPACING[800],
|
|
63
|
+
paddingVertical: SPACING[400],
|
|
64
|
+
},
|
|
65
|
+
solutionText: {
|
|
66
|
+
fontFamily: 'PlaypenSans-Light',
|
|
67
|
+
fontSize: 22,
|
|
68
|
+
},
|
|
69
|
+
})
|