Skip to content

Commit

Permalink
fix(src): 🐛 Replace usages for username
Browse files Browse the repository at this point in the history
  • Loading branch information
Nudelsuppe42 committed Aug 21, 2024
1 parent e5d24e6 commit b7da3cb
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 28 deletions.
21 changes: 11 additions & 10 deletions src/pages/map/edit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
Tooltip,
rem,
} from '@mantine/core';
import { useClipboard, useDebouncedState } from '@mantine/hooks';
import {
IconArrowsDiff,
IconBrandMinecraft,
Expand All @@ -49,25 +48,26 @@ import {
SnapPointMode,
SnapPolygonMode,
} from 'mapbox-gl-draw-snap-mode';
import { useClipboard, useDebouncedState } from '@mantine/hooks';
import { useEffect, useState } from 'react';

import { useContextMenu } from '@/components/ContextMenu';
import Page from '@/components/Page';
import { ClaimDrawerImages } from '@/components/map/ClaimDrawerImages';
import { Discord } from '@icons-pack/react-simple-icons';
import Map from '@/components/map/Map';
import { MapContextMenu } from '@/components/map/MapContextMenu';
import { useAccessToken } from '@/hooks/useAccessToken';
import { usePermissions } from '@/hooks/usePermissions';
import { useUser } from '@/hooks/useUser';
import { Discord } from '@icons-pack/react-simple-icons';
import { modals } from '@mantine/modals';
import { showNotification } from '@mantine/notifications';
import MapboxDraw from '@mapbox/mapbox-gl-draw';
import { NextPage } from 'next';
import Page from '@/components/Page';
import { modals } from '@mantine/modals';
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
import { showNotification } from '@mantine/notifications';
import { useAccessToken } from '@/hooks/useAccessToken';
import { useContextMenu } from '@/components/ContextMenu';
import { usePermissions } from '@/hooks/usePermissions';
import { useRouter } from 'next/router';
import { useTranslation } from 'react-i18next';
import useSWR from 'swr';
import { useTranslation } from 'react-i18next';
import { useUser } from '@/hooks/useUser';

const ClaimEditPage: NextPage = () => {
const { t } = useTranslation('map');
Expand Down Expand Up @@ -126,6 +126,7 @@ const ClaimEditPage: NextPage = () => {

useEffect(() => {
if (selected) {
console.log(selected);
if (selected.properties?.new == true) {
draw.setFeatureProperty(selected.id, 'new', undefined);
draw
Expand Down
20 changes: 10 additions & 10 deletions src/pages/me/claims/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
Tooltip,
rem,
} from '@mantine/core';
import { useClipboard, useDebouncedState } from '@mantine/hooks';
import {
IconBrandMinecraft,
IconCheck,
Expand All @@ -32,23 +31,24 @@ import {
IconPlus,
IconTrash,
} from '@tabler/icons-react';
import { useClipboard, useDebouncedState } from '@mantine/hooks';
import { useEffect, useState } from 'react';

import Page from '@/components/Page';
import { ClaimDrawerImages } from '@/components/map/ClaimDrawerImages';
import Map from '@/components/map/Map';
import { useAccessToken } from '@/hooks/useAccessToken';
import { useUser } from '@/hooks/useUser';
import thumbnail from '@/public/images/thumbnails/me.png';
import fetcher from '@/utils/Fetcher';
import { Discord } from '@icons-pack/react-simple-icons';
import { showNotification } from '@mantine/notifications';
import Link from 'next/link';
import Map from '@/components/map/Map';
import MapboxDraw from '@mapbox/mapbox-gl-draw';
import { NextPage } from 'next';
import Page from '@/components/Page';
import fetcher from '@/utils/Fetcher';
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
import Link from 'next/link';
import { showNotification } from '@mantine/notifications';
import thumbnail from '@/public/images/thumbnails/me.png';
import { useAccessToken } from '@/hooks/useAccessToken';
import { useRouter } from 'next/router';
import { useTranslation } from 'react-i18next';
import { useUser } from '@/hooks/useUser';

/* eslint-disable react-hooks/exhaustive-deps */

Expand Down Expand Up @@ -324,7 +324,7 @@ const ClaimPage: NextPage = ({ claimId, data }: any) => {
</MenuItem>
<MenuItem
leftSection={<IconBrandMinecraft />}
disabled={!builder.name}
disabled={!builder.name} /* TODO */
onClick={() => clipboard.copy(builder.name)}
>
Copy Minecraft Name
Expand Down
6 changes: 5 additions & 1 deletion src/pages/me/review.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Avatar, Badge, Button, Group, Table, Tooltip } from '@mantine/core';
import { Avatar, Badge, Button, Code, Group, Table, Tooltip } from '@mantine/core';

import Page from '@/components/Page';
import { useUser } from '@/hooks/useUser';
Expand Down Expand Up @@ -33,6 +33,7 @@ const ReviewPage: NextPage = () => {
<Table.Th>Id</Table.Th>
<Table.Th>Team</Table.Th>
<Table.Th>Status</Table.Th>
<Table.Th>Username</Table.Th>
<Table.Th>Created At</Table.Th>
<Table.Th></Table.Th>
</Table.Tr>
Expand Down Expand Up @@ -67,6 +68,9 @@ const ReviewPage: NextPage = () => {
Needs Review
</Badge>
</Table.Td>
<Table.Td>
<Code fz="sm">{a.user.username}</Code>
</Table.Td>
<Table.Td>
<Tooltip
withinPortal
Expand Down
7 changes: 4 additions & 3 deletions src/pages/teams/[team]/manage/review/[id].tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable react-hooks/exhaustive-deps */

import {
ActionIcon,
Alert,
Expand All @@ -23,8 +24,8 @@ import Page from '@/components/Page';
import SettingsTabs from '@/components/SettingsTabs';
import { useAccessToken } from '@/hooks/useAccessToken';
import thumbnail from '@/public/images/thumbnails/apply.png';
import fetcher from '@/utils/Fetcher';
import { ApplicationQuestions } from '@/utils/application/ApplicationQuestions';
import fetcher from '@/utils/Fetcher';
import { useClipboard } from '@mantine/hooks';
import { modals } from '@mantine/modals';
import { showNotification } from '@mantine/notifications';
Expand Down Expand Up @@ -200,7 +201,7 @@ const Apply: NextPage = ({ team, id }: any) => {
<Text>Discord Name</Text>
<Tooltip label={'Click to copy ID'}>
<Group>
<Text>{data?.user?.discordName} </Text>
<Text>{data?.user?.username} </Text>
<ActionIcon
variant="light"
color="gray"
Expand Down Expand Up @@ -240,7 +241,7 @@ const Apply: NextPage = ({ team, id }: any) => {
<Divider style={{ margin: '0' }} my="sm" />
<Group justify="space-between">
<Text>Reviewer</Text>
<Text>{data?.reviewer?.discordName} </Text>
<Text>{data?.reviewer?.username} </Text>
</Group>
</>
)}
Expand Down
14 changes: 10 additions & 4 deletions src/pages/teams/[team]/manage/review/index.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
import {
ActionIcon,
Badge,
Code,
Group,
Pagination,
SimpleGrid,
Table,
Text,
Tooltip,
useMantineTheme,
} from '@mantine/core';
import { IconCheck, IconClock, IconQuestionMark, IconX } from '@tabler/icons-react';

import { IconChevronRight } from '@tabler/icons-react';
import Link from 'next/link';
import Page from '@/components/Page';
import SettingsTabs from '@/components/SettingsTabs';
import { StatsRing } from '@/components/Stats';
import thumbnail from '@/public/images/thumbnails/teams.png';
import fetcher from '@/utils/Fetcher';
import { IconChevronRight } from '@tabler/icons-react';
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
import Link from 'next/link';
import { useState } from 'react';
import thumbnail from '@/public/images/thumbnails/teams.png';
import useSWR from 'swr';
import { useState } from 'react';

var vagueTime = require('vague-time');
const Review = ({ team }: any) => {
Expand Down Expand Up @@ -92,6 +94,7 @@ const Review = ({ team }: any) => {
<Table.Tr>
<Table.Th>Id</Table.Th>
<Table.Th>Status</Table.Th>
<Table.Th>Username</Table.Th>
<Table.Th>Trial</Table.Th>
<Table.Th>Created At</Table.Th>
<Table.Th></Table.Th>
Expand Down Expand Up @@ -131,6 +134,9 @@ const Review = ({ team }: any) => {
</Badge>
)}
</Table.Td>
<Table.Td>
<Code fz="sm">{a.user.username}</Code>
</Table.Td>
<Table.Td>{a.trial ? 'Yes' : 'No'}</Table.Td>
<Table.Td>
<Tooltip
Expand Down

0 comments on commit b7da3cb

Please sign in to comment.