Skip to content

Commit 9d321c7

Browse files
fixing formatting in according to prettier config file
1 parent 6ff4e51 commit 9d321c7

File tree

1 file changed

+29
-16
lines changed

1 file changed

+29
-16
lines changed

src/pages/More.tsx

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,20 @@ const MorePage: React.FC = () => {
2929
alt: string;
3030
} | null>(null);
3131

32-
useEffect(() => {
33-
const dark = document.documentElement.classList.contains('dark');
34-
setIsDarkMode(dark);
32+
useEffect(() => {
33+
const dark = document.documentElement.classList.contains('dark');
34+
setIsDarkMode(dark);
3535

36-
const observer = new MutationObserver(() => {
37-
const updatedDark = document.documentElement.classList.contains('dark');
38-
setIsDarkMode(updatedDark);
39-
});
36+
const observer = new MutationObserver(() => {
37+
const updatedDark = document.documentElement.classList.contains('dark');
38+
setIsDarkMode(updatedDark);
39+
});
4040

41-
observer.observe(document.documentElement, { attributes: true });
41+
observer.observe(document.documentElement, { attributes: true });
42+
43+
return () => observer.disconnect();
44+
}, []);
4245

43-
return () => observer.disconnect();
44-
}, []);
45-
4646
useEffect(() => {
4747
const loadPage = async () => {
4848
setIsLoading(true);
@@ -60,7 +60,7 @@ useEffect(() => {
6060
if (fetchedPage) {
6161
setPage(fetchedPage);
6262
setNotFoundSlug(null);
63-
document.title = fetchedPage.title + ' - Sugar Labs';
63+
document.title = `${fetchedPage.title} - Sugar Labs`;
6464

6565
if (fetchedPage.category) {
6666
setActiveCategory(fetchedPage.category);
@@ -147,7 +147,11 @@ useEffect(() => {
147147
className="text-blue-600 hover:underline mb-2 inline-block"
148148
>
149149
<motion.button
150-
className="mb-6 px-4 py-2 flex items-center text-blue-600 hover:text-blue-700 transition-colors rounded-md hover:bg-blue-50"
150+
className={
151+
'mb-6 px-4 py-2 flex items-center text-blue-600 ' +
152+
'hover:text-blue-700 transition-colors rounded-md ' +
153+
'hover:bg-blue-50'
154+
}
151155
whileHover={{ scale: 1.05 }}
152156
whileTap={{ scale: 0.95 }}
153157
>
@@ -199,7 +203,7 @@ useEffect(() => {
199203
<h3 className="font-bold text-xl mb-4">
200204
{activeCategory === 'All'
201205
? 'All Pages'
202-
: activeCategory + ' Pages'}
206+
: `${activeCategory} Pages`}
203207
</h3>
204208
<ul className="space-y-2">
205209
{pagesByCategory[activeCategory]?.map((linkPage) => (
@@ -228,7 +232,11 @@ useEffect(() => {
228232
transition={{ duration: 0.5 }}
229233
key={page?.slug}
230234
>
231-
<div className={`${isDarkMode?"bg-amber-950":"bg-white"} rounded-lg shadow-md p-6`}>
235+
<div
236+
className={`${
237+
isDarkMode ? 'bg-amber-950' : 'bg-white'
238+
} rounded-lg shadow-md p-6`}
239+
>
232240
{page ? (
233241
<div className="prose prose-lg max-w-none">
234242
<MarkdownRenderer
@@ -312,7 +320,12 @@ useEffect(() => {
312320
</p>
313321
<button
314322
onClick={closeImageModal}
315-
className="absolute top-2 right-2 text-white text-2xl hover:text-gray-300 bg-black bg-opacity-50 rounded-full w-8 h-8 flex items-center justify-center focus:outline-none focus:ring-2 focus:ring-white"
323+
className={
324+
'absolute top-2 right-2 text-white text-2xl ' +
325+
'hover:text-gray-300 bg-black bg-opacity-50 rounded-full ' +
326+
'w-8 h-8 flex items-center justify-center ' +
327+
'focus:outline-none focus:ring-2 focus:ring-white'
328+
}
316329
aria-label="Close image"
317330
>
318331
&times;

0 commit comments

Comments
 (0)