mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-10-01 07:37:55 -05:00
a bit of refactoring
This commit is contained in:
@@ -4,7 +4,11 @@ import { useQueryParams, StringParam, NumberParam } from "use-query-params"
|
||||
|
||||
import Loading from "../common/Loading"
|
||||
import Error from "../common/Error"
|
||||
import { SEARCH_FOR_PLACEMENTS } from "../../graphql/queries/searchForPlacements"
|
||||
import {
|
||||
SEARCH_FOR_PLACEMENTS,
|
||||
SearchForPlacementsData,
|
||||
SearchForPlacementsVars,
|
||||
} from "../../graphql/queries/searchForPlacements"
|
||||
import WpnImage from "../common/WeaponImage"
|
||||
import { months, modesShort } from "../../utils/lists"
|
||||
import { RouteComponentProps } from "@reach/router"
|
||||
@@ -24,38 +28,6 @@ import PageHeader from "../common/PageHeader"
|
||||
import Button from "../elements/Button"
|
||||
import Alert from "../elements/Alert"
|
||||
|
||||
interface Placement {
|
||||
id: string
|
||||
mode: number
|
||||
name: string
|
||||
player?: {
|
||||
twitter: string
|
||||
}
|
||||
rank: number
|
||||
unique_id: string
|
||||
weapon: string
|
||||
x_power: number
|
||||
month: number
|
||||
year: number
|
||||
}
|
||||
|
||||
interface SearchForPlacementsData {
|
||||
searchForPlacements: {
|
||||
placements: Placement[]
|
||||
pageCount: number
|
||||
}
|
||||
}
|
||||
|
||||
interface SearchForPlacementsVars {
|
||||
page?: number
|
||||
name?: string
|
||||
weapon?: string
|
||||
mode?: number
|
||||
unique_id?: string
|
||||
month?: number
|
||||
year?: number
|
||||
}
|
||||
|
||||
const Top500BrowserPage: React.FC<RouteComponentProps> = () => {
|
||||
const { themeColorWithShade } = useContext(MyThemeContext)
|
||||
const isSmall = useBreakPoints(640)
|
||||
|
||||
@@ -1,5 +1,38 @@
|
||||
import { gql, DocumentNode } from "apollo-boost"
|
||||
|
||||
interface Placement {
|
||||
id: string
|
||||
mode: number
|
||||
name: string
|
||||
player?: {
|
||||
twitter: string
|
||||
discord_id?: string
|
||||
}
|
||||
rank: number
|
||||
unique_id: string
|
||||
weapon: string
|
||||
x_power: number
|
||||
month: number
|
||||
year: number
|
||||
}
|
||||
|
||||
export interface SearchForPlacementsData {
|
||||
searchForPlacements: {
|
||||
placements: Placement[]
|
||||
pageCount: number
|
||||
}
|
||||
}
|
||||
|
||||
export interface SearchForPlacementsVars {
|
||||
page?: number
|
||||
name?: string
|
||||
weapon?: string
|
||||
mode?: number
|
||||
unique_id?: string
|
||||
month?: number
|
||||
year?: number
|
||||
}
|
||||
|
||||
export const SEARCH_FOR_PLACEMENTS: DocumentNode = gql`
|
||||
query searchForPlacements(
|
||||
$name: String
|
||||
|
||||
Reference in New Issue
Block a user