-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
196 lines (174 loc) · 4.61 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
import { useSelector } from "react-redux";
import styled from "styled-components";
import tw from "twin.macro";
import { useParams } from "react-router-dom";
import {
useGetTourneyQuery
} from '../../../redux/TourneyApi';
import {
NormalText,
BoldText,
Text
} from '../../../components/Text';
import {
FlexContainer,
WrapContainer
} from '../../../components/base';
import Button, { IconButton } from '../../../components/Button';
import { RiRefreshLine, RiFilter3Fill } from "react-icons/ri";
import { AiOutlineFileDone } from "react-icons/ai";
import { MdOutlineCancel } from "react-icons/md";
const Container = styled.div`
${tw`
`}
`;
const CountText = styled(Text)`
${tw`
font-bold
text-5xl
`}
`;
const CounterCardContainer = styled(FlexContainer)`
${tw`
max-w-[6rem]
w-full
flex
flex-col
justify-center
items-center
`}
`;
const RegStatsContainer = styled(WrapContainer)`
background-color: black;
${tw`
bg-black
p-6
gap-6
flex
justify-between
rounded-md
shadow-md
`}
`;
const Table = styled.table`
border-collapse: collapse;
box-shadow: 0 5px 10px black;
background-color: black;
text-align: left;
border-radius: 5px;
color: white;
`;
const THead = styled.th`
padding: 1rem 2rem;
text-transform: uppercase;
letter-spacing: 0.05rem;
font-size: 1rem;
font-weight: 800;
`;
const TData = styled.td`
padding: 0.7rem 2rem;
font-size: 0.9rem;
font-weight: 600;
`;
const TRow = styled.tr`
&:nth-child(event) {
background-color: #f40b41;
color: white;
}
`;
export default function Participants(){
const { tourneyId } = useParams();
const { data: tourney, error } = useGetTourneyQuery(tourneyId);
return (
<Container>
<FlexContainer justify='space-between'>
<Text fontSize='2rem'
fontWeight='700'> Participants </Text>
</FlexContainer>
<RegStatsContainer>
<CounterCardContainer direction="col">
<CountText>1</CountText>
<Text fontSize="1.2rem" fontWeight="700">
Total
</Text>
</CounterCardContainer>
<CounterCardContainer direction="col">
<CountText>1</CountText>
<Text fontSize="1.2rem" fontWeight="700">
Pending
</Text>
</CounterCardContainer>
<CounterCardContainer direction="col">
<CountText>1</CountText>
<Text fontSize="1.2rem" fontWeight="700">
Refused
</Text>
</CounterCardContainer>
<CounterCardContainer direction="col">
<CountText>1</CountText>
<Text fontSize="1.2rem" fontWeight="700">
Accepted
</Text>
</CounterCardContainer>
<CounterCardContainer direction="col">
<CountText>1</CountText>
<Text fontSize="1.2rem" fontWeight="700">
Cancelled
</Text>
</CounterCardContainer>
</RegStatsContainer>
<FlexContainer justify="space-between">
<FlexContainer direction="col">
<Text fontSize="1.5rem" fontWeight="700">
List of Participants
</Text>
<NormalText> Last Update </NormalText>
<NormalText> 5/22/2022 </NormalText>
</FlexContainer>
<FlexContainer gap="1rem">
<IconButton icon={<RiRefreshLine size="20" color="white" />}>
Refresh
</IconButton>
<IconButton icon={<RiFilter3Fill size="20" color="white" />}>
Show filters
</IconButton>
</FlexContainer>
</FlexContainer>
<Table>
<thead>
<TRow>
<THead> Status </THead>
<THead> Player ID </THead>
<THead> Reg ID </THead>
<THead> Registered Date </THead>
<THead> Actions </THead>
</TRow>
</thead>
<tbody>
{!error && tourney.members.map((m) => {
return (
<TRow>
<TData> { m.status } </TData>
<TData> { m.member_id } </TData>
<TData> { m.reg_id} </TData>
<TData> N/A </TData>
<TData>
<FlexContainer gap="0.4rem">
<IconButton
pad={"0.4rem"}
icon={<AiOutlineFileDone size="20" color="green" />}
></IconButton>
<IconButton
pad={"0.4rem"}
icon={<MdOutlineCancel size="20" color="red" />}
></IconButton>
</FlexContainer>
</TData>
</TRow>
);
})}
</tbody>
</Table>
</Container>
);
}