Enhance FileMenu component: load project name from localStorage and allow renaming, update sidebar styles with border-radius and background color adjustments.
This commit is contained in:
parent
71eb7e32af
commit
c0c5ac680c
|
@ -31,6 +31,22 @@ const FileMenu: React.FC = () => {
|
||||||
return () => document.removeEventListener("mousedown", handleClickOutside);
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
// project
|
||||||
|
const [projectName, setProjectName] = useState("project 1");
|
||||||
|
|
||||||
|
// Load project name from localStorage on mount
|
||||||
|
useEffect(() => {
|
||||||
|
const savedName = localStorage.getItem("projectName");
|
||||||
|
if (savedName) {
|
||||||
|
setProjectName(savedName);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handleProjectRename = (newName: string) => {
|
||||||
|
setProjectName(newName);
|
||||||
|
localStorage.setItem("projectName", newName);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
className="project-dropdowm-container"
|
className="project-dropdowm-container"
|
||||||
|
@ -41,7 +57,7 @@ const FileMenu: React.FC = () => {
|
||||||
<div className="icon">
|
<div className="icon">
|
||||||
<ProjectIcon />
|
<ProjectIcon />
|
||||||
</div>
|
</div>
|
||||||
<RenameInput value="untitled" />
|
<RenameInput value={projectName} onRename={handleProjectRename} />
|
||||||
</div>
|
</div>
|
||||||
<div className="more-options-button">
|
<div className="more-options-button">
|
||||||
<ArrowIcon />
|
<ArrowIcon />
|
||||||
|
|
|
@ -460,6 +460,8 @@
|
||||||
color: #666;
|
color: #666;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
grid-column: 1 / -1;
|
grid-column: 1 / -1;
|
||||||
|
border-radius: #{$border-radius-large};
|
||||||
|
background: var(--background-color);
|
||||||
|
|
||||||
.products-list {
|
.products-list {
|
||||||
padding-top: 1rem;
|
padding-top: 1rem;
|
||||||
|
@ -779,7 +781,7 @@
|
||||||
.event-proprties-wrapper {
|
.event-proprties-wrapper {
|
||||||
position: relative;
|
position: relative;
|
||||||
max-height: calc(60vh - (47px - 35px));
|
max-height: calc(60vh - (47px - 35px));
|
||||||
width: calc(100% - 4px);
|
width: 304px;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
|
|
Loading…
Reference in New Issue