Skip to content

Commit 87f80a0

Browse files
authored
Revert "feature: implement barebones of plugins page"
1 parent 4c96a9f commit 87f80a0

File tree

8 files changed

+32
-190
lines changed

8 files changed

+32
-190
lines changed

src/components/Plugins/PluginCard.tsx

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/components/Plugins/PluginSearchBar.tsx

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/constants/Endpoints.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// endpoints for making requests
22
const Endpoints = {
33
fetchApiThemes: `${import.meta.env.VITE_GALLERY_API_URL}/api/v1/themes`,
4-
fetchApiPlugins: `${import.meta.env.VITE_GALLERY_API_URL}/api/v1/plugins`,
54
fetchUserProfile: `${import.meta.env.VITE_GALLERY_API_URL}/api/v1/users/profile`,
65
fetchCacheThemes: import.meta.env.VITE_GITHUB_THEMES_CACHE_URL,
76
loginUser: `${import.meta.env.VITE_GALLERY_API_URL}/api/v1/auth/login/process`,

src/hooks/useFetchPlugins.ts

Lines changed: 0 additions & 77 deletions
This file was deleted.

src/interfaces/Plugin.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/pages/LoginProcess.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const LoginProcessPage = () => {
1010
const { setUserData, setIsLoggedIn } = useAuth();
1111
const navigate = useNavigate();
1212
const location = useLocation();
13-
const [gracetime, setgracetime] = useState(false)
13+
const [gracetime, setgracetime] = useState(false)
1414

1515
// Retrieve provider and key from query params to be used for getting user data
1616
const queryParams = new URLSearchParams(location.search);
@@ -28,26 +28,26 @@ const LoginProcessPage = () => {
2828
setUserData(data);
2929
setIsLoggedIn(true);
3030
const redirectUri = localStorage.getItem('login_redirect_uri');
31-
if(gracetime){
32-
//keep waiting until gracetime ends
33-
return;
34-
}
31+
if(gracetime){
32+
//keep waiting until gracetime ends
33+
return;
34+
}
3535
if (redirectUri) {
3636
window.location.href = redirectUri;
3737
} else {
3838
navigate('/themes');
3939
}
4040
}
4141
}, [loading, error, data, gracetime]);
42-
useEffect(()=> {
43-
if(loading){
44-
setgracetime(true)
45-
setTimeout(() => {
46-
//allow the spinner to remove from render once the gracetime elapses
47-
setgracetime(false)
48-
}, SiteConfig.loginSpinnerGraceTime);
49-
}
50-
}, [loading])
42+
useEffect(()=> {
43+
if(loading){
44+
setgracetime(true)
45+
setTimeout(() => {
46+
//allow the spinner to remove from render once the gracetime elapses
47+
setgracetime(false)
48+
}, SiteConfig.loginSpinnerGraceTime);
49+
}
50+
}, [loading])
5151
return (
5252
<div className="h-screen w-full bg-black flex justify-center items-center">
5353
{(loading || gracetime) && <LoadingSpinner />}

src/pages/Plugins.tsx

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,29 @@
11
import React from 'react';
22

3-
import { Endpoints } from '../constants/Endpoints';
4-
import useFetchPlugins from '../hooks/useFetchPlugins';
3+
import { Link } from 'react-router-dom';
54

6-
import Skeleton from 'react-loading-skeleton';
7-
import { PluginCard } from '../components/Plugins/PluginCard';
8-
import PluginSearchBar from '../components/Plugins/PluginSearchBar';
9-
import { useSearchParams } from 'react-router-dom';
105
/**
116
* Displays plugins for users to search, browse and rate.
127
* // todo: dynamically load plugins as user scrolls instead of fetching wholesale from backend
138
*/
149
const Plugins: React.FC = () => {
15-
const [searchParams] = useSearchParams()
16-
const searchQuery = searchParams.get('searchQuery') || "";
17-
18-
const { plugins, isLoading, error } = useFetchPlugins(Endpoints.fetchApiPlugins, 30, 1,searchQuery );
19-
2010
return (
21-
<div className=" min-h-screen bg-black">
22-
<div className='p-8 flex flex-col gap-8 max-w-[1024px] m-auto'>
23-
<PluginSearchBar />
24-
<div className='grid xs:grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-16 gap-y-8'>
25-
{isLoading ? Array.from({length : 9}).map((_ , i)=><Skeleton key={i} width="280px" containerClassName='m-auto' height="300px" />) :
26-
plugins.length > 0 && plugins.map(plugin =>{
27-
return <PluginCard key={plugin.id} plugin={plugin} />
28-
})}
29-
</div>
30-
{!isLoading && error && <h1 className='text-white text-lg flex items-center justify-center '>{error}</h1>
31-
}
32-
{
33-
!error && !isLoading && plugins.length == 0 &&
34-
<h1 className='text-white text-lg flex items-center justify-center '>No search results found...</h1>
35-
}
11+
<div className="flex items-center justify-center h-screen bg-black">
12+
<div className="bg-white p-10 rounded-lg shadow-lg text-center max-w-screen-md">
13+
<h1 className="text-4xl font-bold mb-4 text-gray-800">Coming Soon</h1>
14+
<p className="text-lg text-gray-600 mb-8">
15+
Plugins are not ready. Please check back later!
16+
</p>
17+
<p className="text-md text-gray-500 mb-4">
18+
In the meantime, feel free to browse our available themes.
19+
</p>
20+
<Link
21+
to="/themes"
22+
className="inline-block bg-blue-500 text-white py-2 px-4 rounded-lg
23+
hover:bg-blue-600 transition duration-300"
24+
>
25+
Browse Themes
26+
</Link>
3627
</div>
3728
</div>
3829
);

tailwind.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ export default {
5555
'black': '#000000',
5656
'white': '#ffffff',
5757
'slate-400': '#94a3b8',
58-
'slate-500': '#64748b',
59-
'card-border': '#27272A'
58+
'slate-500': '#64748b'
6059
},
6160
keyframes: {
6261
wiggle: {

0 commit comments

Comments
 (0)