Skip to content

Commit 6f013ac

Browse files
committed
fix: Minor bug fixes and cleanup
1 parent 7407ba1 commit 6f013ac

File tree

12 files changed

+39
-22
lines changed

12 files changed

+39
-22
lines changed

public/locales/en/components/userprofile.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
"header": "Plugins",
1818
"favorite": "Favorite",
1919
"personal": "Personal",
20-
"empty_themes": "You have not created any plugins!",
20+
"empty_personal_plugins": "You have not created any plugins!",
21+
"empty_favorited_plugins": "You have not favorited any plugins!",
2122
"prompt_action": "Browse plugins or create your own",
22-
"browse_themes": "Browse Plugins",
23-
"build_theme": "Build A Plugin"
23+
"browse_plugins": "Browse Plugins",
24+
"build_plugin": "Build A Plugin"
2425
},
2526
"user_favorite_theme_card": {
2627
"view_theme": "View Theme",
@@ -34,7 +35,8 @@
3435
"header": "Themes",
3536
"favorite": "Favorite",
3637
"personal": "Personal",
37-
"empty_themes": "You have not created any themes!",
38+
"empty_personal_themes": "You have not created any themes!",
39+
"empty_favorited_themes": "You have not favorited any themes!",
3840
"prompt_action": "Browse theme selections or create your own",
3941
"browse_themes": "Browse Themes",
4042
"build_theme": "Build A Theme"

src/components/NavigationBar/NavigationBar.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { useTranslation } from "react-i18next";
2121
import logo from "@/assets/images/logo.png";
2222
import { Endpoints } from "@/constants/Endpoints";
2323
import { useAuth } from "@/context/AuthContext";
24+
import useIsDesktop from "@/hooks/useIsDesktop";
2425
import { useNotify } from "@/hooks/useNotify";
2526
import { handleLogin } from "@/services/authService";
2627
import { resetPluginsCache } from "@/services/plugins/cacheService";
@@ -42,6 +43,8 @@ const NavigationBar: React.FC<{
4243
}) => {
4344
// lazy loads translations
4445
const { t, i18n } = useTranslation("components/navigationbar");
46+
47+
const isDesktop = useIsDesktop();
4548
const { isLoggedIn, setIsLoggedIn, setUserData } = useAuth();
4649
const location = useLocation();
4750
const navigate = useNavigate();
@@ -73,7 +76,7 @@ const NavigationBar: React.FC<{
7376
<Box
7477
component="nav"
7578
sx={{
76-
position: "sticky",
79+
position: isDesktop ? "sticky" : "fixed",
7780
top: 0,
7881
left: 0,
7982
width: "100%",

src/components/Plugins/PluginCard.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import useIsDesktop from "@/hooks/useIsDesktop";
12
import {
23
Box,
34
Card,
@@ -30,6 +31,8 @@ const PluginCard: React.FC<{
3031
// lazy loads translations
3132
const { t } = useTranslation("components/plugins");
3233

34+
const isDesktop = useIsDesktop();
35+
3336
const handleFavoriteClick = async () => {
3437
if (plugin.isFavorite) {
3538
updateFavorites(plugin, false);
@@ -41,7 +44,8 @@ const PluginCard: React.FC<{
4144
return (
4245
<Card
4346
sx={{
44-
height: 500,
47+
height: isDesktop ? 500 : 460,
48+
width: isDesktop ? "100%" : "85vw",
4549
display: "flex",
4650
flexDirection: "column",
4751
justifyContent: "space-between",
@@ -56,7 +60,7 @@ const PluginCard: React.FC<{
5660
image={plugin.imageUrl}
5761
alt={plugin.name}
5862
sx={{
59-
height: 280,
63+
height: isDesktop ? 280 : 240,
6064
width: "100%",
6165
objectFit: "cover",
6266
borderRadius: 5,

src/components/Plugins/PluginModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const PluginModal: React.FC<{
7878
variant="h5"
7979
sx={{
8080
fontWeight: "bold",
81-
color: "white",
81+
color: "text.primary",
8282
mb: 1,
8383
}}
8484
>

src/components/SearchBar/SortButton.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ const SortButton: React.FC<{
7272
'&:hover': {
7373
borderBottom: "1px dashed",
7474
},
75+
fontSize: 14,
7576
}}
7677
>
7778
{t(`sortbutton.${sortMap[sortBy as keyof typeof sortMap]}`)}
@@ -93,6 +94,9 @@ const SortButton: React.FC<{
9394
key={field}
9495
selected={field === sortBy}
9596
onClick={() => handleMenuClose(field)}
97+
sx={{
98+
fontSize: 14,
99+
}}
96100
>
97101
{label}
98102
</MenuItem>

src/components/Themes/ThemeModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const ThemeModal: React.FC<{
8787
variant="h5"
8888
sx={{
8989
fontWeight: "bold",
90-
color: "white",
90+
color: "text.primary",
9191
mb: 1,
9292
}}
9393
>

src/components/Themes/ThemePreview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ const ThemePreview: React.FC<{
194194
{previewIds.length === 0 ? (
195195
<Typography
196196
sx={{
197-
color: '#f9fafb',
197+
color: 'text.primary',
198198
fontWeight: 600,
199199
fontSize: '1.125rem',
200200
textAlign: 'center',
@@ -219,7 +219,7 @@ const ThemePreview: React.FC<{
219219
>
220220
<Typography
221221
sx={{
222-
color: '#f9fafb',
222+
color: 'text.primary',
223223
fontWeight: 600,
224224
fontSize: '1.125rem'
225225
}}

src/components/UserProfile/UserProfilePluginSection.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ const UserProfilePluginSection: React.FC<{
126126
<img src={EmptySVG} alt="Empty" />
127127
<Box>
128128
<Typography variant="h6" sx={{ fontWeight: 'bold' }}>
129-
{t('user_profile_plugin_section.empty_plugins')}
129+
{selectedPluginType === "personal" ?
130+
<>{t('user_profile_plugin_section.empty_personal_plugins')}</> :
131+
<>{t('user_profile_plugin_section.empty_favorited_plugins')}</>
132+
}
130133
</Typography>
131134
<Typography sx={{ color: 'text.secondary' }}>
132135
{t('user_profile_plugin_section.prompt_action')}

src/components/UserProfile/UserProfileThemeSection.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ const UserProfileThemeSection: React.FC<{
126126
<img src={EmptySVG} alt="Empty" />
127127
<Box>
128128
<Typography variant="h6" sx={{ fontWeight: 'bold' }}>
129-
{t('user_profile_theme_section.empty_themes')}
129+
{selectedThemeType === "personal" ?
130+
<>{t('user_profile_theme_section.empty_personal_themes')}</> :
131+
<>{t('user_profile_theme_section.empty_favorited_themes')}</>
132+
}
130133
</Typography>
131134
<Typography sx={{ color: 'text.secondary' }}>
132135
{t('user_profile_theme_section.prompt_action')}

src/pages/ThemeBuilder.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const ThemeBuilder: React.FC = () => {
3939
color: 'text.primary',
4040
}}
4141
>
42-
{t("theme_builder.coming_soon")}
42+
{t("theme_builder.title")}
4343
</Typography>
4444
<Typography
4545
variant="body1"

src/services/plugins/apiService.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Endpoints } from "@/constants/Endpoints";
22
import { Placeholders } from "@/constants/Placeholders";
3+
import { ApiPlugin } from "@/interfaces/ApiPlugin";
34
import { Plugin } from "@/interfaces/Plugin";
45
import { resetPluginsCache } from "../plugins/cacheService";
5-
import { ApiPlugin } from "@/interfaces/ApiPlugin";
66
import { getNpmPluginData } from "./npmService";
77

88
/**
@@ -110,8 +110,5 @@ const removePluginFromFavorites = async (plugin: Plugin) => {
110110
};
111111

112112
export {
113-
galleryApiFetch,
114-
fetchPluginsFromApi,
115-
addPluginToFavorites,
116-
removePluginFromFavorites
117-
}
113+
addPluginToFavorites, fetchPluginsFromApi, galleryApiFetch, removePluginFromFavorites
114+
};

src/services/plugins/npmService.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Endpoints } from "../../constants/Endpoints";
21
import { ApiPlugin } from "@/interfaces/ApiPlugin";
2+
import { Endpoints } from "../../constants/Endpoints";
33

44
/**
55
* Fetches theme data stored on github via jsdelivr cache.
@@ -35,4 +35,5 @@ const getNpmPluginData = async (plugin: ApiPlugin) => {
3535
}
3636
}
3737

38-
export { getNpmPluginData }
38+
export { getNpmPluginData };
39+

0 commit comments

Comments
 (0)