mirror of
https://github.com/aykhans/slash-e.git
synced 2025-09-06 09:14:18 +00:00
feat: add empty placeholder
This commit is contained in:
@@ -8,7 +8,7 @@ import toastHelper from "./Toast";
|
||||
interface Props {
|
||||
workspaceId?: WorkspaceId;
|
||||
onClose: () => void;
|
||||
onConfirm?: () => void;
|
||||
onConfirm?: (workspace: Workspace) => void;
|
||||
}
|
||||
|
||||
interface State {
|
||||
@@ -67,19 +67,20 @@ const CreateWorkspaceDialog: React.FC<Props> = (props: Props) => {
|
||||
|
||||
requestState.setLoading();
|
||||
try {
|
||||
let workspace;
|
||||
if (workspaceId) {
|
||||
await workspaceService.patchWorkspace({
|
||||
workspace = await workspaceService.patchWorkspace({
|
||||
id: workspaceId,
|
||||
...state.workspaceCreate,
|
||||
});
|
||||
} else {
|
||||
await workspaceService.createWorkspace({
|
||||
workspace = await workspaceService.createWorkspace({
|
||||
...state.workspaceCreate,
|
||||
});
|
||||
}
|
||||
|
||||
if (onConfirm) {
|
||||
onConfirm();
|
||||
onConfirm(workspace);
|
||||
} else {
|
||||
onClose();
|
||||
}
|
||||
|
@@ -122,6 +122,13 @@ const Header: React.FC = () => {
|
||||
showCreateWorkspaceDialog: false,
|
||||
});
|
||||
}}
|
||||
onConfirm={(workspace: Workspace) => {
|
||||
setState({
|
||||
...state,
|
||||
showCreateWorkspaceDialog: false,
|
||||
});
|
||||
navigate(`/${workspace.name}`);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
|
@@ -37,7 +37,7 @@ const Dropdown: React.FC<Props> = (props: Props) => {
|
||||
{trigger ? (
|
||||
trigger
|
||||
) : (
|
||||
<button className="flex flex-row justify-center items-center border p-1 rounded shadow text-gray-600 cursor-pointer hover:opacity-80">
|
||||
<button className="flex flex-row justify-center items-center p-1 rounded text-gray-600 cursor-pointer border hover:opacity-80">
|
||||
<Icon.MoreHorizontal className="w-4 h-auto" />
|
||||
</button>
|
||||
)}
|
||||
|
Reference in New Issue
Block a user