Skip to content

Commit

Permalink
fix/prevent break layout (#31)
Browse files Browse the repository at this point in the history
* fix: fixed word wrap

* fix: prevent refetch on error
  • Loading branch information
sirLisko authored Oct 7, 2024
1 parent 82f43ea commit c9e2c1f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/Result/Result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const Result = ({ artistQuery }: Props) => {
<div className="m-auto text-center text-2xl p-3">
<Frown height={100} width={100} />
</div>
<div className="m-auto text-center text-2xl p-3">
<div className="w-full break-words m-auto text-center text-2xl p-3">
No setlists found for <b>{artistQuery[0]}</b>
</div>
</div>
Expand Down
6 changes: 5 additions & 1 deletion services/artistData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ export const useArtistData = (artist: string | undefined) => {
const { data, error, isLoading } = useSWR(
artist ? `/api/artists/${artist}/spotify` : null,
fetcher<ArtistData>,
{ revalidateOnFocus: false, revalidateOnReconnect: false },
{
revalidateOnFocus: false,
shouldRetryOnError: false,
revalidateOnReconnect: false,
},
);

return {
Expand Down
6 changes: 5 additions & 1 deletion services/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ export const useEvents = (artist: string) => {
const { data, error, isLoading } = useSWR(
`/api/artists/${artist}/concerts`,
fetcher<Event[]>,
{ revalidateOnFocus: false, revalidateOnReconnect: false },
{
revalidateOnFocus: false,
shouldRetryOnError: false,
revalidateOnReconnect: false,
},
);

return {
Expand Down
2 changes: 2 additions & 0 deletions services/searchArtist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const useSearchArtistByName = (searchTerm: string | undefined) => {
{
dedupingInterval: 300,
revalidateOnFocus: false,
shouldRetryOnError: false,
revalidateOnReconnect: false,
},
);
Expand All @@ -32,6 +33,7 @@ export const useGetArtist = (mbid: string | undefined) => {
fetcher<ArtistInfo>,
{
revalidateOnFocus: false,
shouldRetryOnError: false,
revalidateOnReconnect: false,
},
);
Expand Down
6 changes: 5 additions & 1 deletion services/tracks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ export const useTracks = (artistName?: string, artistId?: string) => {
? `/api/tracks?artistName=${artistName}`
: null,
fetcher<SetList>,
{ revalidateOnFocus: false, revalidateOnReconnect: false },
{
revalidateOnFocus: false,
shouldRetryOnError: false,
revalidateOnReconnect: false,
},
);

return {
Expand Down

0 comments on commit c9e2c1f

Please sign in to comment.