Skip to content
This repository has been archived by the owner on Dec 24, 2024. It is now read-only.

Commit

Permalink
ref(channel): no videos found component
Browse files Browse the repository at this point in the history
  • Loading branch information
Zibbp committed Jan 24, 2023
1 parent 51a8407 commit 70aa513
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 14 deletions.
15 changes: 15 additions & 0 deletions src/components/Channel/NoVideosFound.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Center, Image } from "@mantine/core";
import React from "react";

const ChannelNoVideosFound = () => {
return (
<div>
<Center>
No videos found
<Image src="/images/Sadge.webp" ml={5} height={19} width={27} />
</Center>
</div>
);
};

export default ChannelNoVideosFound;
8 changes: 2 additions & 6 deletions src/pages/channels/[channelName].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { useQuery, useQueryClient } from "@tanstack/react-query";
import axios from "axios";
import { useEffect, useRef, useState } from "react";
import { ChannelHeader } from "../../components/Channel/Header";
import ChannelNoVideosFound from "../../components/Channel/NoVideosFound";
import GanymedeLoader from "../../components/Utils/GanymedeLoader";
import { VodCard } from "../../components/Vod/Card";
import { useApi } from "../../hooks/useApi";
Expand Down Expand Up @@ -174,12 +175,7 @@ const ChannelPage = (props: any) => {
</Center>
</Container>
) : (
<div>
<Center>
No videos found
<Image src="/images/Sadge.webp" ml={5} height={19} width={27} />
</Center>
</div>
<ChannelNoVideosFound />
)}
</div>
)}
Expand Down
8 changes: 2 additions & 6 deletions src/pages/playlists/[playlistId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Center, Container, Grid, Image, Modal } from "@mantine/core";
import { useDocumentTitle } from "@mantine/hooks";
import { useQuery } from "@tanstack/react-query";
import { useState } from "react";
import ChannelNoVideosFound from "../../components/Channel/NoVideosFound";
import DeletePlaylistModal from "../../components/Playlist/DeletePlaylistModal";
import EditPlaylistModal from "../../components/Playlist/EditPlaylistModal";
import PlaylistHeader from "../../components/Playlist/Header";
Expand Down Expand Up @@ -65,12 +66,7 @@ const PlaylistPage = (props: any) => {
</div>
</Container>
) : (
<div>
<Center>
No VODs found{" "}
<Image src="/images/Sadge.webp" ml={5} height={28} width={28} />
</Center>
</div>
<ChannelNoVideosFound />
)}
<Modal
opened={opened}
Expand Down
13 changes: 11 additions & 2 deletions src/pages/search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ import { useDocumentTitle } from "@mantine/hooks";
import { IconSearch } from "@tabler/icons";
import { useMutation, useQuery } from "@tanstack/react-query";
import React, { useEffect, useRef, useState } from "react";
import ChannelNoVideosFound from "../../components/Channel/NoVideosFound";
import GanymedeLoader from "../../components/Utils/GanymedeLoader";
import { VodCard } from "../../components/Vod/Card";
import { useApi } from "../../hooks/useApi";

const SearchPage = (props) => {
interface SearchPageProps {
q: string;
}

const SearchPage = (props: SearchPageProps) => {
const [searchTerm, setSearchTerm] = useState("");
const [displaySearchTerm, setDisplaySearchTerm] = useState("");
const [page, setPage] = useState(1);
Expand Down Expand Up @@ -85,7 +90,7 @@ const SearchPage = (props) => {
</Center>

{isLoading && <GanymedeLoader />}
{!isLoading && data && (
{!isLoading && data && data.data.length > 0 ? (
<div>
<div>
<Grid mt={10}>
Expand Down Expand Up @@ -137,6 +142,10 @@ const SearchPage = (props) => {
</div>
</Center>
</div>
) : (
<div style={{ marginTop: "1rem" }}>
<ChannelNoVideosFound />
</div>
)}
</Container>
</div>
Expand Down

0 comments on commit 70aa513

Please sign in to comment.