Skip to content

Commit c661730

Browse files
committed
prettier
1 parent 5afc292 commit c661730

40 files changed

+1270
-722
lines changed

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
build
3+
package-lock.json

.prettierrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "all",
4+
"singleQuote": true,
5+
"printWidth": 80,
6+
"tabWidth": 2
7+
}

package-lock.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"test": "react-scripts test",
2727
"eject": "react-scripts eject",
2828
"lint": "eslint src/**/*.{js,jsx} --fix",
29+
"format": "prettier --write \"src/**/*.{js,jsx,css,json}\"",
2930
"predeploy": "npm run build",
3031
"deploy": "gh-pages -d build -b gh-pages"
3132
},
@@ -53,6 +54,7 @@
5354
"cross-env": "^10.1.0",
5455
"gh-pages": "^6.3.0",
5556
"postcss": "^8.5.6",
57+
"prettier": "^3.6.2",
5658
"tailwindcss": "^3.4.18"
5759
}
5860
}

src/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ function App() {
1616
);
1717
}
1818

19-
export default App;
19+
export default App;

src/components/AnimatedRoutes.js

Lines changed: 134 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ import NotFoundPage from '../pages/NotFoundPage';
1313

1414
const pageVariants = {
1515
initial: {
16-
opacity: 0
16+
opacity: 0,
1717
},
1818
in: {
19-
opacity: 1
19+
opacity: 1,
2020
},
2121
out: {
22-
opacity: 0
23-
}
22+
opacity: 0,
23+
},
2424
};
2525

2626
const pageTransition = {
27-
type: "tween",
28-
ease: "easeInOut",
29-
duration: 0.3
27+
type: 'tween',
28+
ease: 'easeInOut',
29+
duration: 0.3,
3030
};
3131

3232
function AnimatedRoutes() {
@@ -35,18 +35,135 @@ function AnimatedRoutes() {
3535
return (
3636
<AnimatePresence mode="wait">
3737
<Routes location={location} key={location.pathname}>
38-
<Route path="/" element={<motion.div initial="initial" animate="in" exit="out" variants={pageVariants} transition={pageTransition}><HomePage /></motion.div>} />
39-
<Route path="/blog" element={<motion.div initial="initial" animate="in" exit="out" variants={pageVariants} transition={pageTransition}><BlogPage /></motion.div>} />
40-
<Route path="/blog/:slug" element={<motion.div initial="initial" animate="in" exit="out" variants={pageVariants} transition={pageTransition}><BlogPostPage /></motion.div>} />
41-
<Route path="/projects" element={<motion.div initial="initial" animate="in" exit="out" variants={pageVariants} transition={pageTransition}><ProjectsPage /></motion.div>} />
42-
<Route path="/projects/:slug" element={<motion.div initial="initial" animate="in" exit="out" variants={pageVariants} transition={pageTransition}><ProjectPage /></motion.div>} />
43-
<Route path="/about" element={<motion.div initial="initial" animate="in" exit="out" variants={pageVariants} transition={pageTransition}><AboutPage /></motion.div>} />
44-
<Route path="/logs" element={<motion.div initial="initial" animate="in" exit="out" variants={pageVariants} transition={pageTransition}><LogsPage /></motion.div>} />
45-
<Route path="/logs/:slug" element={<motion.div initial="initial" animate="in" exit="out" variants={pageVariants} transition={pageTransition}><LogDetailPage /></motion.div>} />
46-
<Route path="*" element={<motion.div initial="initial" animate="in" exit="out" variants={pageVariants} transition={pageTransition}><NotFoundPage /></motion.div>} />
38+
<Route
39+
path="/"
40+
element={
41+
<motion.div
42+
initial="initial"
43+
animate="in"
44+
exit="out"
45+
variants={pageVariants}
46+
transition={pageTransition}
47+
>
48+
<HomePage />
49+
</motion.div>
50+
}
51+
/>
52+
<Route
53+
path="/blog"
54+
element={
55+
<motion.div
56+
initial="initial"
57+
animate="in"
58+
exit="out"
59+
variants={pageVariants}
60+
transition={pageTransition}
61+
>
62+
<BlogPage />
63+
</motion.div>
64+
}
65+
/>
66+
<Route
67+
path="/blog/:slug"
68+
element={
69+
<motion.div
70+
initial="initial"
71+
animate="in"
72+
exit="out"
73+
variants={pageVariants}
74+
transition={pageTransition}
75+
>
76+
<BlogPostPage />
77+
</motion.div>
78+
}
79+
/>
80+
<Route
81+
path="/projects"
82+
element={
83+
<motion.div
84+
initial="initial"
85+
animate="in"
86+
exit="out"
87+
variants={pageVariants}
88+
transition={pageTransition}
89+
>
90+
<ProjectsPage />
91+
</motion.div>
92+
}
93+
/>
94+
<Route
95+
path="/projects/:slug"
96+
element={
97+
<motion.div
98+
initial="initial"
99+
animate="in"
100+
exit="out"
101+
variants={pageVariants}
102+
transition={pageTransition}
103+
>
104+
<ProjectPage />
105+
</motion.div>
106+
}
107+
/>
108+
<Route
109+
path="/about"
110+
element={
111+
<motion.div
112+
initial="initial"
113+
animate="in"
114+
exit="out"
115+
variants={pageVariants}
116+
transition={pageTransition}
117+
>
118+
<AboutPage />
119+
</motion.div>
120+
}
121+
/>
122+
<Route
123+
path="/logs"
124+
element={
125+
<motion.div
126+
initial="initial"
127+
animate="in"
128+
exit="out"
129+
variants={pageVariants}
130+
transition={pageTransition}
131+
>
132+
<LogsPage />
133+
</motion.div>
134+
}
135+
/>
136+
<Route
137+
path="/logs/:slug"
138+
element={
139+
<motion.div
140+
initial="initial"
141+
animate="in"
142+
exit="out"
143+
variants={pageVariants}
144+
transition={pageTransition}
145+
>
146+
<LogDetailPage />
147+
</motion.div>
148+
}
149+
/>
150+
<Route
151+
path="*"
152+
element={
153+
<motion.div
154+
initial="initial"
155+
animate="in"
156+
exit="out"
157+
variants={pageVariants}
158+
transition={pageTransition}
159+
>
160+
<NotFoundPage />
161+
</motion.div>
162+
}
163+
/>
47164
</Routes>
48165
</AnimatePresence>
49166
);
50167
}
51168

52-
export default AnimatedRoutes;
169+
export default AnimatedRoutes;

src/components/CodeModal.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const CodeModal = ({ isOpen, onClose, children }) => {
2828
>
2929
<motion.div
3030
className="relative bg-gray-800 rounded-lg shadow-lg p-6 w-3/4 h-3/4"
31-
onClick={e => e.stopPropagation()}
31+
onClick={(e) => e.stopPropagation()}
3232
initial={{ scale: 0.8, opacity: 0 }}
3333
animate={{ scale: 1, opacity: 1 }}
3434
exit={{ scale: 0.8, opacity: 0 }}
@@ -45,7 +45,9 @@ const CodeModal = ({ isOpen, onClose, children }) => {
4545
language="jsx"
4646
PreTag="pre"
4747
className="overflow-auto h-full"
48-
codeTagProps={{ style: { fontFamily: "'JetBrains Mono', monospace" } }}
48+
codeTagProps={{
49+
style: { fontFamily: "'JetBrains Mono', monospace" },
50+
}}
4951
>
5052
{children}
5153
</SyntaxHighlighter>

src/components/ColorLegends.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,19 @@ const ColorLegends = ({ onLegendClick, hiddenLegends }) => {
3636
<div key={category} className="flex items-center mb-2">
3737
<div
3838
className={`w-4 h-4 rounded-full mr-2 cursor-pointer ${
39-
hiddenLegends.includes(category) ? "opacity-50" : "opacity-100"
39+
hiddenLegends.includes(category) ? 'opacity-50' : 'opacity-100'
4040
}`}
41-
style={{ backgroundColor: categoryStyles[category].backgroundColor, border: `1px solid ${categoryStyles[category].borderColor}` }}
41+
style={{
42+
backgroundColor: categoryStyles[category].backgroundColor,
43+
border: `1px solid ${categoryStyles[category].borderColor}`,
44+
}}
4245
onClick={() => onLegendClick(category)}
4346
></div>
4447
<span
4548
className={`cursor-pointer text-white font-light ${
46-
hiddenLegends.includes(category) ? "opacity-50 line-through" : "opacity-100"
49+
hiddenLegends.includes(category)
50+
? 'opacity-50 line-through'
51+
: 'opacity-100'
4752
}`}
4853
onClick={() => onLegendClick(category)}
4954
>

src/components/Fez.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ const Fez = () => (
2626
</svg>
2727
);
2828

29-
export default Fez;
29+
export default Fez;

0 commit comments

Comments
 (0)