@universal-tennis/ui-shared 0.1.8 → 0.1.11
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/.storybook/variables.css +1 -0
- package/dist/stories/assets/css/variables.css +1 -0
- package/dist/stories/molecules/Cards/DrawCard.d.ts +1 -1
- package/dist/stories/molecules/Cards/DrawCard.js +12 -5
- package/dist/stories/molecules/Cards/DrawCard.js.map +1 -1
- package/dist/stories/molecules/Cards/sharedTypes.d.ts +2 -0
- package/dist/stories/organisms/Modals/FullPageModal.d.ts +1 -1
- package/dist/stories/organisms/Modals/FullPageModal.js +22 -7
- package/dist/stories/organisms/Modals/FullPageModal.js.map +1 -1
- package/dist/stories/organisms/Tables/Tables.stories.js +14 -14
- package/dist/stories/organisms/Tables/Tables.stories.js.map +1 -1
- package/package.json +1 -1
- package/src/stories/assets/css/variables.css +1 -0
- package/src/stories/molecules/Cards/DrawCard.tsx +13 -5
- package/src/stories/molecules/Cards/sharedTypes.ts +2 -0
- package/src/stories/organisms/Modals/FullPageModal.tsx +14 -7
- package/src/stories/organisms/Tables/Tables.stories.tsx +14 -14
package/.storybook/variables.css
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DrawCardProps } from "./sharedTypes";
|
|
3
|
-
export default function DrawCard({ options, onChange, onEditClick, selectedOptions, dateLabel, locationLabel, ...props }: DrawCardProps): JSX.Element;
|
|
3
|
+
export default function DrawCard({ options, onChange, onEditClick, selectedOptions, dateLabel, locationLabel, emptyLabel, isDisabled, ...props }: DrawCardProps): JSX.Element;
|
|
@@ -12,8 +12,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import Box from '@mui/material/Box';
|
|
14
14
|
import { styled } from '@mui/material/styles';
|
|
15
|
-
import
|
|
15
|
+
import Select from '@mui/material/Select';
|
|
16
16
|
import MenuItem from '@mui/material/MenuItem';
|
|
17
|
+
import { InputLabel, OutlinedInput } from '@mui/material';
|
|
17
18
|
import Button from '../../atoms/Button/Button';
|
|
18
19
|
import Typography, { SECONDARY_SIZES_ENUM, CATEGORY_ENUM } from '../../atoms/Typography/Typography';
|
|
19
20
|
const StyledCard = styled(Box)({
|
|
@@ -27,7 +28,7 @@ const StyledCard = styled(Box)({
|
|
|
27
28
|
cursor: 'pointer'
|
|
28
29
|
},
|
|
29
30
|
});
|
|
30
|
-
const StyledMuiSelect = styled(
|
|
31
|
+
const StyledMuiSelect = styled(Select)({
|
|
31
32
|
border: '1px solid var(--cool-grey-600)',
|
|
32
33
|
});
|
|
33
34
|
const BottomGrid = styled(Box)({
|
|
@@ -41,7 +42,7 @@ const Positions = {
|
|
|
41
42
|
TWO: '2',
|
|
42
43
|
};
|
|
43
44
|
export default function DrawCard(_a) {
|
|
44
|
-
var { options, onChange, onEditClick, selectedOptions, dateLabel, locationLabel } = _a, props = __rest(_a, ["options", "onChange", "onEditClick", "selectedOptions", "dateLabel", "locationLabel"]);
|
|
45
|
+
var { options, onChange, onEditClick, selectedOptions, dateLabel, locationLabel, emptyLabel, isDisabled } = _a, props = __rest(_a, ["options", "onChange", "onEditClick", "selectedOptions", "dateLabel", "locationLabel", "emptyLabel", "isDisabled"]);
|
|
45
46
|
const { optionOne, optionTwo } = selectedOptions || null;
|
|
46
47
|
const handleOnSelectionChange = (event, position) => {
|
|
47
48
|
const id = event.target.value;
|
|
@@ -50,9 +51,15 @@ export default function DrawCard(_a) {
|
|
|
50
51
|
}
|
|
51
52
|
};
|
|
52
53
|
return (React.createElement(StyledCard, Object.assign({}, props),
|
|
53
|
-
React.createElement(
|
|
54
|
+
React.createElement(InputLabel, { id: "draw-card-select-label-top" }, emptyLabel),
|
|
55
|
+
React.createElement(StyledMuiSelect, { labelId: "draw-card-select-label-top", id: "draw-card-select-top", value: optionOne, disabled: isDisabled, label: React.createElement(OutlinedInput, { label: emptyLabel }), onChange: (e) => handleOnSelectionChange(e, Positions.ONE), input: React.createElement(OutlinedInput, { label: emptyLabel }) },
|
|
56
|
+
options.map((option) => React.createElement(MenuItem, { key: option.id, value: option.id }, option.label)),
|
|
57
|
+
React.createElement(MenuItem, { sx: { borderTop: '1px solid var(--cool-grey-500)' }, value: "bye" }, "Set bye")),
|
|
54
58
|
React.createElement(Box, { pt: 1 }),
|
|
55
|
-
React.createElement(
|
|
59
|
+
React.createElement(InputLabel, { id: "draw-card-select-label-bot" }, emptyLabel),
|
|
60
|
+
React.createElement(StyledMuiSelect, { labelId: "draw-card-select-label-bot", id: "draw-card-select-bot", value: optionTwo, disabled: isDisabled, onChange: (e) => handleOnSelectionChange(e, Positions.TWO), input: React.createElement(OutlinedInput, { label: emptyLabel }) },
|
|
61
|
+
options.map((option) => React.createElement(MenuItem, { key: option.id, value: option.id }, option.label)),
|
|
62
|
+
React.createElement(MenuItem, { sx: { borderTop: '1px solid var(--cool-grey-500)' }, value: "bye" }, "Set bye")),
|
|
56
63
|
React.createElement(BottomGrid, null,
|
|
57
64
|
React.createElement(Box, null,
|
|
58
65
|
React.createElement(Typography, { category: CATEGORY_ENUM.SECONDARY, size: SECONDARY_SIZES_ENUM.SmallBook }, dateLabel),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawCard.js","sourceRoot":"","sources":["../../../../src/stories/molecules/Cards/DrawCard.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"DrawCard.js","sourceRoot":"","sources":["../../../../src/stories/molecules/Cards/DrawCard.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,sB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C,GAAG,CAAC,EAC1D,KAAK,EAAE,oBAAC,aAAa,IAAC,KAAK,EAAE,UAAU,GAAI;YAE1C,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,oBAAC,QAAQ,IAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,IAAG,MAAM,CAAC,KAAK,CAAY,CAAC;YAC/F,oBAAC,QAAQ,IAAC,EAAE,EAAE,EAAE,SAAS,EAAE,gCAAgC,EAAE,EAAE,KAAK,EAAC,KAAK,cAAmB,CAC/E;QAClB,oBAAC,UAAU;YAEP,oBAAC,GAAG;gBACA,oBAAC,UAAU,IAAC,QAAQ,EAAE,aAAa,CAAC,SAAS,EAAE,IAAI,EAAE,oBAAoB,CAAC,SAAS,IAC9E,SAAS,CACD;gBACb,oBAAC,UAAU,IAAC,QAAQ,EAAE,aAAa,CAAC,SAAS,EAAE,IAAI,EAAE,oBAAoB,CAAC,SAAS,IAC9E,aAAa,CACL,CACX;YACN,oBAAC,MAAM,IACH,KAAK,EAAE;oBACL,OAAO,EAAE,MAAM;oBACf,cAAc,EAAE,KAAK;iBACtB,EACD,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAC,MAAM;gBAEf,oBAAC,UAAU,IAAC,QAAQ,EAAE,aAAa,CAAC,SAAS,EAAE,IAAI,EAAE,oBAAoB,CAAC,eAAe,WAE5E,CACR,CACA,CACJ,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FullPageModalType } from './sharedTypes';
|
|
3
|
-
declare function FullPageModal({ isOpen, onClose, pageTitle, bottomCTAText, handleBottomCTAClick, isBottomCTAdisabled, PagePopupModal, children, }: FullPageModalType): JSX.Element;
|
|
3
|
+
declare function FullPageModal({ isOpen, onClose, pageTitle, bottomCTAText, handleBottomCTAClick, isBottomCTAdisabled, PagePopupModal, children, ...props }: FullPageModalType): JSX.Element;
|
|
4
4
|
export default FullPageModal;
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
1
12
|
import React from 'react';
|
|
2
13
|
import AppBar from '@mui/material/AppBar';
|
|
3
14
|
import Box from '@mui/material/Box';
|
|
@@ -9,17 +20,18 @@ import Toolbar from '@mui/material/Toolbar';
|
|
|
9
20
|
import Typography from '@mui/material/Typography';
|
|
10
21
|
import Grid from '@mui/material/Grid';
|
|
11
22
|
import Button from '../../atoms/Button/Button';
|
|
12
|
-
function FullPageModal(
|
|
23
|
+
function FullPageModal(_a) {
|
|
24
|
+
var { isOpen, onClose, pageTitle, bottomCTAText, handleBottomCTAClick, isBottomCTAdisabled, PagePopupModal, children } = _a, props = __rest(_a, ["isOpen", "onClose", "pageTitle", "bottomCTAText", "handleBottomCTAClick", "isBottomCTAdisabled", "PagePopupModal", "children"]);
|
|
13
25
|
const handleOnClose = () => {
|
|
14
26
|
onClose();
|
|
15
27
|
};
|
|
16
|
-
return (React.createElement(Box, { position: "relative" },
|
|
28
|
+
return (React.createElement(Box, Object.assign({ position: "relative" }, props),
|
|
17
29
|
React.createElement(Dialog, { PaperProps: {
|
|
18
30
|
style: {
|
|
19
31
|
backgroundColor: 'var(--cool-grey-150)',
|
|
20
32
|
boxShadow: 'none',
|
|
21
33
|
},
|
|
22
|
-
}, fullScreen: true, open: isOpen, onClose:
|
|
34
|
+
}, fullScreen: true, open: isOpen, onClose: handleOnClose },
|
|
23
35
|
React.createElement(AppBar, { sx: { position: 'relative', backgroundColor: 'var(--white)' } },
|
|
24
36
|
React.createElement(Toolbar, null,
|
|
25
37
|
React.createElement(Container, { maxWidth: false },
|
|
@@ -27,10 +39,13 @@ function FullPageModal({ isOpen, onClose, pageTitle, bottomCTAText, handleBottom
|
|
|
27
39
|
React.createElement(Typography, { variant: "h6" }, pageTitle),
|
|
28
40
|
React.createElement(IconButton, { edge: "start", onClick: handleOnClose, "aria-label": "close" },
|
|
29
41
|
React.createElement(CloseIcon, null)))))),
|
|
30
|
-
React.createElement(Grid, {
|
|
31
|
-
|
|
32
|
-
React.createElement(Box, {
|
|
33
|
-
|
|
42
|
+
React.createElement(Grid, { sx: { minHeight: "100vh", paddingBottom: '80px' }, container: true },
|
|
43
|
+
children,
|
|
44
|
+
bottomCTAText && !!handleBottomCTAClick && (React.createElement(Box, { sx: {
|
|
45
|
+
position: "fixed", width: "100%", backgroundColor: 'black', zIndex: 2
|
|
46
|
+
}, p: 2, bottom: 0 },
|
|
47
|
+
React.createElement(Box, { display: "flex", justifyContent: "flex-end" },
|
|
48
|
+
React.createElement(Button, { onClick: handleBottomCTAClick, disabled: isBottomCTAdisabled, category: "secondary-flipped" }, bottomCTAText))))),
|
|
34
49
|
PagePopupModal)));
|
|
35
50
|
}
|
|
36
51
|
export default FullPageModal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FullPageModal.js","sourceRoot":"","sources":["../../../../src/stories/organisms/Modals/FullPageModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAG/C,SAAS,aAAa,CAAC,EACrB,MAAM,EACN,OAAO,EACP,SAAS,EACT,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,QAAQ,
|
|
1
|
+
{"version":3,"file":"FullPageModal.js","sourceRoot":"","sources":["../../../../src/stories/organisms/Modals/FullPageModal.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAG/C,SAAS,aAAa,CAAC,EAUH;QAVG,EACrB,MAAM,EACN,OAAO,EACP,SAAS,EACT,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,QAAQ,OAEU,EADf,KAAK,cATa,gIAUtB,CADS;IAER,MAAM,aAAa,GAAG,GAAG,EAAE;QACzB,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;IAEF,OAAO,CACH,oBAAC,GAAG,kBAAC,QAAQ,EAAC,UAAU,IAAK,KAAK;QAC9B,oBAAC,MAAM,IACH,UAAU,EAAE;gBACV,KAAK,EAAE;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[
|
|
|
18
18
|
];
|
|
19
19
|
const tableRows = [
|
|
20
20
|
[
|
|
21
|
-
React.createElement(DrawCard, Object.assign({}, SAMPLE_CARD_DATA)),
|
|
22
|
-
React.createElement(DrawCard, Object.assign({}, SAMPLE_CARD_DATA)),
|
|
23
|
-
React.createElement(DrawCard, Object.assign({}, SAMPLE_CARD_DATA)),
|
|
24
|
-
React.createElement(DrawCard, Object.assign({}, SAMPLE_CARD_DATA)),
|
|
25
|
-
React.createElement(DrawCard, Object.assign({}, SAMPLE_CARD_DATA)),
|
|
26
|
-
React.createElement(DrawCard, Object.assign({}, SAMPLE_CARD_DATA)),
|
|
27
|
-
React.createElement(DrawCard, Object.assign({}, SAMPLE_CARD_DATA)),
|
|
28
|
-
React.createElement(DrawCard, Object.assign({}, SAMPLE_CARD_DATA)),
|
|
21
|
+
React.createElement(DrawCard, Object.assign({ emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
22
|
+
React.createElement(DrawCard, Object.assign({ emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
23
|
+
React.createElement(DrawCard, Object.assign({ emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
24
|
+
React.createElement(DrawCard, Object.assign({ emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
25
|
+
React.createElement(DrawCard, Object.assign({ emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
26
|
+
React.createElement(DrawCard, Object.assign({ emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
27
|
+
React.createElement(DrawCard, Object.assign({ emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
28
|
+
React.createElement(DrawCard, Object.assign({ emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
29
29
|
],
|
|
30
30
|
[
|
|
31
|
-
React.createElement(DrawCard, Object.assign({}, SAMPLE_CARD_DATA)),
|
|
32
|
-
React.createElement(DrawCard, Object.assign({}, SAMPLE_CARD_DATA)),
|
|
33
|
-
React.createElement(DrawCard, Object.assign({}, SAMPLE_CARD_DATA)),
|
|
34
|
-
React.createElement(DrawCard, Object.assign({}, SAMPLE_CARD_DATA)),
|
|
31
|
+
React.createElement(DrawCard, Object.assign({ emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
32
|
+
React.createElement(DrawCard, Object.assign({ emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
33
|
+
React.createElement(DrawCard, Object.assign({ emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
34
|
+
React.createElement(DrawCard, Object.assign({ emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
35
35
|
],
|
|
36
36
|
[
|
|
37
|
-
React.createElement(DrawCard, Object.assign({}, SAMPLE_CARD_DATA)),
|
|
38
|
-
React.createElement(DrawCard, Object.assign({}, SAMPLE_CARD_DATA)),
|
|
37
|
+
React.createElement(DrawCard, Object.assign({ emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
38
|
+
React.createElement(DrawCard, Object.assign({ emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
39
39
|
],
|
|
40
40
|
];
|
|
41
41
|
// Stories
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tables.stories.js","sourceRoot":"","sources":["../../../../src/stories/organisms/Tables/Tables.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,gCAAgC,CAAC;AACtD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EACL,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,EACrE,MAAM,YAAY,CAAC;AAEpB,MAAM,qBAAqB,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAEvC,UAAU;AACV,eAAe;IACb,KAAK,EAAE,kBAAkB;CAC1B,CAAC;AAEF,YAAY;AACZ,SAAS,qBAAqB,CAAC,I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Box from '@mui/material/Box';
|
|
3
3
|
import { styled } from '@mui/material/styles';
|
|
4
|
-
import
|
|
4
|
+
import Select, { SelectChangeEvent } from '@mui/material/Select';
|
|
5
5
|
import MenuItem from '@mui/material/MenuItem';
|
|
6
|
+
import { InputLabel, OutlinedInput } from '@mui/material';
|
|
6
7
|
import Button from '../../atoms/Button/Button';
|
|
7
8
|
import Typography, { SECONDARY_SIZES_ENUM, CATEGORY_ENUM } from '../../atoms/Typography/Typography';
|
|
8
9
|
import { DrawCardProps } from "./sharedTypes";
|
|
@@ -20,7 +21,7 @@ const StyledCard = styled(Box)({
|
|
|
20
21
|
},
|
|
21
22
|
});
|
|
22
23
|
|
|
23
|
-
const StyledMuiSelect = styled(
|
|
24
|
+
const StyledMuiSelect = styled(Select)({
|
|
24
25
|
border: '1px solid var(--cool-grey-600)',
|
|
25
26
|
});
|
|
26
27
|
|
|
@@ -37,7 +38,7 @@ const Positions = {
|
|
|
37
38
|
};
|
|
38
39
|
|
|
39
40
|
export default function DrawCard({
|
|
40
|
-
options, onChange, onEditClick, selectedOptions, dateLabel, locationLabel, ...props
|
|
41
|
+
options, onChange, onEditClick, selectedOptions, dateLabel, locationLabel, emptyLabel, isDisabled, ...props
|
|
41
42
|
}: DrawCardProps) {
|
|
42
43
|
const { optionOne, optionTwo } = selectedOptions || null;
|
|
43
44
|
|
|
@@ -53,25 +54,32 @@ export default function DrawCard({
|
|
|
53
54
|
<StyledCard
|
|
54
55
|
{...props}
|
|
55
56
|
>
|
|
57
|
+
<InputLabel id="draw-card-select-label-top">{emptyLabel}</InputLabel>
|
|
56
58
|
<StyledMuiSelect
|
|
57
59
|
labelId="draw-card-select-label-top"
|
|
58
60
|
id="draw-card-select-top"
|
|
59
61
|
value={optionOne}
|
|
60
|
-
|
|
62
|
+
disabled={isDisabled}
|
|
63
|
+
label={<OutlinedInput label={emptyLabel} />}
|
|
61
64
|
onChange={(e) => handleOnSelectionChange(e, Positions.ONE)}
|
|
65
|
+
input={<OutlinedInput label={emptyLabel} />}
|
|
62
66
|
>
|
|
63
67
|
{options.map((option) => <MenuItem key={option.id} value={option.id}>{option.label}</MenuItem>)}
|
|
68
|
+
<MenuItem sx={{ borderTop: '1px solid var(--cool-grey-500)' }} value="bye">Set bye</MenuItem>
|
|
64
69
|
</StyledMuiSelect>
|
|
65
70
|
|
|
66
71
|
<Box pt={1} />
|
|
72
|
+
<InputLabel id="draw-card-select-label-bot">{emptyLabel}</InputLabel>
|
|
67
73
|
<StyledMuiSelect
|
|
68
74
|
labelId="draw-card-select-label-bot"
|
|
69
75
|
id="draw-card-select-bot"
|
|
70
76
|
value={optionTwo}
|
|
71
|
-
|
|
77
|
+
disabled={isDisabled}
|
|
72
78
|
onChange={(e) => handleOnSelectionChange(e, Positions.TWO)}
|
|
79
|
+
input={<OutlinedInput label={emptyLabel} />}
|
|
73
80
|
>
|
|
74
81
|
{options.map((option) => <MenuItem key={option.id} value={option.id}>{option.label}</MenuItem>)}
|
|
82
|
+
<MenuItem sx={{ borderTop: '1px solid var(--cool-grey-500)' }} value="bye">Set bye</MenuItem>
|
|
75
83
|
</StyledMuiSelect>
|
|
76
84
|
<BottomGrid>
|
|
77
85
|
|
|
@@ -20,13 +20,14 @@ function FullPageModal({
|
|
|
20
20
|
isBottomCTAdisabled,
|
|
21
21
|
PagePopupModal,
|
|
22
22
|
children,
|
|
23
|
+
...props
|
|
23
24
|
}: FullPageModalType) {
|
|
24
25
|
const handleOnClose = () => {
|
|
25
26
|
onClose();
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
return (
|
|
29
|
-
<Box position="relative">
|
|
30
|
+
<Box position="relative" {...props}>
|
|
30
31
|
<Dialog
|
|
31
32
|
PaperProps={{
|
|
32
33
|
style: {
|
|
@@ -36,7 +37,7 @@ function FullPageModal({
|
|
|
36
37
|
}}
|
|
37
38
|
fullScreen
|
|
38
39
|
open={isOpen}
|
|
39
|
-
onClose={
|
|
40
|
+
onClose={handleOnClose}
|
|
40
41
|
>
|
|
41
42
|
<AppBar sx={{ position: 'relative', backgroundColor: 'var(--white)' }}>
|
|
42
43
|
<Toolbar>
|
|
@@ -50,18 +51,24 @@ function FullPageModal({
|
|
|
50
51
|
</Container>
|
|
51
52
|
</Toolbar>
|
|
52
53
|
</AppBar>
|
|
53
|
-
<Grid
|
|
54
|
+
<Grid sx={{ minHeight: "100vh", paddingBottom: '80px' }} container>
|
|
54
55
|
{children}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
{bottomCTAText && !!handleBottomCTAClick && (
|
|
57
|
+
<Box
|
|
58
|
+
sx={{
|
|
59
|
+
position: "fixed", width: "100%", backgroundColor: 'black', zIndex: 2
|
|
60
|
+
}}
|
|
61
|
+
p={2}
|
|
62
|
+
bottom={0}
|
|
63
|
+
>
|
|
58
64
|
<Box display="flex" justifyContent="flex-end">
|
|
59
65
|
<Button onClick={handleBottomCTAClick} disabled={isBottomCTAdisabled} category="secondary-flipped">
|
|
60
66
|
{bottomCTAText}
|
|
61
67
|
</Button>
|
|
62
68
|
</Box>
|
|
63
69
|
</Box>
|
|
64
|
-
|
|
70
|
+
)}
|
|
71
|
+
</Grid>
|
|
65
72
|
{PagePopupModal}
|
|
66
73
|
</Dialog>
|
|
67
74
|
</Box>
|
|
@@ -26,24 +26,24 @@ const headerRows = [
|
|
|
26
26
|
|
|
27
27
|
const tableRows = [
|
|
28
28
|
[
|
|
29
|
-
<DrawCard {...SAMPLE_CARD_DATA} />,
|
|
30
|
-
<DrawCard {...SAMPLE_CARD_DATA} />,
|
|
31
|
-
<DrawCard {...SAMPLE_CARD_DATA} />,
|
|
32
|
-
<DrawCard {...SAMPLE_CARD_DATA} />,
|
|
33
|
-
<DrawCard {...SAMPLE_CARD_DATA} />,
|
|
34
|
-
<DrawCard {...SAMPLE_CARD_DATA} />,
|
|
35
|
-
<DrawCard {...SAMPLE_CARD_DATA} />,
|
|
36
|
-
<DrawCard {...SAMPLE_CARD_DATA} />,
|
|
29
|
+
<DrawCard emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
30
|
+
<DrawCard emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
31
|
+
<DrawCard emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
32
|
+
<DrawCard emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
33
|
+
<DrawCard emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
34
|
+
<DrawCard emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
35
|
+
<DrawCard emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
36
|
+
<DrawCard emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
37
37
|
],
|
|
38
38
|
[
|
|
39
|
-
<DrawCard {...SAMPLE_CARD_DATA} />,
|
|
40
|
-
<DrawCard {...SAMPLE_CARD_DATA} />,
|
|
41
|
-
<DrawCard {...SAMPLE_CARD_DATA} />,
|
|
42
|
-
<DrawCard {...SAMPLE_CARD_DATA} />,
|
|
39
|
+
<DrawCard emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
40
|
+
<DrawCard emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
41
|
+
<DrawCard emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
42
|
+
<DrawCard emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
43
43
|
],
|
|
44
44
|
[
|
|
45
|
-
<DrawCard {...SAMPLE_CARD_DATA} />,
|
|
46
|
-
<DrawCard {...SAMPLE_CARD_DATA} />,
|
|
45
|
+
<DrawCard emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
46
|
+
<DrawCard emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
47
47
|
],
|
|
48
48
|
];
|
|
49
49
|
|