Skip to content

Commit

Permalink
Fix viewPage, remove shuffle
Browse files Browse the repository at this point in the history
  • Loading branch information
SheepTester committed Mar 30, 2024
1 parent f05c5eb commit d717bfa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 22 deletions.
10 changes: 10 additions & 0 deletions src/components/admin/event/AdminPickupEvent/style.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
h1 {
font-size: 2rem;
}

.viewPage {
background-color: var(--theme-primary-2);
border-radius: 0.5rem;
color: var(--theme-background);
display: flex;
font-weight: bold;
gap: 0.5rem;
padding: 0.5rem;
}
}

.form {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export type Styles = {
form: string;
header: string;
submitButtons: string;
viewPage: string;
};

export type ClassNames = keyof Styles;
Expand Down
22 changes: 0 additions & 22 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,25 +450,3 @@ export function seededRandom(a: number, b: number, c: number, d: number): () =>
/* eslint-enable no-bitwise, no-param-reassign */
};
}

/**
* Shuffles an array in place using a Fisher–Yates shuffle.
* @param arr Array to shuffle
* @param random A producer of random numbers in the range [0, 1)
* @returns The same array object
*/
export function shuffle<T extends {}>(array: T[], random = Math.random): T[] {
const arr = array;
for (let i = arr.length; i > 0; i -= 1) {
const index = Math.floor(random() * i);
if (index !== i - 1) {
const a = arr[i - 1];
const b = arr[index];
if (a !== undefined && b !== undefined) {
arr[i - 1] = b;
arr[index] = a;
}
}
}
return arr;
}

0 comments on commit d717bfa

Please sign in to comment.