fix: render RepositoryCreateDialog on desktop when adding repository
RepositoryCreateDialog was only rendered inside the isMobile block. Desktop 'Add Repository' clicks set state but the dialog never appeared. Add conditional rendering in the desktop section. Quality gates: tsc --noEmit pass, npm run build pass, 80/80 tests pass
This commit is contained in:
@@ -65,7 +65,10 @@ export const ProjectCard = ({
|
||||
type="button"
|
||||
aria-expanded={expanded}
|
||||
>
|
||||
<Icon name={expanded ? "chevron-down" : "chevron-right"} size="sm" />
|
||||
<Icon
|
||||
name={expanded ? "chevron-down" : "chevron-right"}
|
||||
size="sm"
|
||||
/>
|
||||
</button>
|
||||
)}
|
||||
<div>
|
||||
|
||||
@@ -127,11 +127,7 @@ export const ProjectsPage = () => {
|
||||
}
|
||||
onWorkspaceAction={(repoId, workspace, action) => {
|
||||
if (action === "sync") {
|
||||
void handleSyncWorkspace(
|
||||
selectedProject.id,
|
||||
repoId,
|
||||
workspace,
|
||||
);
|
||||
void handleSyncWorkspace(selectedProject.id, repoId, workspace);
|
||||
} else if (action === "delete") {
|
||||
void handleDeleteWorkspace(workspace);
|
||||
}
|
||||
@@ -276,6 +272,23 @@ export const ProjectsPage = () => {
|
||||
onCancel={closeDialog}
|
||||
/>
|
||||
)}
|
||||
|
||||
{mobileView === "create-repo" && selectedProject && (
|
||||
<RepositoryCreateDialog
|
||||
projectId={selectedProject.id}
|
||||
open={true}
|
||||
title="Add Repository"
|
||||
onClose={() => {
|
||||
setMobileView("list");
|
||||
setSelectedProject(null);
|
||||
}}
|
||||
onCreated={async () => {
|
||||
setMobileView("list");
|
||||
setSelectedProject(null);
|
||||
await reload();
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</section>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -137,4 +137,3 @@
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user