Skip to content

Commit 40770e1

Browse files
committed
added paper plane loading icon & ignore mentor callsign
1 parent 0551458 commit 40770e1

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/components/BookingComponentv3.jsx

+16-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const BookingComponent = () => {
3939
}
4040

4141
const acceptedFIRsRegex = /((EK[A-Z][A-Z]_)|(EF[A-Z][A-Z]_)|(BI[A-Z][A-Z]_)|(EN[A-Z][A-Z]_)|(ES[A-Z][A-Z]_))\w+/i;
42+
const mentorRegex = /((_X_)|(_M_))\w+/i;
4243

4344
function startsWithSameICAO(callsign1, callsign2) {
4445
if (callsign1.substring(0, 2) === callsign2.substring(0, 2)) {
@@ -67,7 +68,7 @@ const BookingComponent = () => {
6768
});
6869

6970
VATSIMNetworkData.controllers.forEach(session => {
70-
if (acceptedFIRsRegex.test(session.callsign)) {
71+
if (acceptedFIRsRegex.test(session.callsign) && !mentorRegex.test(session.callsign)) {
7172
const correctedCallsign = getBookableCallsign(session.callsign, session.frequency);
7273
session.callsign = correctedCallsign;
7374
const existingBooking = dateArray[0].data.find(booking => booking.callsign === session.callsign);
@@ -105,6 +106,15 @@ const BookingComponent = () => {
105106
return (
106107
<table className="w-full h-full px-2">
107108
<tbody className="h-full">
109+
{ControlCenterBookings.length > 0 ? (
110+
""
111+
) : (
112+
<tr className="h-12">
113+
<td colSpan={4}>
114+
<iframe src="https://lottie.host/embed/e516525c-74c1-4db5-b2b2-bb135366e103/W8AodEgALN.json" className="w-full h-full" />
115+
</td>
116+
</tr>
117+
)}
108118
{ControlCenterBookings.map((date, index) => (
109119
<React.Fragment key={index}>
110120
{date.data.length > 0 ?
@@ -124,6 +134,9 @@ const BookingComponent = () => {
124134

125135
</React.Fragment>
126136
))}
137+
{ControlCenterBookings.length < 1 ? (
138+
""
139+
) : (
127140
<tr className="bg-snow dark:bg-secondary w-full font-bold text-black dark:text-white py-4 text-center h-12">
128141
<td colSpan={4} className="underline hover:no-underline text-md">
129142
<a href="https://cc.vatsim-scandinavia.org/booking" target="_blank" className="underline hover:no-underline">
@@ -132,6 +145,8 @@ const BookingComponent = () => {
132145
<ExternalLinkIcon width="0.75rem" marginLeft="0.3rem"/>
133146
</td>
134147
</tr>
148+
)}
149+
135150
</tbody>
136151
</table>
137152
);

0 commit comments

Comments
 (0)