Skip to content

Commit

Permalink
fix: add visual loading bar to lobby (#205)
Browse files Browse the repository at this point in the history
* fix: add visual loading bar to lobby

* style: blue button
  • Loading branch information
edalholt authored Nov 12, 2023
1 parent a9e698e commit a3c3cec
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 0 additions & 2 deletions frontend/src/components/OrganizerGroupBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ export function OrganizerGroupBox({
className={
breakMedium ? classes.buttonStyle : classes.smallButtonStyle
}
color="gray"
onClick={() => handleEditAssemblyClick(group)}
data-testid={editAssemblyTestID}
>
Expand All @@ -120,7 +119,6 @@ export function OrganizerGroupBox({
className={
breakMedium ? classes.buttonStyle : classes.smallButtonStyle
}
color="gray"
onClick={() => handleEditAssemblyClick(group)}
data-testid={editAssemblyTestID}
>
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/components/OrganizerList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,3 @@ export function OrganizerList() {
</>
);
}
function then(arg0: () => void) {
throw new Error("Function not implemented.");
}
2 changes: 1 addition & 1 deletion frontend/src/components/QrCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function QrCode() {
}, []);

return !QRData ? (
<Loader></Loader>
<Loader />
) : (
<QRCodeSVG
bgColor="#ffffff"
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/pages/AssemblyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { WaitingRoom } from "../components/WaitingRoom";
import { VotationBox } from "../components/VotationBox";
import { isUserInAssembly } from "../services/assembly";
import { checkedInState, checkedInType } from "../utils/Context";
import { Box, Image, Text } from "@mantine/core";
import { Box, Image, Loader, Text } from "@mantine/core";
import Arrow from "../assets/Arrow.svg";
import { getCurrentVotationByGroup } from "../services/votation";
import { LimitedVoteType } from "../types/votes";
Expand All @@ -15,6 +15,7 @@ import { NotFound } from "./NotFound";

export function AssemblyLobby() {
let navigate = useNavigate();
const [isLoading, setLoading] = useState<boolean>(true);
const { groupSlug } = useParams() as { groupSlug: string };
const [groupName, setGroupName] = useState<string | undefined>(undefined);
const [groupNotFound, setGroupNotFound] = useState<boolean>(false);
Expand All @@ -28,7 +29,7 @@ export function AssemblyLobby() {
const { lastMessage, getWebSocket } = useWebSocket(
import.meta.env.VITE_SOCKET_URL + "/lobby",
{
//Will attempt to reconnect on all close events, such as server shutting down
// Will attempt to reconnect on all close events, such as server shutting down
shouldReconnect: () => !kickedOut,
// Try to reconnect 300 times before giving up.
// Also possible to change interval (default is 5000ms)
Expand All @@ -54,6 +55,7 @@ export function AssemblyLobby() {
} else {
setCheckedIn(false);
}
setLoading(false);
};
const getGroupName = async () => {
const userData = await getUserData();
Expand Down Expand Up @@ -112,6 +114,8 @@ export function AssemblyLobby() {
return groupNotFound ? (
// Render 404 not found component if group is not found
<NotFound />
) : isLoading ? (
<Loader />
) : (
<>
{!checkedIn && (
Expand Down

0 comments on commit a3c3cec

Please sign in to comment.