Skip to content

Commit 864f66b

Browse files
committed
refactor: better sidebar icon mapping handling
1 parent 4c238db commit 864f66b

File tree

4 files changed

+34
-102
lines changed

4 files changed

+34
-102
lines changed

public/sidebar.piml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@
4545
(to) /the-vague
4646
(icon) FilePdfIcon
4747

48+
> (section)
49+
(id) isSoftwareOpen
50+
(label) Applications
51+
(content)
52+
> (item)
53+
(label) Castarook
54+
(to) /castarook
55+
(icon) CrownIcon
56+
4857
> (section)
4958
(id) isAppsOpen
5059
(label) Utilities
@@ -94,10 +103,9 @@
94103
> (item)
95104
(label) Serfs & Frauds
96105
(to) /stories
97-
(icon) SwordIcon
106+
(icon) CastleTurretIcon
98107
> (item)
99108
(label) RSS_Feed
100109
(url) /rss.xml
101110
(icon) RssIcon
102111
(external) true
103-

src/components/BrutalistSidebar.jsx

Lines changed: 5 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,68 +2,23 @@ import React, { useRef, useState, useEffect, useCallback } from 'react';
22
import { NavLink, Link, useLocation, useNavigate } from 'react-router-dom';
33
import { motion } from 'framer-motion';
44
import {
5-
HouseIcon,
6-
UserIcon,
7-
BookOpenIcon,
8-
WrenchIcon,
9-
ArticleIcon,
10-
SquaresFourIcon,
11-
GearSixIcon,
5+
CaretDoubleDownIcon,
6+
CaretDoubleUpIcon,
7+
ArrowRightIcon,
128
MagnifyingGlassIcon,
13-
TimerIcon,
14-
PushPinIcon,
15-
TrophyIcon,
9+
GearSixIcon,
1610
ShuffleIcon,
17-
PaletteIcon,
1811
EnvelopeSimpleIcon,
19-
BugBeetleIcon,
20-
ArrowRightIcon,
21-
SwordIcon,
22-
RssIcon,
23-
GraphIcon,
24-
CaretDoubleDownIcon,
25-
CaretDoubleUpIcon,
26-
FlaskIcon,
27-
BookBookmarkIcon,
28-
FilePdfIcon,
29-
TerminalWindowIcon,
3012
} from '@phosphor-icons/react';
3113

3214
import { version } from '../version';
3315
import usePersistentState from '../hooks/usePersistentState';
3416
import { KEY_SIDEBAR_STATE } from '../utils/LocalStorageManager';
3517
import { useAchievements } from '../context/AchievementContext';
3618
import { useSiteConfig } from '../context/SiteConfigContext';
19+
import { appIcons as ICON_MAP } from '../utils/appIcons';
3720
import piml from 'piml';
3821

39-
const ICON_MAP = {
40-
HouseIcon,
41-
UserIcon,
42-
BookOpenIcon,
43-
WrenchIcon,
44-
ArticleIcon,
45-
SquaresFourIcon,
46-
GearSixIcon,
47-
MagnifyingGlassIcon,
48-
TimerIcon,
49-
PushPinIcon,
50-
TrophyIcon,
51-
ShuffleIcon,
52-
PaletteIcon,
53-
EnvelopeSimpleIcon,
54-
BugBeetleIcon,
55-
ArrowRightIcon,
56-
SwordIcon,
57-
RssIcon,
58-
GraphIcon,
59-
CaretDoubleDownIcon,
60-
CaretDoubleUpIcon,
61-
FlaskIcon,
62-
BookBookmarkIcon,
63-
FilePdfIcon,
64-
TerminalWindowIcon,
65-
};
66-
6722
const BrutalistSidebar = ({
6823
isOpen,
6924
toggleSidebar,

src/components/LuxeSidebar.jsx

Lines changed: 5 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,22 @@ import React, { useRef, useState, useEffect, useCallback } from 'react';
22
import { NavLink, Link, useLocation, useNavigate } from 'react-router-dom';
33
import { motion, AnimatePresence } from 'framer-motion';
44
import {
5-
HouseIcon,
6-
UserIcon,
7-
BookOpenIcon,
8-
WrenchIcon,
9-
ArticleIcon,
10-
SquaresFourIcon,
11-
GearSixIcon,
5+
CaretDoubleDownIcon,
6+
CaretDoubleUpIcon,
7+
ArrowRightIcon,
128
MagnifyingGlassIcon,
13-
TimerIcon,
14-
PushPinIcon,
15-
TrophyIcon,
9+
GearSixIcon,
1610
ShuffleIcon,
17-
PaletteIcon,
1811
EnvelopeSimpleIcon,
19-
BugBeetleIcon,
20-
ArrowRightIcon,
21-
SwordIcon,
22-
RssIcon,
23-
GraphIcon,
24-
CaretDoubleDownIcon,
25-
CaretDoubleUpIcon,
26-
FlaskIcon,
27-
BookBookmarkIcon,
28-
FilePdfIcon,
29-
TerminalWindowIcon,
3012
} from '@phosphor-icons/react';
3113

3214
import { version } from '../version';
3315
import usePersistentState from '../hooks/usePersistentState';
3416
import { KEY_SIDEBAR_STATE } from '../utils/LocalStorageManager';
3517
import { useAchievements } from '../context/AchievementContext';
18+
import { appIcons as ICON_MAP } from '../utils/appIcons';
3619
import piml from 'piml';
3720

38-
const ICON_MAP = {
39-
HouseIcon,
40-
UserIcon,
41-
BookOpenIcon,
42-
WrenchIcon,
43-
ArticleIcon,
44-
SquaresFourIcon,
45-
GearSixIcon,
46-
MagnifyingGlassIcon,
47-
TimerIcon,
48-
PushPinIcon,
49-
TrophyIcon,
50-
ShuffleIcon,
51-
PaletteIcon,
52-
EnvelopeSimpleIcon,
53-
BugBeetleIcon,
54-
ArrowRightIcon,
55-
SwordIcon,
56-
RssIcon,
57-
GraphIcon,
58-
CaretDoubleDownIcon,
59-
CaretDoubleUpIcon,
60-
FlaskIcon,
61-
BookBookmarkIcon,
62-
FilePdfIcon,
63-
TerminalWindowIcon,
64-
};
65-
6621
const LuxeSidebar = ({
6722
isOpen,
6823
toggleSidebar,

src/utils/appIcons.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ import {
114114
ImageSquareIcon,
115115
PenNibIcon,
116116
CoffeeIcon,
117+
CrownIcon,
118+
CastleTurretIcon,
119+
SwordIcon,
120+
FilePdfIcon,
121+
BookBookmarkIcon,
122+
HouseIcon,
123+
UserIcon,
117124
} from '@phosphor-icons/react';
118125

119126
export const appIcons = {
@@ -232,4 +239,11 @@ export const appIcons = {
232239
ImageSquareIcon,
233240
PenNibIcon,
234241
CoffeeIcon,
242+
CrownIcon,
243+
CastleTurretIcon,
244+
SwordIcon,
245+
FilePdfIcon,
246+
BookBookmarkIcon,
247+
HouseIcon,
248+
UserIcon,
235249
};

0 commit comments

Comments
 (0)