@@ -137,7 +136,6 @@ const DoublesLeaderboard = () => {
),
},
{
- name: "Player 2",
cell: row => (
![]()
{
const columns: TableColumn
[] = useMemo(
() => [
{
- name: "Avatar",
cell: row => (
),
diff --git a/src/components/StartNewGame/StartNewGame.tsx b/src/components/StartNewGame/StartNewGame.tsx
index 43d6555..0c56085 100644
--- a/src/components/StartNewGame/StartNewGame.tsx
+++ b/src/components/StartNewGame/StartNewGame.tsx
@@ -23,6 +23,7 @@ import { useSnackbar } from "notistack"
import { customStyles } from "../Tables/CustomStyles"
import parseError from "../../utils/ErrorUtils"
import moment from "moment"
+import { FormatName } from "../../utils/FormattingUtils"
const StartNewGame = () => {
const dispatch = useAppDispatch()
@@ -94,6 +95,7 @@ const StartNewGame = () => {
{
name: "Player",
selector: row => row.name,
+ format: row => FormatName(row.name),
sortable: true,
},
{
diff --git a/src/utils/FormattingUtils.ts b/src/utils/FormattingUtils.ts
new file mode 100644
index 0000000..63f2398
--- /dev/null
+++ b/src/utils/FormattingUtils.ts
@@ -0,0 +1,10 @@
+export const FormatName = (name: string) =>
+ name
+ .split(" ")
+ .map(word =>
+ word.length < 3
+ ? word
+ : word.charAt(0).toUpperCase() +
+ word.slice(1).toLocaleLowerCase(),
+ )
+ .join(" ")