-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f57d3f
commit c96e1ab
Showing
24 changed files
with
986 additions
and
1,401 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/types/global" /> | ||
|
||
declare module "*.graphql" { | ||
import { DocumentNode } from "graphql"; | ||
const Schema: DocumentNode; | ||
|
||
export = Schema; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { FC } from 'react'; | ||
import { AutoGrid } from '@/components/AutoGrid'; | ||
import { CardSkeleton } from '@/components/Skeleton'; | ||
|
||
export type Placeholder = { count?: number; }; | ||
|
||
export const Placeholder: FC<Placeholder> = ({ count = 10 }) => ( | ||
<AutoGrid gridGap={[20]}> | ||
{Array(count).fill(null).map((i) => <CardSkeleton key={`${i}-skeleton`} />)} | ||
</AutoGrid> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import useSWR from "swr"; | ||
import { | ||
client, | ||
everything, | ||
StationRequest, | ||
StationSearchInput, | ||
} from "@/graphql"; | ||
|
||
export function useStations( | ||
search: StationSearchInput, | ||
station: StationRequest = everything | ||
) { | ||
const fetcher = () => client.query({ stations: [{ search }, station] }); | ||
return useSWR(JSON.stringify({ search, station }), fetcher); | ||
} | ||
|
||
export function useStationsByUUID( | ||
uuids: string[], | ||
station: StationRequest = everything | ||
) { | ||
const fetcher = (uuids: string[]) => | ||
client.query({ stationsByUUID: [{ uuids }, station] }); | ||
return useSWR([uuids], fetcher); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from "@/genql"; | ||
import { createClient } from "@/genql"; | ||
export const client = createClient({ url: "/api/graphql" }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
type Query { | ||
stations(search: StationSearchInput): [Station!]! | ||
stationsByUUID(uuids: [String!]!): [Station!]! | ||
} | ||
|
||
enum StationOrder { | ||
NAME | ||
VOTES | ||
} | ||
|
||
type Station { | ||
name: String! | ||
url: String! | ||
votes: Int! | ||
favicon: String! | ||
homepage: String! | ||
language: String! | ||
country: String! | ||
stationuuid: String! | ||
} | ||
|
||
input StationSearchInput { | ||
name: String | ||
limit: Int = 10 | ||
reverse: Boolean = true | ||
order: StationOrder = VOTES | ||
country: String | ||
language: String | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
c96e1ab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: