@universal-tennis/ui-shared 0.1.14 → 0.1.15
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/stories/molecules/Cards/DrawCard.d.ts +1 -1
- package/dist/stories/molecules/Cards/DrawCard.js +30 -16
- package/dist/stories/molecules/Cards/DrawCard.js.map +1 -1
- package/dist/stories/molecules/Cards/sharedTypes.d.ts +13 -3
- package/dist/stories/organisms/Tables/Tables.stories.js +10 -10
- package/dist/stories/organisms/Tables/Tables.stories.js.map +1 -1
- package/dist/stories/organisms/Tables/mockData.d.ts +15 -0
- package/dist/stories/organisms/Tables/mockData.js +11 -0
- package/dist/stories/organisms/Tables/mockData.js.map +1 -1
- package/package.json +1 -1
- package/src/stories/molecules/Cards/DrawCard.tsx +76 -33
- package/src/stories/molecules/Cards/sharedTypes.ts +14 -3
- package/src/stories/organisms/Tables/Tables.stories.tsx +10 -10
- package/src/stories/organisms/Tables/mockData.tsx +16 -0
|
@@ -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, emptyLabel, isDisabled, ...props }: DrawCardProps): JSX.Element;
|
|
3
|
+
export default function DrawCard({ options, onChange, onEditClick, selectedOptions, dateLabel, locationLabel, emptyLabel, isDisabled, isSelectActive, isPosition1Winner, isPosition2Winner, isScorelessMatch, position1Team, position2Team, ...props }: DrawCardProps): JSX.Element;
|
|
@@ -14,7 +14,9 @@ import Box from '@mui/material/Box';
|
|
|
14
14
|
import { styled } from '@mui/material/styles';
|
|
15
15
|
import Select from '@mui/material/Select';
|
|
16
16
|
import MenuItem from '@mui/material/MenuItem';
|
|
17
|
-
import { FormControl, InputLabel } from '@mui/material';
|
|
17
|
+
import { Divider, FormControl, InputLabel } from '@mui/material';
|
|
18
|
+
import ClearIcon from '@mui/icons-material/Clear';
|
|
19
|
+
import IconButton from '@mui/material/IconButton';
|
|
18
20
|
import Button from '../../atoms/Button/Button';
|
|
19
21
|
import Typography, { SECONDARY_SIZES_ENUM, CATEGORY_ENUM } from '../../atoms/Typography/Typography';
|
|
20
22
|
const StyledCard = styled(Box)({
|
|
@@ -37,12 +39,12 @@ const BottomGrid = styled(Box)({
|
|
|
37
39
|
justifyContent: 'space-between',
|
|
38
40
|
paddingTop: '32px',
|
|
39
41
|
});
|
|
40
|
-
const
|
|
41
|
-
ONE:
|
|
42
|
-
TWO:
|
|
42
|
+
const positions = {
|
|
43
|
+
ONE: 1,
|
|
44
|
+
TWO: 2,
|
|
43
45
|
};
|
|
44
46
|
export default function DrawCard(_a) {
|
|
45
|
-
var { options, onChange, onEditClick, selectedOptions, dateLabel, locationLabel, emptyLabel, isDisabled } = _a, props = __rest(_a, ["options", "onChange", "onEditClick", "selectedOptions", "dateLabel", "locationLabel", "emptyLabel", "isDisabled"]);
|
|
47
|
+
var { options, onChange, onEditClick, selectedOptions, dateLabel, locationLabel, emptyLabel, isDisabled, isSelectActive, isPosition1Winner, isPosition2Winner, isScorelessMatch, position1Team, position2Team } = _a, props = __rest(_a, ["options", "onChange", "onEditClick", "selectedOptions", "dateLabel", "locationLabel", "emptyLabel", "isDisabled", "isSelectActive", "isPosition1Winner", "isPosition2Winner", "isScorelessMatch", "position1Team", "position2Team"]);
|
|
46
48
|
const { optionOne, optionTwo } = selectedOptions || {};
|
|
47
49
|
const handleOnSelectionChange = (event, position) => {
|
|
48
50
|
const id = event.target.value;
|
|
@@ -51,17 +53,29 @@ export default function DrawCard(_a) {
|
|
|
51
53
|
}
|
|
52
54
|
};
|
|
53
55
|
return (React.createElement(StyledCard, Object.assign({}, props),
|
|
54
|
-
React.createElement(
|
|
55
|
-
React.createElement(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
React.createElement(
|
|
63
|
-
|
|
64
|
-
React.createElement(
|
|
56
|
+
isSelectActive ? (React.createElement(React.Fragment, null,
|
|
57
|
+
React.createElement(FormControl, { style: { display: 'flex', flexDirection: 'row', alignItems: 'center' } },
|
|
58
|
+
React.createElement(InputLabel, { id: "draw-card-select-top" }, emptyLabel),
|
|
59
|
+
React.createElement(StyledMuiSelect, { sx: { width: '100%' }, labelId: "draw-card-select-top", id: "draw-card-select-top", label: emptyLabel, value: optionOne, disabled: isDisabled, onChange: (e) => handleOnSelectionChange(e, positions.ONE) },
|
|
60
|
+
options.map((option) => React.createElement(MenuItem, { key: option.id, value: option.id }, option.label)),
|
|
61
|
+
React.createElement(MenuItem, { sx: { borderTop: '1px solid var(--cool-grey-500)' }, value: "bye" }, "Set bye")),
|
|
62
|
+
React.createElement(IconButton, { onClick: () => onChange({ position: positions.ONE, id: null }), sx: { marginLeft: '8px' }, size: "small" },
|
|
63
|
+
React.createElement(ClearIcon, null))),
|
|
64
|
+
React.createElement(Box, { pt: 2 }),
|
|
65
|
+
React.createElement(FormControl, { style: { display: 'flex', flexDirection: 'row', alignItems: 'center' } },
|
|
66
|
+
React.createElement(InputLabel, { id: "draw-card-select-bot" }, emptyLabel),
|
|
67
|
+
React.createElement(StyledMuiSelect, { sx: { width: '100%' }, labelId: "draw-card-select-bot", id: "draw-card-select-bot", label: emptyLabel, value: optionTwo, disabled: isDisabled, onChange: (e) => handleOnSelectionChange(e, positions.TWO) },
|
|
68
|
+
options.map((option) => React.createElement(MenuItem, { key: option.id, value: option.id }, option.label)),
|
|
69
|
+
React.createElement(MenuItem, { sx: { borderTop: '1px solid var(--cool-grey-500)' }, value: "bye" }, "Set bye")),
|
|
70
|
+
React.createElement(IconButton, { onClick: () => onChange({ position: positions.TWO, id: null }), sx: { marginLeft: '8px' }, size: "small" },
|
|
71
|
+
React.createElement(ClearIcon, null))))) : (React.createElement(React.Fragment, null,
|
|
72
|
+
React.createElement(Box, { display: "flex", justifyContent: "space-between" },
|
|
73
|
+
React.createElement(Typography, { category: "secondary", size: isPosition1Winner ? 'medium-medium' : "medium-book" }, position1Team === null || position1Team === void 0 ? void 0 : position1Team.name),
|
|
74
|
+
React.createElement(Typography, { category: "secondary", size: isPosition1Winner ? 'medium-medium' : "medium-book" }, isScorelessMatch ? '-' : position1Team === null || position1Team === void 0 ? void 0 : position1Team.points)),
|
|
75
|
+
React.createElement(Divider, { sx: { my: 2 } }),
|
|
76
|
+
React.createElement(Box, { display: "flex", justifyContent: "space-between" },
|
|
77
|
+
React.createElement(Typography, { category: "secondary", size: isPosition2Winner ? 'medium-medium' : "medium-book" }, position2Team === null || position2Team === void 0 ? void 0 : position2Team.name),
|
|
78
|
+
React.createElement(Typography, { category: "secondary", size: isPosition2Winner ? 'medium-medium' : "medium-book" }, isScorelessMatch ? '-' : position2Team === null || position2Team === void 0 ? void 0 : position2Team.points)))),
|
|
65
79
|
React.createElement(BottomGrid, null,
|
|
66
80
|
React.createElement(Box, null,
|
|
67
81
|
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,MAA6B,MAAM,sBAAsB,CAAC;AACjE,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
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,mBA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,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"}
|
|
@@ -7,8 +7,12 @@ type Options = {
|
|
|
7
7
|
label: string;
|
|
8
8
|
}[];
|
|
9
9
|
type OnChangeArgs = {
|
|
10
|
-
position:
|
|
11
|
-
id: string;
|
|
10
|
+
position: number;
|
|
11
|
+
id: string | null;
|
|
12
|
+
};
|
|
13
|
+
type PositionTeam = {
|
|
14
|
+
name: string;
|
|
15
|
+
points: number;
|
|
12
16
|
};
|
|
13
17
|
export type DrawCardProps = {
|
|
14
18
|
options: Options;
|
|
@@ -16,9 +20,15 @@ export type DrawCardProps = {
|
|
|
16
20
|
dateLabel: string;
|
|
17
21
|
locationLabel: string;
|
|
18
22
|
isDisabled?: boolean;
|
|
23
|
+
isSelectActive?: boolean;
|
|
24
|
+
isPosition1Winner?: boolean;
|
|
25
|
+
isPosition2Winner?: boolean;
|
|
26
|
+
isScorelessMatch?: boolean;
|
|
27
|
+
position1Team: PositionTeam;
|
|
28
|
+
position2Team: PositionTeam;
|
|
19
29
|
emptyLabel?: string;
|
|
20
30
|
onEditClick?: VoidFunction;
|
|
21
|
-
onChange
|
|
31
|
+
onChange: ({ position, id }: OnChangeArgs) => void;
|
|
22
32
|
};
|
|
23
33
|
export interface TeamCardProps {
|
|
24
34
|
title: string;
|
|
@@ -18,20 +18,20 @@ const headerRows = [
|
|
|
18
18
|
];
|
|
19
19
|
const tableRows = [
|
|
20
20
|
[
|
|
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)),
|
|
21
|
+
React.createElement(DrawCard, Object.assign({ isSelectActive: true, emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
22
|
+
React.createElement(DrawCard, Object.assign({ isSelectActive: true, emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
23
|
+
React.createElement(DrawCard, Object.assign({ isSelectActive: true, emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
24
|
+
React.createElement(DrawCard, Object.assign({ isSelectActive: true, emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
25
|
+
React.createElement(DrawCard, Object.assign({ isSelectActive: true, emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
26
|
+
React.createElement(DrawCard, Object.assign({ isSelectActive: true, emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
27
|
+
React.createElement(DrawCard, Object.assign({ isSelectActive: true, emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
28
|
+
React.createElement(DrawCard, Object.assign({ isSelectActive: true, emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
29
29
|
],
|
|
30
30
|
[
|
|
31
31
|
React.createElement(DrawCard, Object.assign({ emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
32
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)),
|
|
33
|
+
React.createElement(DrawCard, Object.assign({ isScorelessMatch: true, emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
34
|
+
React.createElement(DrawCard, Object.assign({ isScorelessMatch: true, emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
35
35
|
],
|
|
36
36
|
[
|
|
37
37
|
React.createElement(DrawCard, Object.assign({ emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
@@ -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,IAAwB;IACrD,OAAO,oB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B,SAAS,EAAE,KAAK;IAChB,cAAc,EAAE,QAAQ;IACxB,KAAK,EAAE,cAAc;IACrB,SAAS,EAAE,eAAe;IAC1B,YAAY,EAAE,gBAAgB;IAC9B,qBAAqB;CACtB,CAAC"}
|
|
@@ -8,6 +8,10 @@ interface RowProps {
|
|
|
8
8
|
rowData: RowData;
|
|
9
9
|
labelId: string;
|
|
10
10
|
}
|
|
11
|
+
type OnChangeArgs = {
|
|
12
|
+
position: number;
|
|
13
|
+
id: string | null;
|
|
14
|
+
};
|
|
11
15
|
export declare const mockRowComponent: ({ rowData, labelId }: RowProps) => JSX.Element;
|
|
12
16
|
export declare const MOCK_HEAD_CELLS: {
|
|
13
17
|
id: string;
|
|
@@ -29,7 +33,18 @@ export declare const SAMPLE_CARD_DATA: {
|
|
|
29
33
|
optionOne: number;
|
|
30
34
|
optionTwo: number;
|
|
31
35
|
};
|
|
36
|
+
onChange: ({ position, id }: OnChangeArgs) => void;
|
|
32
37
|
dateLabel: string;
|
|
33
38
|
locationLabel: string;
|
|
39
|
+
isPosition1Winner: boolean;
|
|
40
|
+
isPosition2Winner: boolean;
|
|
41
|
+
position1Team: {
|
|
42
|
+
name: string;
|
|
43
|
+
points: number;
|
|
44
|
+
};
|
|
45
|
+
position2Team: {
|
|
46
|
+
name: string;
|
|
47
|
+
points: number;
|
|
48
|
+
};
|
|
34
49
|
};
|
|
35
50
|
export {};
|
|
@@ -62,7 +62,18 @@ export const SAMPLE_CARD_DATA = {
|
|
|
62
62
|
optionOne: 1,
|
|
63
63
|
optionTwo: 2,
|
|
64
64
|
},
|
|
65
|
+
onChange: ({ position, id }) => { },
|
|
65
66
|
dateLabel: 'Dec 20 at 9:00am',
|
|
66
67
|
locationLabel: 'Taube Tennis Center',
|
|
68
|
+
isPosition1Winner: true,
|
|
69
|
+
isPosition2Winner: false,
|
|
70
|
+
position1Team: {
|
|
71
|
+
name: 'Apples',
|
|
72
|
+
points: 10,
|
|
73
|
+
},
|
|
74
|
+
position2Team: {
|
|
75
|
+
name: 'Pears',
|
|
76
|
+
points: 4,
|
|
77
|
+
}
|
|
67
78
|
};
|
|
68
79
|
//# sourceMappingURL=mockData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockData.js","sourceRoot":"","sources":["../../../../src/stories/organisms/Tables/mockData.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"mockData.js","sourceRoot":"","sources":["../../../../src/stories/organisms/Tables/mockData.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAkBhE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,OAAO,EAAE,OAAO,EAAY,EAAE,EAAE;IACjE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAC1C,OAAO,CACH,oBAAC,QAAQ;QACL,oBAAC,SAAS,IACN,SAAS,EAAC,IAAI,EACd,EAAE,EAAE,OAAO,EACX,KAAK,EAAC,KAAK,EACX,OAAO,EAAC,QAAQ;YAEhB,oBAAC,UAAU,QAAE,MAAM,CAAc,CACzB;QACZ,oBAAC,SAAS,IAAC,KAAK,EAAC,MAAM;YACnB,oBAAC,UAAU,QAAE,IAAI,CAAc,CACvB;QACZ,oBAAC,SAAS,IAAC,KAAK,EAAC,MAAM;YACnB,oBAAC,UAAU,QAAE,OAAO,CAAc,CAC1B,CACL,CAEd,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,KAAK,EAAE;IAChE,EAAE,EA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;QACd,MAAM,EAAE,EAAE;KACX;IACD,aAAa,EAAE;QACb,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,CAAC;KACV;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,9 @@ import Box from '@mui/material/Box';
|
|
|
3
3
|
import { styled } from '@mui/material/styles';
|
|
4
4
|
import Select, { SelectChangeEvent } from '@mui/material/Select';
|
|
5
5
|
import MenuItem from '@mui/material/MenuItem';
|
|
6
|
-
import { FormControl, InputLabel } from '@mui/material';
|
|
6
|
+
import { Divider, FormControl, InputLabel } from '@mui/material';
|
|
7
|
+
import ClearIcon from '@mui/icons-material/Clear';
|
|
8
|
+
import IconButton from '@mui/material/IconButton';
|
|
7
9
|
import Button from '../../atoms/Button/Button';
|
|
8
10
|
import Typography, { SECONDARY_SIZES_ENUM, CATEGORY_ENUM } from '../../atoms/Typography/Typography';
|
|
9
11
|
import { DrawCardProps } from "./sharedTypes";
|
|
@@ -32,17 +34,19 @@ const BottomGrid = styled(Box)({
|
|
|
32
34
|
paddingTop: '32px',
|
|
33
35
|
});
|
|
34
36
|
|
|
35
|
-
const
|
|
36
|
-
ONE:
|
|
37
|
-
TWO:
|
|
37
|
+
const positions = {
|
|
38
|
+
ONE: 1,
|
|
39
|
+
TWO: 2,
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
export default function DrawCard({
|
|
41
|
-
options, onChange, onEditClick, selectedOptions, dateLabel, locationLabel,
|
|
43
|
+
options, onChange, onEditClick, selectedOptions, dateLabel, locationLabel,
|
|
44
|
+
emptyLabel, isDisabled, isSelectActive, isPosition1Winner, isPosition2Winner,
|
|
45
|
+
isScorelessMatch, position1Team, position2Team, ...props
|
|
42
46
|
}: DrawCardProps) {
|
|
43
47
|
const { optionOne, optionTwo } = selectedOptions || {};
|
|
44
48
|
|
|
45
|
-
const handleOnSelectionChange = (event: SelectChangeEvent<unknown>, position:
|
|
49
|
+
const handleOnSelectionChange = (event: SelectChangeEvent<unknown>, position: number) => {
|
|
46
50
|
const id = event.target.value as string;
|
|
47
51
|
|
|
48
52
|
if (onChange) {
|
|
@@ -54,34 +58,73 @@ export default function DrawCard({
|
|
|
54
58
|
<StyledCard
|
|
55
59
|
{...props}
|
|
56
60
|
>
|
|
57
|
-
<FormControl>
|
|
58
|
-
<InputLabel id="draw-card-select-top">{emptyLabel}</InputLabel>
|
|
59
|
-
<StyledMuiSelect
|
|
60
|
-
labelId="draw-card-select-top"
|
|
61
|
-
id="draw-card-select-top"
|
|
62
|
-
value={optionOne}
|
|
63
|
-
disabled={isDisabled}
|
|
64
|
-
onChange={(e) => handleOnSelectionChange(e, Positions.ONE)}
|
|
65
|
-
>
|
|
66
|
-
{options.map((option) => <MenuItem key={option.id} value={option.id}>{option.label}</MenuItem>)}
|
|
67
|
-
<MenuItem sx={{ borderTop: '1px solid var(--cool-grey-500)' }} value="bye">Set bye</MenuItem>
|
|
68
|
-
</StyledMuiSelect>
|
|
69
|
-
</FormControl>
|
|
70
61
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
62
|
+
{isSelectActive ? (
|
|
63
|
+
<>
|
|
64
|
+
<FormControl style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
|
|
65
|
+
<InputLabel id="draw-card-select-top">{emptyLabel}</InputLabel>
|
|
66
|
+
<StyledMuiSelect
|
|
67
|
+
sx={{ width: '100%' }}
|
|
68
|
+
labelId="draw-card-select-top"
|
|
69
|
+
id="draw-card-select-top"
|
|
70
|
+
label={emptyLabel}
|
|
71
|
+
value={optionOne}
|
|
72
|
+
disabled={isDisabled}
|
|
73
|
+
onChange={(e) => handleOnSelectionChange(e, positions.ONE)}
|
|
74
|
+
>
|
|
75
|
+
{options.map((option) => <MenuItem key={option.id} value={option.id}>{option.label}</MenuItem>)}
|
|
76
|
+
<MenuItem sx={{ borderTop: '1px solid var(--cool-grey-500)' }} value="bye">Set bye</MenuItem>
|
|
77
|
+
</StyledMuiSelect>
|
|
78
|
+
<IconButton onClick={() => onChange({ position: positions.ONE, id: null })} sx={{ marginLeft: '8px' }} size="small">
|
|
79
|
+
<ClearIcon />
|
|
80
|
+
</IconButton>
|
|
81
|
+
</FormControl>
|
|
82
|
+
|
|
83
|
+
<Box pt={2} />
|
|
84
|
+
<FormControl style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
|
|
85
|
+
<InputLabel id="draw-card-select-bot">{emptyLabel}</InputLabel>
|
|
86
|
+
<StyledMuiSelect
|
|
87
|
+
sx={{ width: '100%' }}
|
|
88
|
+
labelId="draw-card-select-bot"
|
|
89
|
+
id="draw-card-select-bot"
|
|
90
|
+
label={emptyLabel}
|
|
91
|
+
value={optionTwo}
|
|
92
|
+
disabled={isDisabled}
|
|
93
|
+
onChange={(e) => handleOnSelectionChange(e, positions.TWO)}
|
|
94
|
+
>
|
|
95
|
+
{options.map((option) => <MenuItem key={option.id} value={option.id}>{option.label}</MenuItem>)}
|
|
96
|
+
<MenuItem sx={{ borderTop: '1px solid var(--cool-grey-500)' }} value="bye">Set bye</MenuItem>
|
|
97
|
+
</StyledMuiSelect>
|
|
98
|
+
<IconButton onClick={() => onChange({ position: positions.TWO, id: null })} sx={{ marginLeft: '8px' }} size="small">
|
|
99
|
+
<ClearIcon />
|
|
100
|
+
</IconButton>
|
|
101
|
+
</FormControl>
|
|
102
|
+
</>
|
|
103
|
+
) : (
|
|
104
|
+
<>
|
|
105
|
+
<Box display="flex" justifyContent="space-between">
|
|
106
|
+
<Typography
|
|
107
|
+
category="secondary"
|
|
108
|
+
size={isPosition1Winner ? 'medium-medium' : "medium-book"}
|
|
109
|
+
>
|
|
110
|
+
{position1Team?.name}
|
|
111
|
+
</Typography>
|
|
112
|
+
<Typography category="secondary" size={isPosition1Winner ? 'medium-medium' : "medium-book"}>
|
|
113
|
+
{isScorelessMatch ? '-' : position1Team?.points}
|
|
114
|
+
</Typography>
|
|
115
|
+
</Box>
|
|
116
|
+
<Divider sx={{ my: 2 }} />
|
|
117
|
+
<Box display="flex" justifyContent="space-between">
|
|
118
|
+
<Typography category="secondary" size={isPosition2Winner ? 'medium-medium' : "medium-book"}>
|
|
119
|
+
{position2Team?.name}
|
|
120
|
+
</Typography>
|
|
121
|
+
<Typography category="secondary" size={isPosition2Winner ? 'medium-medium' : "medium-book"}>
|
|
122
|
+
{isScorelessMatch ? '-' : position2Team?.points}
|
|
123
|
+
</Typography>
|
|
124
|
+
</Box>
|
|
125
|
+
</>
|
|
126
|
+
)}
|
|
127
|
+
|
|
85
128
|
<BottomGrid>
|
|
86
129
|
|
|
87
130
|
<Box>
|
|
@@ -11,8 +11,13 @@ type Options = {
|
|
|
11
11
|
}[];
|
|
12
12
|
|
|
13
13
|
type OnChangeArgs = {
|
|
14
|
-
position:
|
|
15
|
-
id: string;
|
|
14
|
+
position: number;
|
|
15
|
+
id: string | null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type PositionTeam = {
|
|
19
|
+
name: string;
|
|
20
|
+
points: number;
|
|
16
21
|
}
|
|
17
22
|
|
|
18
23
|
export type DrawCardProps = {
|
|
@@ -21,9 +26,15 @@ export type DrawCardProps = {
|
|
|
21
26
|
dateLabel: string;
|
|
22
27
|
locationLabel: string;
|
|
23
28
|
isDisabled?: boolean;
|
|
29
|
+
isSelectActive?: boolean;
|
|
30
|
+
isPosition1Winner?: boolean;
|
|
31
|
+
isPosition2Winner?: boolean;
|
|
32
|
+
isScorelessMatch?: boolean;
|
|
33
|
+
position1Team: PositionTeam;
|
|
34
|
+
position2Team: PositionTeam;
|
|
24
35
|
emptyLabel?: string;
|
|
25
36
|
onEditClick?: VoidFunction;
|
|
26
|
-
onChange
|
|
37
|
+
onChange: ({ position, id }: OnChangeArgs) => void;
|
|
27
38
|
}
|
|
28
39
|
|
|
29
40
|
export interface TeamCardProps {
|
|
@@ -26,20 +26,20 @@ const headerRows = [
|
|
|
26
26
|
|
|
27
27
|
const tableRows = [
|
|
28
28
|
[
|
|
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} />,
|
|
29
|
+
<DrawCard isSelectActive emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
30
|
+
<DrawCard isSelectActive emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
31
|
+
<DrawCard isSelectActive emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
32
|
+
<DrawCard isSelectActive emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
33
|
+
<DrawCard isSelectActive emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
34
|
+
<DrawCard isSelectActive emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
35
|
+
<DrawCard isSelectActive emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
36
|
+
<DrawCard isSelectActive emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
37
37
|
],
|
|
38
38
|
[
|
|
39
39
|
<DrawCard emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
40
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} />,
|
|
41
|
+
<DrawCard isScorelessMatch emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
42
|
+
<DrawCard isScorelessMatch emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
43
43
|
],
|
|
44
44
|
[
|
|
45
45
|
<DrawCard emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
|
|
@@ -11,6 +11,11 @@ interface RowProps {
|
|
|
11
11
|
rowData: RowData,
|
|
12
12
|
labelId: string;
|
|
13
13
|
}
|
|
14
|
+
|
|
15
|
+
type OnChangeArgs = {
|
|
16
|
+
position: number;
|
|
17
|
+
id: string | null;
|
|
18
|
+
}
|
|
14
19
|
|
|
15
20
|
export const mockRowComponent = ({ rowData, labelId }: RowProps) => {
|
|
16
21
|
const { player, session, team } = rowData;
|
|
@@ -88,6 +93,17 @@ export const SAMPLE_CARD_DATA = {
|
|
|
88
93
|
optionOne: 1,
|
|
89
94
|
optionTwo: 2,
|
|
90
95
|
},
|
|
96
|
+
onChange: ({ position, id }: OnChangeArgs) => {},
|
|
91
97
|
dateLabel: 'Dec 20 at 9:00am',
|
|
92
98
|
locationLabel: 'Taube Tennis Center',
|
|
99
|
+
isPosition1Winner: true,
|
|
100
|
+
isPosition2Winner: false,
|
|
101
|
+
position1Team: {
|
|
102
|
+
name: 'Apples',
|
|
103
|
+
points: 10,
|
|
104
|
+
},
|
|
105
|
+
position2Team: {
|
|
106
|
+
name: 'Pears',
|
|
107
|
+
points: 4,
|
|
108
|
+
}
|
|
93
109
|
};
|