Skip to content

Commit 853e611

Browse files
committed
[dashboard] addition workspaces list features
1 parent 26cbae4 commit 853e611

File tree

12 files changed

+463
-312
lines changed

12 files changed

+463
-312
lines changed

components/dashboard/public/manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
"icons": [
55
{
66
"src": "favicon256.png",
7-
"sizes": "64x64 32x32 24x24 16x16",
7+
"sizes": "256x256 64x64 32x32 24x24 16x16",
88
"type": "image/x-icon"
99
},
1010
{
11-
"src": "logo192.png",
11+
"src": "favicon192.png",
1212
"type": "image/png",
1313
"sizes": "192x192"
1414
},
1515
{
16-
"src": "logo512.png",
16+
"src": "favicon512.png",
1717
"type": "image/png",
1818
"sizes": "512x512"
1919
}

components/dashboard/src/components/ContextMenu.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useState } from 'react';
33
export interface ContextMenuProps {
44
children: React.ReactChild[] | React.ReactChild;
55
menuEntries: ContextMenuEntry[];
6+
width?: string;
67
}
78

89
export interface ContextMenuEntry {
@@ -49,7 +50,7 @@ function ContextMenu(props: ContextMenuProps) {
4950
{props.children}
5051
</div>
5152
{expanded?
52-
<div className={`z-50 w-40 bg-white absolute py-2 right-0 flex flex-col border border-gray-200 rounded-lg space-y-2`}>
53+
<div className={`z-50 ${props.width || 'w-40'} bg-white absolute py-2 right-0 flex flex-col border border-gray-200 rounded-lg space-y-2`}>
5354
{enhancedEntries.map(e => {
5455
const entry = <div key={e.title} className={`px-4 flex py-2 text-gray-600 hover:bg-gray-200 text-sm leading-1 ${e.customFontStyle || font} ${e.separator? ' border-b border-gray-200':''}`} >
5556
<div>{e.title}</div><div className="flex-1"></div>{e.active ? <div className="pl-1 font-semibold">&#x2713;</div>: null}

components/dashboard/src/components/DropDown.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { useState } from 'react';
22
import ContextMenu from './ContextMenu';
33

44
export interface DropDownProps {
5+
prefix?: string;
6+
contextMenuWidth?: string;
57
entries: {
68
title: string,
79
onClick: ()=>void
@@ -26,8 +28,8 @@ function DropDown(props: DropDownProps) {
2628
})
2729
const font = "text-gray-400 text-sm leading-1"
2830
return (
29-
<ContextMenu menuEntries={enhancedEntries}>
30-
<span className={`py-2 cursor-pointer ${font}`}>{current}<Arrow up={false}/></span>
31+
<ContextMenu menuEntries={enhancedEntries} width={props.contextMenuWidth}>
32+
<span className={`py-2 cursor-pointer ${font}`}>{props.prefix}{current}<Arrow up={false}/></span>
3133
</ContextMenu>
3234
);
3335
}

components/dashboard/src/components/Modal.tsx

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,29 @@ export default function Modal(props: {
22
children: React.ReactChild[] | React.ReactChild,
33
visible: boolean,
44
closeable?: boolean,
5+
className?: string,
56
onClose: () => void
67
}) {
78
if (!props.visible) {
89
return null;
910
}
10-
setTimeout(() => window.addEventListener('click', props.onClose, {once: true}), 0);
11+
setTimeout(() => window.addEventListener('click', props.onClose, { once: true }), 0);
1112
return (
12-
<div className="fixed top-0 -left-2 bg-black bg-opacity-70 z-50 w-screen h-screen" >
13-
<div className="bg-transparent h-1/3" />
14-
<div className="bg-white border rounded-xl p-6 max-w-lg mx-auto">
15-
{props.closeable !== false && (
16-
<div className="float-right cursor-pointer" onClick={props.onClose}>&#10006;</div>
17-
)}
18-
{props.children}
13+
<div className="fixed top-0 left-0 bg-black bg-opacity-70 z-50 w-screen h-screen" >
14+
<div className="w-screen h-screen align-middle" style={{display: 'table-cell'}}>
15+
<div className={"relative bg-white border rounded-xl p-6 max-w-lg mx-auto text-gray-600" + props.className}>
16+
{props.closeable !== false && (
17+
<div className="absolute right-9 top-8 cursor-pointer" onClick={props.onClose}>
18+
<svg version="1.1" width="14px" height="14px"
19+
viewBox="0 0 100 100">
20+
<line x1="0" y1="0" x2="100" y2="100" stroke="currentColor" strokeWidth="10px" />
21+
<line x1="0" y1="100" x2="100" y2="0" stroke="currentColor" strokeWidth="10px" />
22+
</svg>
23+
</div>
24+
25+
)}
26+
{props.children}
27+
</div>
1928
</div>
2029
</div>
2130
);

components/dashboard/src/index.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
font-size: 48px;
1010
}
1111
h2 {
12-
@apply text-base text-gray-400;
12+
@apply text-base text-gray-500;
1313
}
1414
h3 {
1515
@apply text-2xl text-gray-900 leading-9 font-semibold;
@@ -29,7 +29,7 @@
2929

3030
@layer components {
3131
button {
32-
@apply cursor-pointer px-3 py-2 text-white text-sm rounded-md border-2 border-gray-900 bg-gray-500 hover:bg-gray-100;
32+
@apply cursor-pointer px-3 py-1 my-auto bg-green-600 hover:bg-green-700 border-2 border-green-800 text-gray-100 text-sm rounded-md;
3333
}
3434

3535
input[type=text] {

components/dashboard/src/start/CreateWorkspace.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ export class CreateWorkspace extends React.Component<CreateWorkspaceProps, Creat
9393
<p>{w.workspace.contextURL}</p>
9494
</div>
9595
<div className="flex">
96-
<button className="px-3 py-1 my-auto opacity-0 group-hover:opacity-100 bg-green-600 hover:bg-green-700 border-green-800">Open</button>
96+
<button>Open</button>
9797
</div>
9898
</a>
9999
)}
100100
</>
101101
</div>
102102
<div className="flex justify-end mt-4">
103-
<button className="bg-green-600 hover:bg-green-700 border-green-800" onClick={() => this.createWorkspace(CreateWorkspaceMode.Default)}>New Workspace</button>
103+
<button onClick={() => this.createWorkspace(CreateWorkspaceMode.Default)}>New Workspace</button>
104104
</div>
105105
</Modal>;
106106
}

0 commit comments

Comments
 (0)