@streamlayer/react-ui 0.1.0
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/README.md +7 -0
- package/package.json +38 -0
- package/src/index.d.ts +10 -0
- package/src/index.js +11 -0
- package/src/index.js.map +1 -0
- package/src/lib/demo/Gamification.d.ts +7 -0
- package/src/lib/demo/Gamification.js +21 -0
- package/src/lib/demo/Gamification.js.map +1 -0
- package/src/lib/demo/Login.d.ts +5 -0
- package/src/lib/demo/Login.js +9 -0
- package/src/lib/demo/Login.js.map +1 -0
- package/src/lib/demo/components/InPlayGame.d.ts +6 -0
- package/src/lib/demo/components/InPlayGame.js +6 -0
- package/src/lib/demo/components/InPlayGame.js.map +1 -0
- package/src/lib/demo/components/Notifications.d.ts +6 -0
- package/src/lib/demo/components/Notifications.js +37 -0
- package/src/lib/demo/components/Notifications.js.map +1 -0
- package/src/lib/demo/components/Question.d.ts +7 -0
- package/src/lib/demo/components/Question.js +61 -0
- package/src/lib/demo/components/Question.js.map +1 -0
- package/src/lib/demo/components/QuestionsList.d.ts +6 -0
- package/src/lib/demo/components/QuestionsList.js +13 -0
- package/src/lib/demo/components/QuestionsList.js.map +1 -0
- package/src/lib/demo/components/UserSummary.d.ts +5 -0
- package/src/lib/demo/components/UserSummary.js +11 -0
- package/src/lib/demo/components/UserSummary.js.map +1 -0
- package/src/lib/demo/components/index.d.ts +5 -0
- package/src/lib/demo/components/index.js +6 -0
- package/src/lib/demo/components/index.js.map +1 -0
- package/src/lib/demo/index.d.ts +5 -0
- package/src/lib/demo/index.js +19 -0
- package/src/lib/demo/index.js.map +1 -0
- package/src/lib/demo/styles.d.ts +13 -0
- package/src/lib/demo/styles.js +14 -0
- package/src/lib/demo/styles.js.map +1 -0
- package/src/lib/gamification/inapp/index.d.ts +13 -0
- package/src/lib/gamification/inapp/index.js +12 -0
- package/src/lib/gamification/inapp/index.js.map +1 -0
- package/src/lib/gamification/inapp/styles.d.ts +37 -0
- package/src/lib/gamification/inapp/styles.js +74 -0
- package/src/lib/gamification/inapp/styles.js.map +1 -0
- package/src/lib/gamification/login/index.d.ts +6 -0
- package/src/lib/gamification/login/index.js +49 -0
- package/src/lib/gamification/login/index.js.map +1 -0
- package/src/lib/gamification/login/styles.d.ts +29 -0
- package/src/lib/gamification/login/styles.js +67 -0
- package/src/lib/gamification/login/styles.js.map +1 -0
- package/src/lib/gamification/onboarding/index.d.ts +6 -0
- package/src/lib/gamification/onboarding/index.js +4 -0
- package/src/lib/gamification/onboarding/index.js.map +1 -0
- package/src/lib/gamification/onboarding/styles.d.ts +21 -0
- package/src/lib/gamification/onboarding/styles.js +41 -0
- package/src/lib/gamification/onboarding/styles.js.map +1 -0
- package/src/lib/gamification/question/index.d.ts +5 -0
- package/src/lib/gamification/question/index.js +28 -0
- package/src/lib/gamification/question/index.js.map +1 -0
- package/src/lib/gamification/question/styles.d.ts +45 -0
- package/src/lib/gamification/question/styles.js +80 -0
- package/src/lib/gamification/question/styles.js.map +1 -0
- package/src/lib/gamification/question-list/index.d.ts +8 -0
- package/src/lib/gamification/question-list/index.js +7 -0
- package/src/lib/gamification/question-list/index.js.map +1 -0
- package/src/lib/gamification/question-list/styles.d.ts +13 -0
- package/src/lib/gamification/question-list/styles.js +25 -0
- package/src/lib/gamification/question-list/styles.js.map +1 -0
- package/src/lib/gamification/user-statistics/components/rank/index.d.ts +7 -0
- package/src/lib/gamification/user-statistics/components/rank/index.js +4 -0
- package/src/lib/gamification/user-statistics/components/rank/index.js.map +1 -0
- package/src/lib/gamification/user-statistics/components/rank/styles.d.ts +13 -0
- package/src/lib/gamification/user-statistics/components/rank/styles.js +20 -0
- package/src/lib/gamification/user-statistics/components/rank/styles.js.map +1 -0
- package/src/lib/gamification/user-statistics/components/statistics/index.d.ts +7 -0
- package/src/lib/gamification/user-statistics/components/statistics/index.js +4 -0
- package/src/lib/gamification/user-statistics/components/statistics/index.js.map +1 -0
- package/src/lib/gamification/user-statistics/components/statistics/styles.d.ts +9 -0
- package/src/lib/gamification/user-statistics/components/statistics/styles.js +14 -0
- package/src/lib/gamification/user-statistics/components/statistics/styles.js.map +1 -0
- package/src/lib/gamification/user-statistics/index.d.ts +15 -0
- package/src/lib/gamification/user-statistics/index.js +14 -0
- package/src/lib/gamification/user-statistics/index.js.map +1 -0
- package/src/lib/gamification/user-statistics/styles.d.ts +57 -0
- package/src/lib/gamification/user-statistics/styles.js +98 -0
- package/src/lib/gamification/user-statistics/styles.js.map +1 -0
- package/src/lib/gamification/vote/components/voting-header/components/points/index.d.ts +6 -0
- package/src/lib/gamification/vote/components/voting-header/components/points/index.js +4 -0
- package/src/lib/gamification/vote/components/voting-header/components/points/index.js.map +1 -0
- package/src/lib/gamification/vote/components/voting-header/components/points/styles.d.ts +21 -0
- package/src/lib/gamification/vote/components/voting-header/components/points/styles.js +30 -0
- package/src/lib/gamification/vote/components/voting-header/components/points/styles.js.map +1 -0
- package/src/lib/gamification/vote/components/voting-header/components/timer/index.d.ts +8 -0
- package/src/lib/gamification/vote/components/voting-header/components/timer/index.js +19 -0
- package/src/lib/gamification/vote/components/voting-header/components/timer/index.js.map +1 -0
- package/src/lib/gamification/vote/components/voting-header/components/timer/styles.d.ts +7 -0
- package/src/lib/gamification/vote/components/voting-header/components/timer/styles.js +6 -0
- package/src/lib/gamification/vote/components/voting-header/components/timer/styles.js.map +1 -0
- package/src/lib/gamification/vote/components/voting-header/index.d.ts +12 -0
- package/src/lib/gamification/vote/components/voting-header/index.js +17 -0
- package/src/lib/gamification/vote/components/voting-header/index.js.map +1 -0
- package/src/lib/gamification/vote/components/voting-header/styles.d.ts +35 -0
- package/src/lib/gamification/vote/components/voting-header/styles.js +54 -0
- package/src/lib/gamification/vote/components/voting-header/styles.js.map +1 -0
- package/src/lib/gamification/vote/components/voting-option/index.d.ts +16 -0
- package/src/lib/gamification/vote/components/voting-option/index.js +11 -0
- package/src/lib/gamification/vote/components/voting-option/index.js.map +1 -0
- package/src/lib/gamification/vote/components/voting-option/styles.d.ts +49 -0
- package/src/lib/gamification/vote/components/voting-option/styles.js +85 -0
- package/src/lib/gamification/vote/components/voting-option/styles.js.map +1 -0
- package/src/lib/gamification/vote/index.d.ts +13 -0
- package/src/lib/gamification/vote/index.js +14 -0
- package/src/lib/gamification/vote/index.js.map +1 -0
- package/src/lib/gamification/vote/styles.d.ts +29 -0
- package/src/lib/gamification/vote/styles.js +50 -0
- package/src/lib/gamification/vote/styles.js.map +1 -0
- package/src/lib/theme/index.d.ts +4 -0
- package/src/lib/theme/index.js +5 -0
- package/src/lib/theme/index.js.map +1 -0
- package/src/lib/theme/theme.d.ts +41 -0
- package/src/lib/theme/theme.js +35 -0
- package/src/lib/theme/theme.js.map +1 -0
- package/src/utils/login.d.ts +2 -0
- package/src/utils/login.js +20 -0
- package/src/utils/login.js.map +1 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import PhoneInput, { isValidPhoneNumber, formatPhoneNumberIntl } from 'react-phone-number-input';
|
|
4
|
+
import 'react-phone-number-input/style.css';
|
|
5
|
+
import useDigitInput from 'react-digit-input';
|
|
6
|
+
import * as loginApi from '../../../utils/login';
|
|
7
|
+
import { Timer } from '../vote/components/voting-header/components/timer';
|
|
8
|
+
import { Panel, Digits, Form, FormTitle, FormDescription, FormSubmit, FormInputContainer } from './styles';
|
|
9
|
+
export const Login = ({ login, anonymousLogin }) => {
|
|
10
|
+
const [phoneInput, setPhoneInput] = useState('');
|
|
11
|
+
const [phone, setPhone] = useState('');
|
|
12
|
+
const [code, setCode] = useState('');
|
|
13
|
+
const digits = useDigitInput({
|
|
14
|
+
acceptedCharacters: /^[0-9]$/,
|
|
15
|
+
length: 4,
|
|
16
|
+
value: code,
|
|
17
|
+
onChange: setCode,
|
|
18
|
+
});
|
|
19
|
+
const requestCode = async (e) => {
|
|
20
|
+
e.preventDefault();
|
|
21
|
+
try {
|
|
22
|
+
const parsed = phoneInput.replaceAll('+', '');
|
|
23
|
+
await loginApi.requestLoginCode(parsed);
|
|
24
|
+
setPhone(parsed);
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
window.alert(err);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const loginByCode = async (e) => {
|
|
31
|
+
e.preventDefault();
|
|
32
|
+
if (phone && code) {
|
|
33
|
+
try {
|
|
34
|
+
const token = await loginApi.login(phone, code);
|
|
35
|
+
if (token && login) {
|
|
36
|
+
await login(token);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
console.log('token', token);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
window.alert(err);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return (_jsxs(Panel, { children: [!phone && (_jsxs("div", { children: [_jsxs(Form, { onSubmit: requestCode, children: [_jsx(FormTitle, { children: "Enter your phone number" }), _jsx(FormDescription, { children: "Enter your phone up for number to log in or sign an account." }), _jsx(FormInputContainer, { children: _jsx(PhoneInput, { value: phoneInput, onChange: (val) => setPhoneInput(`${val}`) }) }), _jsx(FormSubmit, { disabled: !isValidPhoneNumber(phoneInput), type: "submit", children: "request code" })] }), anonymousLogin && (_jsx(FormSubmit, { style: { display: 'block', margin: 'auto' }, disabled: true, onClick: anonymousLogin, children: "anonymous login" }))] })), phone && (_jsxs(Form, { onSubmit: loginByCode, children: [_jsx(FormTitle, { children: "Enter Verification Code" }), _jsxs(FormDescription, { children: ["Please enter the verification code ", _jsx("br", {}), "sent to ", _jsx("b", { children: formatPhoneNumberIntl(phoneInput) })] }), _jsxs(Digits, { children: [_jsx("input", { autoFocus: true, inputMode: "decimal", ...digits[0] }), _jsx("input", { inputMode: "decimal", ...digits[1] }), _jsx("input", { inputMode: "decimal", ...digits[2] }), _jsx("input", { inputMode: "decimal", ...digits[3] })] }), _jsx(FormSubmit, { disabled: code.length !== 4, type: "submit", children: "login" }), _jsxs(FormDescription, { children: ["Didn't get 59 the code? ", _jsx("br", {}), "Resend Code in", _jsx(Timer, { duration: 30, setTimeToExpire: () => { }, isPlaying: true })] })] }))] }));
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-ui/src/lib/gamification/login/index.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Panel: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const Form: import("@emotion/styled").StyledComponent<{
|
|
7
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
+
as?: import("react").ElementType<any> | undefined;
|
|
9
|
+
}, import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, {}>;
|
|
10
|
+
export declare const FormTitle: import("@emotion/styled").StyledComponent<{
|
|
11
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
12
|
+
as?: import("react").ElementType<any> | undefined;
|
|
13
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
14
|
+
export declare const FormDescription: import("@emotion/styled").StyledComponent<{
|
|
15
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
16
|
+
as?: import("react").ElementType<any> | undefined;
|
|
17
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
18
|
+
export declare const FormSubmit: import("@emotion/styled").StyledComponent<{
|
|
19
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
20
|
+
as?: import("react").ElementType<any> | undefined;
|
|
21
|
+
}, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
|
|
22
|
+
export declare const FormInputContainer: import("@emotion/styled").StyledComponent<{
|
|
23
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
24
|
+
as?: import("react").ElementType<any> | undefined;
|
|
25
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
26
|
+
export declare const Digits: import("@emotion/styled").StyledComponent<{
|
|
27
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
28
|
+
as?: import("react").ElementType<any> | undefined;
|
|
29
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
export const Panel = styled.div `
|
|
3
|
+
border-radius: 8px;
|
|
4
|
+
padding: 0 12px;
|
|
5
|
+
background-color: ${(props) => props.theme.COLORS.BG_TRANSPARENT_ITEM};
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
height: 100%;
|
|
9
|
+
`;
|
|
10
|
+
export const Form = styled.form `
|
|
11
|
+
display: flex;
|
|
12
|
+
margin: auto;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
align-items: center;
|
|
15
|
+
text-align: center;
|
|
16
|
+
`;
|
|
17
|
+
export const FormTitle = styled.div `
|
|
18
|
+
margin-bottom: 20px;
|
|
19
|
+
font-size: 18px;
|
|
20
|
+
`;
|
|
21
|
+
export const FormDescription = styled.div `
|
|
22
|
+
margin-bottom: 10px;
|
|
23
|
+
font-size: 14px;
|
|
24
|
+
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
`;
|
|
29
|
+
export const FormSubmit = styled.button `
|
|
30
|
+
background-color: ${(props) => props.theme.COLORS.BLUE_QUESTION_ACTION_BTN};
|
|
31
|
+
border: none;
|
|
32
|
+
border-radius: 2px;
|
|
33
|
+
padding: 6px;
|
|
34
|
+
text-transform: uppercase;
|
|
35
|
+
color: #fff;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
|
|
38
|
+
&:disabled {
|
|
39
|
+
opacity: 0.5;
|
|
40
|
+
cursor: default;
|
|
41
|
+
}
|
|
42
|
+
margin-bottom: 20px;
|
|
43
|
+
`;
|
|
44
|
+
export const FormInputContainer = styled.div `
|
|
45
|
+
input {
|
|
46
|
+
font-size: 20px;
|
|
47
|
+
background: transparent;
|
|
48
|
+
color: #fff;
|
|
49
|
+
border: none;
|
|
50
|
+
outline: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
margin-bottom: 40px;
|
|
54
|
+
border-bottom: 1px solid white;
|
|
55
|
+
`;
|
|
56
|
+
export const Digits = styled.div `
|
|
57
|
+
display: flex;
|
|
58
|
+
gap: 10px;
|
|
59
|
+
margin-bottom: 20px;
|
|
60
|
+
|
|
61
|
+
input {
|
|
62
|
+
width: 20px;
|
|
63
|
+
height: 40px;
|
|
64
|
+
font-size: 40px;
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
67
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../../packages/react-ui/src/lib/gamification/login/styles.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAA;AAEpC,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAA;;;sBAGT,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,mBAAmB;;;;CAItE,CAAA;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAA;;;;;;CAM9B,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGlC,CAAA;AACD,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;CAOxC,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAA;sBACjB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,wBAAwB;;;;;;;;;;;;;CAa3E,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;CAW3C,CAAA;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;CAU/B,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { Container, Content, Description, Title, OnboardingActionBtn } from './styles';
|
|
3
|
+
export const Onboarding = ({ action }) => (_jsxs(Container, { children: [_jsxs(Content, { children: [_jsx(Description, { children: "Welcome to the" }), _jsx(Title, { children: "Inplay Game" })] }), _jsx(OnboardingActionBtn, { onClick: action, children: "Let\u2019s play" })] }));
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-ui/src/lib/gamification/onboarding/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAMtF,MAAM,CAAC,MAAM,UAAU,GAA6B,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAClE,MAAC,SAAS,eACR,MAAC,OAAO,eACN,KAAC,WAAW,iCAA6B,EACzC,KAAC,KAAK,8BAAoB,IAClB,EACV,KAAC,mBAAmB,IAAC,OAAO,EAAE,MAAM,gCAAkC,IAC5D,CACb,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Container: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const Content: import("@emotion/styled").StyledComponent<{
|
|
7
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
+
as?: import("react").ElementType<any> | undefined;
|
|
9
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
10
|
+
export declare const Description: import("@emotion/styled").StyledComponent<{
|
|
11
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
12
|
+
as?: import("react").ElementType<any> | undefined;
|
|
13
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
14
|
+
export declare const Title: import("@emotion/styled").StyledComponent<{
|
|
15
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
16
|
+
as?: import("react").ElementType<any> | undefined;
|
|
17
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
18
|
+
export declare const OnboardingActionBtn: import("@emotion/styled").StyledComponent<{
|
|
19
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
20
|
+
as?: import("react").ElementType<any> | undefined;
|
|
21
|
+
}, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
export const Container = styled.div `
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
display: flex;
|
|
5
|
+
color: ${(props) => props.theme.COLORS.WHITE};
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
height: 100%;
|
|
8
|
+
width: 100%;
|
|
9
|
+
`;
|
|
10
|
+
export const Content = styled.div `
|
|
11
|
+
flex: 1;
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
`;
|
|
17
|
+
export const Description = styled.div `
|
|
18
|
+
font-size: 22px;
|
|
19
|
+
font-weight: 300;
|
|
20
|
+
margin-bottom: 4px;
|
|
21
|
+
`;
|
|
22
|
+
export const Title = styled.div `
|
|
23
|
+
font-size: 26px;
|
|
24
|
+
font-weight: 700;
|
|
25
|
+
`;
|
|
26
|
+
export const OnboardingActionBtn = styled.button `
|
|
27
|
+
color: ${(props) => props.theme.COLORS.WHITE};
|
|
28
|
+
width: 100%;
|
|
29
|
+
border: none;
|
|
30
|
+
outline: none;
|
|
31
|
+
background-color: ${(props) => props.theme.COLORS.GREEN_PRIMARY_BTN};
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
padding: 12px 16px;
|
|
34
|
+
display: flex;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
align-items: center;
|
|
37
|
+
font-size: 16px;
|
|
38
|
+
font-weight: 600;
|
|
39
|
+
border-radius: 6px;
|
|
40
|
+
`;
|
|
41
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../../packages/react-ui/src/lib/gamification/onboarding/styles.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAA;AAEpC,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;;WAGxB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;;;;CAI7C,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;CAMhC,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAIpC,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAG9B,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAA;WACrC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;;;;sBAIxB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,iBAAiB;;;;;;;;;CASpE,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { QuestionType, QuestionStatus, PickHistoryStatus } from '@streamlayer/sdk-web-types';
|
|
3
|
+
import iconPoll from '../../../assets/icons/icon-poll.svg';
|
|
4
|
+
import iconPrediction from '../../../assets/icons/icon-prediction.svg';
|
|
5
|
+
import iconTrivia from '../../../assets/icons/icon-trivia.svg';
|
|
6
|
+
import iconSuccess from '../../../assets/icons/icon-check-green.svg';
|
|
7
|
+
import iconError from '../../../assets/icons/icon-cross.svg';
|
|
8
|
+
import iconChevron from '../../../assets/icons/icon-chevron.svg';
|
|
9
|
+
import { Panel, QuestionTypeIconWrap, QuestionTypeIcon, QuestionContent, QuestionTypeLabel, QuestionSubject, QuestionActionTitle, QuestionActionIcon, QuestionStatusIcon, QuestionTypeTitle, ExpiredQuestion, } from './styles';
|
|
10
|
+
const QuestionTypeData = {
|
|
11
|
+
[QuestionType.POLL]: { label: 'Poll', icon: iconPoll },
|
|
12
|
+
[QuestionType.TRIVIA]: { label: 'Trivia', icon: iconTrivia },
|
|
13
|
+
[QuestionType.PREDICTION]: { label: 'Prediction', icon: iconPrediction },
|
|
14
|
+
};
|
|
15
|
+
const QuestionStatusTypeData = {
|
|
16
|
+
[PickHistoryStatus.LOST]: iconError,
|
|
17
|
+
[PickHistoryStatus.WON]: iconSuccess,
|
|
18
|
+
[PickHistoryStatus.UNSET]: iconChevron,
|
|
19
|
+
[PickHistoryStatus.DNP]: iconChevron,
|
|
20
|
+
};
|
|
21
|
+
export const Question = ({ questionId, questionType, questionStatus, subject, openForVoting, openQuestion, status, }) => {
|
|
22
|
+
const questionTypeData = QuestionTypeData[questionType];
|
|
23
|
+
if (questionTypeData === undefined) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return (_jsxs(Panel, { onClick: () => openQuestion?.(questionId), children: [_jsx(QuestionTypeIconWrap, { children: _jsx(QuestionTypeIcon, { alt: "question-type-icon", src: questionTypeData.icon }) }), _jsxs(QuestionContent, { children: [_jsxs(QuestionTypeLabel, { children: [_jsx(QuestionTypeTitle, { children: questionTypeData.label }), questionType === QuestionType.TRIVIA && questionStatus === QuestionStatus.RESOLVED && (_jsx(ExpiredQuestion, { children: "Expired" }))] }), _jsx(QuestionSubject, { children: subject || '' })] }), openForVoting ? (_jsx(QuestionActionTitle, { children: "play" })) : (_jsx(QuestionActionIcon, { children: _jsx(QuestionStatusIcon, { alt: "question-status-icon", src: QuestionStatusTypeData[status] }) }))] }));
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-ui/src/lib/gamification/question/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAoB,MAAM,4BAA4B,CAAA;AAE9G,OAAO,QAAQ,MAAM,qCAAqC,CAAA;AAC1D,OAAO,cAAc,MAAM,2CAA2C,CAAA;AACtE,OAAO,UAAU,MAAM,uCAAuC,CAAA;AAC9D,OAAO,WAAW,MAAM,4CAA4C,CAAA;AACpE,OAAO,SAAS,MAAM,sCAAsC,CAAA;AAC5D,OAAO,WAAW,MAAM,wCAAwC,CAAA;AAEhE,OAAO,EACL,KAAK,EACL,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,GAChB,MAAM,UAAU,CAAA;AAEjB,MAAM,gBAAgB,GAAmE;IACvF,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;IACtD,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE;IAC5D,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE;CACzE,CAAA;AAED,MAAM,sBAAsB,GAA+C;IACzE,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,SAAS;IACnC,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,WAAW;IACpC,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,WAAW;IACtC,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,WAAW;CACrC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAA4E,CAAC,EAChG,UAAU,EACV,YAAY,EACZ,cAAc,EACd,OAAO,EACP,aAAa,EACb,YAAY,EACZ,MAAM,GACP,EAAE,EAAE;IACH,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAA;IAEvD,IAAI,gBAAgB,KAAK,SAAS,EAAE;QAClC,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,CACL,MAAC,KAAK,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,EAAE,CAAC,UAAU,CAAC,aAC9C,KAAC,oBAAoB,cACnB,KAAC,gBAAgB,IAAC,GAAG,EAAC,oBAAoB,EAAC,GAAG,EAAE,gBAAgB,CAAC,IAAI,GAAI,GACpD,EACvB,MAAC,eAAe,eACd,MAAC,iBAAiB,eAChB,KAAC,iBAAiB,cAAE,gBAAgB,CAAC,KAAK,GAAqB,EAC9D,YAAY,KAAK,YAAY,CAAC,MAAM,IAAI,cAAc,KAAK,cAAc,CAAC,QAAQ,IAAI,CACrF,KAAC,eAAe,0BAA0B,CAC3C,IACiB,EACpB,KAAC,eAAe,cAAE,OAAO,IAAI,EAAE,GAAmB,IAClC,EACjB,aAAa,CAAC,CAAC,CAAC,CACf,KAAC,mBAAmB,uBAA2B,CAChD,CAAC,CAAC,CAAC,CACF,KAAC,kBAAkB,cACjB,KAAC,kBAAkB,IAAC,GAAG,EAAC,sBAAsB,EAAC,GAAG,EAAE,sBAAsB,CAAC,MAAM,CAAC,GAAI,GACnE,CACtB,IACK,CACT,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Panel: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const QuestionTypeIconWrap: import("@emotion/styled").StyledComponent<{
|
|
7
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
+
as?: import("react").ElementType<any> | undefined;
|
|
9
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
10
|
+
export declare const QuestionTypeIcon: import("@emotion/styled").StyledComponent<{
|
|
11
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
12
|
+
as?: import("react").ElementType<any> | undefined;
|
|
13
|
+
}, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
14
|
+
export declare const QuestionContent: import("@emotion/styled").StyledComponent<{
|
|
15
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
16
|
+
as?: import("react").ElementType<any> | undefined;
|
|
17
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
18
|
+
export declare const QuestionTypeLabel: import("@emotion/styled").StyledComponent<{
|
|
19
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
20
|
+
as?: import("react").ElementType<any> | undefined;
|
|
21
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
22
|
+
export declare const QuestionSubject: import("@emotion/styled").StyledComponent<{
|
|
23
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
24
|
+
as?: import("react").ElementType<any> | undefined;
|
|
25
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
26
|
+
export declare const QuestionActionTitle: import("@emotion/styled").StyledComponent<{
|
|
27
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
28
|
+
as?: import("react").ElementType<any> | undefined;
|
|
29
|
+
}, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
|
|
30
|
+
export declare const QuestionActionIcon: import("@emotion/styled").StyledComponent<{
|
|
31
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
32
|
+
as?: import("react").ElementType<any> | undefined;
|
|
33
|
+
}, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
|
|
34
|
+
export declare const QuestionStatusIcon: import("@emotion/styled").StyledComponent<{
|
|
35
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
36
|
+
as?: import("react").ElementType<any> | undefined;
|
|
37
|
+
}, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
38
|
+
export declare const QuestionTypeTitle: import("@emotion/styled").StyledComponent<{
|
|
39
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
40
|
+
as?: import("react").ElementType<any> | undefined;
|
|
41
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
42
|
+
export declare const ExpiredQuestion: import("@emotion/styled").StyledComponent<{
|
|
43
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
44
|
+
as?: import("react").ElementType<any> | undefined;
|
|
45
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
export const Panel = styled.div `
|
|
3
|
+
border-radius: 8px;
|
|
4
|
+
padding: 12px;
|
|
5
|
+
background-color: ${(props) => props.theme.COLORS.BG_TRANSPARENT_ITEM};
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
|
|
10
|
+
&:hover {
|
|
11
|
+
background: #000;
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
export const QuestionTypeIconWrap = styled.div `
|
|
15
|
+
padding-right: 12px;
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
`;
|
|
20
|
+
export const QuestionTypeIcon = styled.img `
|
|
21
|
+
width: 16px;
|
|
22
|
+
height: 16px;
|
|
23
|
+
`;
|
|
24
|
+
export const QuestionContent = styled.div `
|
|
25
|
+
font-weight: 700;
|
|
26
|
+
flex: 1;
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
`;
|
|
31
|
+
export const QuestionTypeLabel = styled.div `
|
|
32
|
+
color: ${(props) => props.theme.COLORS.GREY_PRIMARY};
|
|
33
|
+
font-size: 10px;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
text-overflow: ellipsis;
|
|
36
|
+
white-space: nowrap;
|
|
37
|
+
padding-bottom: 5px;
|
|
38
|
+
text-transform: uppercase;
|
|
39
|
+
`;
|
|
40
|
+
export const QuestionSubject = styled.div `
|
|
41
|
+
color: ${(props) => props.theme.COLORS.WHITE};
|
|
42
|
+
font-size: 12px;
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
text-overflow: ellipsis;
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
`;
|
|
47
|
+
export const QuestionActionTitle = styled.button `
|
|
48
|
+
background-color: ${(props) => props.theme.COLORS.BLUE_QUESTION_ACTION_BTN};
|
|
49
|
+
border: none;
|
|
50
|
+
border-radius: 2px;
|
|
51
|
+
font-size: 8px;
|
|
52
|
+
padding: 6px;
|
|
53
|
+
height: 20px;
|
|
54
|
+
text-transform: uppercase;
|
|
55
|
+
color: #fff;
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
`;
|
|
58
|
+
export const QuestionActionIcon = styled.button `
|
|
59
|
+
border: none;
|
|
60
|
+
font-size: 8px;
|
|
61
|
+
padding: 6px;
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
background-color: transparent;
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
`;
|
|
67
|
+
export const QuestionStatusIcon = styled.img `
|
|
68
|
+
width: 16px;
|
|
69
|
+
height: 16px;
|
|
70
|
+
`;
|
|
71
|
+
export const QuestionTypeTitle = styled.span `
|
|
72
|
+
text-transform: uppercase;
|
|
73
|
+
`;
|
|
74
|
+
export const ExpiredQuestion = styled.span `
|
|
75
|
+
text-transform: uppercase;
|
|
76
|
+
border-left: ${(props) => `1px solid ${props.theme.COLORS.GREY_PRIMARY}`};
|
|
77
|
+
padding-left: 5px;
|
|
78
|
+
margin-left: 5px;
|
|
79
|
+
`;
|
|
80
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../../packages/react-ui/src/lib/gamification/question/styles.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAA;AAEpC,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAA;;;sBAGT,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,mBAAmB;;;;;;;;CAQtE,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;CAK7C,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGzC,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;CAMxC,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;WAChC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY;;;;;;;CAOpD,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;WAC9B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;;;;;CAK7C,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAA;sBAC1B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,wBAAwB;;;;;;;;;CAS3E,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAA;;;;;;;;CAQ9C,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAG3C,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAA;;CAE3C,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,IAAI,CAAA;;iBAEzB,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,EAAE;;;CAGzE,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { PickHistory } from '@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb';
|
|
3
|
+
interface QuestionListProps {
|
|
4
|
+
questions: PickHistory[];
|
|
5
|
+
openQuestion: (questionId: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const QuestionList: React.FC<QuestionListProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { Question } from '../question';
|
|
3
|
+
import { Container, Title, ItemsContainer } from './styles';
|
|
4
|
+
export const QuestionList = ({ questions, openQuestion }) => {
|
|
5
|
+
return (_jsxs(Container, { children: [_jsx(Title, { children: "PICK HISTORY" }), _jsx(ItemsContainer, { children: questions?.map((props) => (_jsx(Question, { openQuestion: openQuestion, ...props }, props.questionId))) })] }));
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-ui/src/lib/gamification/question-list/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAO3D,MAAM,CAAC,MAAM,YAAY,GAAgC,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,EAAE;IACvF,OAAO,CACL,MAAC,SAAS,eACR,KAAC,KAAK,+BAAqB,EAC3B,KAAC,cAAc,cACZ,SAAS,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACzB,KAAC,QAAQ,IAAC,YAAY,EAAE,YAAY,KAA6B,KAAK,IAA3B,KAAK,CAAC,UAAU,CAAe,CAC3E,CAAC,GACa,IACP,CACb,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Container: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const Title: import("@emotion/styled").StyledComponent<{
|
|
7
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
+
as?: import("react").ElementType<any> | undefined;
|
|
9
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
10
|
+
export declare const ItemsContainer: import("@emotion/styled").StyledComponent<{
|
|
11
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
12
|
+
as?: import("react").ElementType<any> | undefined;
|
|
13
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
export const Container = styled.div `
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
height: calc(100% - 160px);
|
|
6
|
+
border-radius: 13px;
|
|
7
|
+
`;
|
|
8
|
+
export const Title = styled.div `
|
|
9
|
+
color: ${(props) => props.theme.COLORS.GREY_PRIMARY};
|
|
10
|
+
text-transform: uppercase;
|
|
11
|
+
font-size: 12px;
|
|
12
|
+
font-weight: 500;
|
|
13
|
+
margin-bottom: 8px;
|
|
14
|
+
`;
|
|
15
|
+
export const ItemsContainer = styled.div `
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
overflow-y: auto;
|
|
19
|
+
max-height: 100%;
|
|
20
|
+
|
|
21
|
+
& > div {
|
|
22
|
+
margin-bottom: 8px;
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../../packages/react-ui/src/lib/gamification/question-list/styles.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAA;AAEpC,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;CAKlC,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAA;WACpB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY;;;;;CAKpD,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;CASvC,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { Container, Indicator, Title } from './styles';
|
|
3
|
+
export const Rank = ({ indicator, title }) => (_jsxs(Container, { children: [_jsx(Title, { children: title }), _jsx(Indicator, { children: indicator })] }));
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-ui/src/lib/gamification/user-statistics/components/rank/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAOtD,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACjE,MAAC,SAAS,eACR,KAAC,KAAK,cAAE,KAAK,GAAS,EACtB,KAAC,SAAS,cAAE,SAAS,GAAa,IACxB,CACb,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Container: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const Title: import("@emotion/styled").StyledComponent<{
|
|
7
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
+
as?: import("react").ElementType<any> | undefined;
|
|
9
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
10
|
+
export declare const Indicator: import("@emotion/styled").StyledComponent<{
|
|
11
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
12
|
+
as?: import("react").ElementType<any> | undefined;
|
|
13
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
export const Container = styled.div `
|
|
3
|
+
display: flex;
|
|
4
|
+
justify-content: flex-end;
|
|
5
|
+
align-items: center;
|
|
6
|
+
column-gap: 2px;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
`;
|
|
9
|
+
export const Title = styled.div `
|
|
10
|
+
width: 75px;
|
|
11
|
+
`;
|
|
12
|
+
export const Indicator = styled.div `
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
color: #fff;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
text-overflow: ellipsis;
|
|
17
|
+
white-space: nowrap;
|
|
18
|
+
width: 25px;
|
|
19
|
+
`;
|
|
20
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-ui/src/lib/gamification/user-statistics/components/rank/styles.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAA;AAEpC,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;CAMlC,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAA;;CAE9B,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;CAOlC,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { Container, Indicator } from './styles';
|
|
3
|
+
export const Statistics = ({ indicator, title }) => (_jsxs(Container, { children: [_jsx(Indicator, { children: indicator }), _jsx("p", { children: title })] }));
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-ui/src/lib/gamification/user-statistics/components/statistics/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAO/C,MAAM,CAAC,MAAM,UAAU,GAA8B,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAC7E,MAAC,SAAS,eACR,KAAC,SAAS,cAAE,SAAS,GAAa,EAClC,sBAAI,KAAK,GAAK,IACJ,CACb,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Container: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const Indicator: import("@emotion/styled").StyledComponent<{
|
|
7
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
+
as?: import("react").ElementType<any> | undefined;
|
|
9
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
export const Container = styled.div `
|
|
3
|
+
font-weight: 700;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
row-gap: 4px;
|
|
7
|
+
align-items: center;
|
|
8
|
+
text-align: center;
|
|
9
|
+
`;
|
|
10
|
+
export const Indicator = styled.div `
|
|
11
|
+
font-size: 18px;
|
|
12
|
+
color: #fff;
|
|
13
|
+
`;
|
|
14
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-ui/src/lib/gamification/user-statistics/components/statistics/styles.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAA;AAEpC,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;CAOlC,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGlC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface UserStatisticsProps {
|
|
3
|
+
avatar: string;
|
|
4
|
+
name: string;
|
|
5
|
+
points: number;
|
|
6
|
+
grade: string;
|
|
7
|
+
friendsRank: number;
|
|
8
|
+
globalRank: number;
|
|
9
|
+
winStreak: number;
|
|
10
|
+
correct: number;
|
|
11
|
+
incorrect: number;
|
|
12
|
+
successRate?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const UserStatistics: React.FC<UserStatisticsProps>;
|
|
15
|
+
export {};
|