Skip to content

Commit 02f687f

Browse files
committed
chore: Add temporary fix for lint issues
1 parent 82d0048 commit 02f687f

File tree

13 files changed

+137
-108
lines changed

13 files changed

+137
-108
lines changed

src/components/NavigationBar/AppThemeToggle.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ const AppThemeToggle = () => {
66
// context for handling app theme
77
const { appTheme, toggleAppTheme } = useAppTheme()
88

9-
const {t} = useTranslation();
9+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
10+
const {t} = useTranslation();
1011

1112
const handleClick = () => {
1213
toggleAppTheme()

src/components/NavigationBar/NavigationBar.tsx

Lines changed: 92 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import logo from '../../assets/images/logo.png';
88
import AppThemeToggle from './AppThemeToggle';
99
import { useTranslation } from 'react-i18next';
1010

11-
interface DropdownProps {
11+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
12+
type DropdownProps = {
1213
i18n: {
1314
changeLanguage: (lang: string) => void;
1415
language: string;
@@ -34,41 +35,43 @@ const NavigationBar = () => {
3435
setMenuOpen(!menuOpen)
3536
}
3637

37-
const { t, i18n } = useTranslation();
38+
const { t, i18n } = useTranslation();
3839

39-
const changeLanguage = (lang: string) => {
40-
i18n.changeLanguage(lang);
41-
console.log(i18n.language);
42-
i18n.options.lng = i18n.language;
43-
};
40+
const changeLanguage = (lang: string) => {
41+
i18n.changeLanguage(lang);
42+
console.log(i18n.language);
43+
i18n.options.lng = i18n.language;
44+
};
4445

45-
const [isOpen, setIsOpen] = useState(false);
46+
const [isOpen, setIsOpen] = useState(false);
4647

47-
const toggleDropdown = () => {
48-
setIsOpen(!isOpen);
49-
};
48+
const toggleDropdown = () => {
49+
setIsOpen(!isOpen);
50+
};
5051

51-
const handleOptionClick = (lang: string) => {
52-
changeLanguage(lang);
53-
setIsOpen(false); // Close dropdown after selection
54-
};
52+
const handleOptionClick = (lang: string) => {
53+
changeLanguage(lang);
54+
setIsOpen(false); // Close dropdown after selection
55+
};
5556

56-
const getButtonText = () => {
57-
switch (i18n.language) {
58-
case 'en':
59-
return(
60-
<>
61-
<span style={{display:"inline-flex"}}><img src="https://flagcdn.com/gb.svg" height="25" width="25" alt="England" /></span>{" "+t('lang.eng')}
62-
</>); // Show English label
57+
const getButtonText = () => {
58+
switch (i18n.language) {
59+
case 'en':
60+
return(
61+
<>
62+
<span style={{display:"inline-flex"}}>
63+
<img src="https://flagcdn.com/gb.svg" height="25" width="25" alt="England" />
64+
</span>{" "+t('lang.eng')}
65+
</>); // Show English label
6366

64-
default:
65-
return(
66-
<>
67-
<span className="fi fi-gb"></span>
68-
{t('lang.eng')}
69-
</>); // Default to English if language is unknown
70-
}
71-
};
67+
default:
68+
return(
69+
<>
70+
<span className="fi fi-gb"></span>
71+
{t('lang.eng')}
72+
</>); // Default to English if language is unknown
73+
}
74+
};
7275

7376

7477
return (
@@ -171,22 +174,36 @@ const NavigationBar = () => {
171174
</Link>
172175
</li> */}
173176

174-
<li className="block my-1 px-4 py-2 relative hover:bg-gray-700 border border-gray-600" style={{cursor:'pointer'}}>
175-
<button
176-
style={{ cursor: 'pointer', color: 'white', padding: '', borderRadius: '5px' }}
177-
onClick={toggleDropdown}
178-
>
179-
{getButtonText()}
180-
</button>
181-
<ul
182-
className={`absolute w-24 bg-gray-800 rounded-md shadow-lg ${isOpen ? 'block' : 'hidden'}`}
183-
style={{left: '-50%', transform: 'translateX(-21%)', top: '-16%', marginTop: '8px', }}
184-
>
185-
<li className="px-4 py-2 hover:bg-gray-700 cursor-pointer" onClick={() => handleOptionClick('en')}><span style={{display:"inline-flex"}}><img src="https://flagcdn.com/gb.svg" height="25" width="25" alt="England" /></span>English</li>
177+
<li className="block my-1 px-4 py-2 relative hover:bg-gray-700 border border-gray-600"
178+
style={{cursor:'pointer'}}
179+
>
180+
<button
181+
style={{ cursor: 'pointer', color: 'white', padding: '', borderRadius: '5px' }}
182+
onClick={toggleDropdown}
183+
>
184+
{getButtonText()}
185+
</button>
186+
<ul
187+
className={`absolute w-24 bg-gray-800 rounded-md shadow-lg
188+
${isOpen ? 'block' : 'hidden'}`
189+
}
190+
style={{left: '-50%', transform: 'translateX(-21%)',
191+
top: '-16%', marginTop: '8px'
192+
}}
193+
>
194+
<li className="px-4 py-2 hover:bg-gray-700 cursor-pointer"
195+
onClick={() => handleOptionClick('en')}
196+
>
197+
<span style={{display:"inline-flex"}}>
198+
<img src="https://flagcdn.com/gb.svg"
199+
height="25" width="25" alt="England"
200+
/>
201+
</span>English
202+
</li>
186203

187-
{/* Add more options as needed */}
188-
</ul>
189-
</li>
204+
{/* Add more options as needed */}
205+
</ul>
206+
</li>
190207
{isLoggedIn ? (
191208
<>
192209
<li className="my-1">
@@ -230,17 +247,17 @@ const NavigationBar = () => {
230247
</li>
231248
<li className="mr-8">
232249
<Link to="/plugins" className="hover:text-blue-500">
233-
Plugins
250+
Plugins
234251
</Link>
235252
</li>
236253
<li className="mr-8">
237254
<Link to="/themes" className="hover:text-blue-500">
238-
Themes
255+
Themes
239256
</Link>
240257
</li>
241258
<li className="mr-8">
242259
<Link to="/theme-builder" className="hover:text-blue-500">
243-
Theme Builder
260+
Theme Builder
244261
</Link>
245262
</li>
246263
<li className="mr-8">
@@ -268,26 +285,37 @@ const NavigationBar = () => {
268285
</Link>
269286
</li> */}
270287

271-
<li className="block mr-8 relative">
272-
<button
273-
style={{ cursor: 'pointer', backgroundColor: 'black', color: 'white', padding: '', borderRadius: '5px' }}
274-
onClick={toggleDropdown}
275-
>
276-
{getButtonText()}
277-
</button>
278-
<ul
279-
className={`absolute mt-2 w-28 bg-black shadow-lg ${isOpen ? 'block' : 'hidden'}`}
280-
style={{ zIndex: 1000, left: '50%', transform: 'translateX(-50%)', top: '100%', marginTop: '8px', }}
281-
>
282-
<li className="px-2 py-2 hover:bg-blue-500 cursor-pointer" onClick={() => changeLanguage('en')}><span style={{display:"inline-flex"}}><img src="https://flagcdn.com/gb.svg" height="25" width="25" alt="England" /></span> English </li>
283-
{/* Add more options as needed */}
284-
</ul>
285-
</li>
288+
<li className="block mr-8 relative">
289+
<button
290+
style={{ cursor: 'pointer', backgroundColor: 'black',
291+
color: 'white', padding: '', borderRadius: '5px'
292+
}}
293+
onClick={toggleDropdown}
294+
>
295+
{getButtonText()}
296+
</button>
297+
<ul
298+
className={`absolute mt-2 w-28 bg-black shadow-lg ${isOpen ? 'block' : 'hidden'}`}
299+
style={{ zIndex: 1000, left: '50%', transform: 'translateX(-50%)',
300+
top: '100%', marginTop: '8px'
301+
}}
302+
>
303+
<li className="px-2 py-2 hover:bg-blue-500 cursor-pointer"
304+
onClick={() => changeLanguage('en')}
305+
>
306+
<span style={{display:"inline-flex"}}>
307+
<img src="https://flagcdn.com/gb.svg" height="25" width="25" alt="England" />
308+
</span>
309+
English
310+
</li>
311+
{/* Add more options as needed */}
312+
</ul>
313+
</li>
286314
{isLoggedIn ? (
287315
<>
288316
<li className="mr-8">
289317
<Link to="/profile" className="hover:text-blue-500">
290-
Profile {/* {t('navbar.profile')} */}
318+
Profile {/* {t('navbar.profile')} */}
291319
</Link>
292320
</li>
293321
<li>

src/components/SearchBar/SearchBar.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { useState } from 'react';
22
import { useSearchParams } from 'react-router-dom';
3-
import { useTranslation } from 'react-i18next';
43

54
type Props = {
65
onSearch: (query: string) => void;
@@ -11,8 +10,8 @@ type Props = {
1110
*/
1211
const SearchBar: React.FC<Props> = ({ onSearch }) => {
1312
// tracks current user search query
14-
const [searchParams] = useSearchParams()
15-
// initialize both query and previous query with searchParam if exists
13+
const [searchParams] = useSearchParams()
14+
// initialize both query and previous query with searchParam if exists
1615
const [query, setQuery] = useState(() => searchParams.get('searchQuery') || "");
1716
const [previousQuery, setPreviousQuery] = useState(() => searchParams.get('searchQuery') || "");
1817

src/components/Themes/ThemeCard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ const ThemeCard: React.FC<Props> = ({ theme, isPreviewed, onPreview }) => {
3030
onPreview(theme.name)
3131
}
3232

33-
const {t} = useTranslation();
33+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
34+
const {t} = useTranslation();
3435

3536
return (
3637
<>

src/components/Themes/ThemeModal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ type ThemeModalProps = {
1717
const ThemeModal: React.FC<ThemeModalProps> = ({ isOpen, onClose, theme }) => {
1818
const modalRef = useRef<HTMLDivElement>(null)
1919

20-
const {t} = useTranslation();
20+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
21+
const {t} = useTranslation();
2122

2223
useEffect(() => {
2324
const handleClickOutside = (event: MouseEvent) => {

src/hooks/useFetchThemes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const useFetchThemes = (
3737

3838
const response = await galleryApiFetch(finalUrl);
3939
const result = await response.json();
40-
apiThemes = result.data;
40+
apiThemes = result.data;
4141
} else {
4242
apiThemes = Placeholders.themes;
4343
}

src/index.tsx

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,8 @@ import LoginProcessPage from './pages/LoginProcess'
1818
import { I18nextProvider } from 'react-i18next';
1919
import i18n from './i18n';
2020

21-
22-
23-
24-
<link
25-
rel="stylesheet"
26-
href="https://cdn.jsdelivr.net/gh/lipis/flag-icons@7.2.3/css/flag-icons.min.css"
27-
/>
28-
21+
// eslint-disable-next-line
22+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/lipis/flag-icons@7.2.3/css/flag-icons.min.css" />
2923

3024
const NavbarWrapper = () => (
3125
<div>
@@ -79,13 +73,13 @@ const routes = [
7973
const router = createBrowserRouter(routes)
8074
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
8175
<React.StrictMode>
82-
<I18nextProvider i18n={i18n}>
83-
<AuthProvider>
84-
<AppThemeProvider>
85-
<RouterProvider router={router} />
86-
</AppThemeProvider>
87-
</AuthProvider>
88-
</I18nextProvider>
76+
<I18nextProvider i18n={i18n}>
77+
<AuthProvider>
78+
<AppThemeProvider>
79+
<RouterProvider router={router} />
80+
</AppThemeProvider>
81+
</AuthProvider>
82+
</I18nextProvider>
8983
</React.StrictMode>
9084
)
9185
reportWebVitals()

src/pages/Home.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { handleLogin } from '../services/authService';
44
import { useAuth } from '../context/AuthContext';
55
import { SiteConfig } from '../constants/SiteConfig';
66
import logo from "../assets/images/logo.png";
7-
import { Trans, useTranslation } from 'react-i18next';
7+
import { useTranslation } from 'react-i18next';
88

99
/**
1010
* Greets user as they visit the home (landing) page.
@@ -13,7 +13,8 @@ const HomePage = () => {
1313
// used to render different text if user is logged in
1414
const { isLoggedIn, userData } = useAuth()
1515

16-
const {t} = useTranslation();
16+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
17+
const {t} = useTranslation();
1718

1819
// handles navigation
1920
const navigate = useNavigate()

src/pages/Plugins.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22

33
import { Link } from 'react-router-dom';
4-
import {useTranslation} from 'react-i18next';
4+
55
/**
66
* Displays plugins for users to search, browse and rate.
77
* // todo: dynamically load plugins as user scrolls instead of fetching wholesale from backend

src/pages/ThemeBuilder.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ import { useTranslation } from 'react-i18next';
88
const ThemeBuilder: React.FC = () => {
99
// todo: add theme builder
1010
console.log('test')
11-
const {t} = useTranslation();
11+
12+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
13+
const {t} = useTranslation();
1214

1315
return (
1416
<div className="flex items-center justify-center h-screen bg-black">

0 commit comments

Comments
 (0)