Skip to content

Commit 4109e98

Browse files
committed
Fix prettier
1 parent 5a77bab commit 4109e98

File tree

3 files changed

+87
-72
lines changed

3 files changed

+87
-72
lines changed
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
2-
import { darcula } from 'react-syntax-highlighter/dist/esm/styles/prism';
1+
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
2+
import { darcula } from "react-syntax-highlighter/dist/esm/styles/prism";
33

44
const CodeSnippetHighlight = () => {
5-
const code = `class Solution:
5+
const code = `class Solution:
66
def twoSum(self, nums: List[int], target: int) -> List[int]:
77
idxDict = {}
88
for i, num in enumerate(nums):
@@ -12,11 +12,11 @@ const CodeSnippetHighlight = () => {
1212
diff = target - num
1313
if diff in idxDict and i != idxDict[diff]:
1414
return [i, idxDict[diff]]`;
15-
return (
16-
<SyntaxHighlighter language="python" style={darcula}>
17-
{code}
18-
</SyntaxHighlighter>
19-
);
15+
return (
16+
<SyntaxHighlighter language="python" style={darcula}>
17+
{code}
18+
</SyntaxHighlighter>
19+
);
2020
};
2121

22-
export default CodeSnippetHighlight;
22+
export default CodeSnippetHighlight;

frontend/src/app/(auth)/home/components/navbar/Navbar.tsx

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,46 @@ import Link from "next/link";
33
import Header from "@/components/ui/Header";
44

55
const Navbar = () => {
6-
const [currentPath, setCurrentPath] = useState("");
6+
const [currentPath, setCurrentPath] = useState("");
77

8-
useEffect(() => {
9-
// Update the state with the current pathname on the client side
10-
setCurrentPath(window.location.pathname);
11-
}, []);
12-
13-
const isActive = (path: string) => currentPath === path;
14-
return (
15-
<nav className="flex justify-between items-center p-4 bg-gray-900">
16-
<div className="flex-shrink-0">
17-
<Header />
18-
</div>
8+
useEffect(() => {
9+
// Update the state with the current pathname on the client side
10+
setCurrentPath(window.location.pathname);
11+
}, []);
1912

20-
<div className="flex space-x-6">
21-
<Link href="/" className={`text-primary-300 hover:underline ${isActive("/") ? "opacity-100" : "opacity-50 hover:opacity-100"}`}>
22-
Home
23-
</Link>
24-
<Link href="" className={`text-primary-300 hover:underline ${isActive("/about") ? "opacity-100" : "opacity-50 hover:opacity-100"}`}>
25-
About Us
26-
</Link>
27-
<Link href="https://github.com/CS3219-AY2425S1/cs3219-ay2425s1-project-g15" className="text-primary-300 opacity-50 hover:underline hover:opacity-100">
28-
Our Codebase
29-
</Link>
30-
</div>
31-
</nav>
32-
);
13+
const isActive = (path: string) => currentPath === path;
14+
return (
15+
<nav className="flex justify-between items-center p-4 bg-gray-900">
16+
<div className="flex-shrink-0">
17+
<Header />
18+
</div>
19+
20+
<div className="flex space-x-6">
21+
<Link
22+
href="/"
23+
className={`text-primary-300 hover:underline ${
24+
isActive("/") ? "opacity-100" : "opacity-50 hover:opacity-100"
25+
}`}
26+
>
27+
Home
28+
</Link>
29+
<Link
30+
href=""
31+
className={`text-primary-300 hover:underline ${
32+
isActive("/about") ? "opacity-100" : "opacity-50 hover:opacity-100"
33+
}`}
34+
>
35+
About Us
36+
</Link>
37+
<Link
38+
href="https://github.com/CS3219-AY2425S1/cs3219-ay2425s1-project-g15"
39+
className="text-primary-300 opacity-50 hover:underline hover:opacity-100"
40+
>
41+
Our Codebase
42+
</Link>
43+
</div>
44+
</nav>
45+
);
3346
};
3447

35-
export default Navbar;
48+
export default Navbar;

frontend/src/app/(auth)/layout.tsx

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -70,44 +70,46 @@ const Layout = ({ children }: { children: ReactNode }) => {
7070

7171
return (
7272
<div className="flex h-full overflow-y-auto">
73-
{authStatus !== AuthStatus.UNAUTHENTICATED && <Sidebar
74-
className="sticky top-0 h-screen"
75-
rootStyles={{
76-
borderColor: "#171C28",
77-
}}
78-
collapsed={!isHovered}
79-
onMouseEnter={() => setIsHovered(true)}
80-
onMouseLeave={() => {
81-
setIsHovered(false);
82-
}}
83-
backgroundColor={"#171C28"}
84-
>
85-
<div className="h-full flex flex-col justify-between">
86-
<Menu menuItemStyles={menuItemStyles}>
87-
{sidebarItems.map((item, idx) => (
88-
<SidebarMenuItem
89-
key={idx}
90-
menuLabel={item["menuLabel"]}
91-
menuIcon={item["menuIcon"]}
92-
linksTo={item["linksTo"]}
93-
/>
94-
))}
95-
</Menu>
96-
<Menu
97-
menuItemStyles={menuItemStyles}
98-
rootStyles={{
99-
marginBottom: "60px",
100-
}}
101-
>
102-
<MenuItem
103-
icon={<RiLogoutBoxLine size={iconSize} />}
104-
onClick={logout}
73+
{authStatus !== AuthStatus.UNAUTHENTICATED && (
74+
<Sidebar
75+
className="sticky top-0 h-screen"
76+
rootStyles={{
77+
borderColor: "#171C28",
78+
}}
79+
collapsed={!isHovered}
80+
onMouseEnter={() => setIsHovered(true)}
81+
onMouseLeave={() => {
82+
setIsHovered(false);
83+
}}
84+
backgroundColor={"#171C28"}
85+
>
86+
<div className="h-full flex flex-col justify-between">
87+
<Menu menuItemStyles={menuItemStyles}>
88+
{sidebarItems.map((item, idx) => (
89+
<SidebarMenuItem
90+
key={idx}
91+
menuLabel={item["menuLabel"]}
92+
menuIcon={item["menuIcon"]}
93+
linksTo={item["linksTo"]}
94+
/>
95+
))}
96+
</Menu>
97+
<Menu
98+
menuItemStyles={menuItemStyles}
99+
rootStyles={{
100+
marginBottom: "60px",
101+
}}
105102
>
106-
Logout
107-
</MenuItem>
108-
</Menu>
109-
</div>
110-
</Sidebar>}
103+
<MenuItem
104+
icon={<RiLogoutBoxLine size={iconSize} />}
105+
onClick={logout}
106+
>
107+
Logout
108+
</MenuItem>
109+
</Menu>
110+
</div>
111+
</Sidebar>
112+
)}
111113
<div className="w-full overflow-y-scroll">{children}</div>
112114
</div>
113115
);

0 commit comments

Comments
 (0)