Skip to content

Commit 8c593b9

Browse files
committed
Display project name
1 parent c2878e6 commit 8c593b9

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/application/sidebar/ExplorerPanel.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import { useAtomValue } from 'jotai';
2+
3+
import { projectNameAtom } from '../../atoms/projectState';
14
import { CloseIcon, OpenIcon } from '../../components/icons';
25
import { PanelWrapper } from '../../components/PanelWrapper';
36
import { emitEvent } from '../../events';
@@ -7,13 +10,15 @@ export function ExplorerPanel() {
710
const openProject = () => emitEvent('refstudio://menu/file/project/open');
811
const closeProject = () => emitEvent('refstudio://menu/file/project/close');
912

13+
const projectName = useAtomValue(projectNameAtom);
14+
1015
return (
1116
<PanelWrapper
1217
actions={[
1318
{ key: 'open', Icon: <OpenIcon />, title: 'Open Project', onClick: openProject },
1419
{ key: 'close', Icon: <CloseIcon />, title: 'Close Project', onClick: closeProject },
1520
]}
16-
title="Project"
21+
title={projectName}
1722
>
1823
<div className="flex flex-1 flex-col items-start gap-2 self-stretch overflow-y-auto overflow-x-hidden p-4 pt-2">
1924
<FileExplorer />

src/atoms/projectState.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const currentProjectIdAtom = atom('');
1717
// #####################################################################################
1818
export const isProjectOpenAtom = atom((get) => get(currentProjectPathAtom) !== '');
1919
export const projectPathAtom: Atom<string> = currentProjectPathAtom;
20+
export const projectNameAtom: Atom<string> = currentProjectNameAtom;
2021
export const projectIdAtom: Atom<string> = currentProjectIdAtom;
2122

2223
export const newProjectAtom = atom(null, async (_, set, projectId: string, path: string, name: string) => {

0 commit comments

Comments
 (0)