Skip to content

Commit 5903d7b

Browse files
committed
[dashboard] Update 'Open in Gitpod' modal design to spec
1 parent 59dba70 commit 5903d7b

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

components/dashboard/src/components/RepositoryFinder.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import { User } from "@gitpod/gitpod-protocol";
88
import React, { useContext, useEffect, useState } from "react";
9+
import { Link } from "react-router-dom";
910
import { getGitpodService } from "../service/service";
1011
import { UserContext } from "../user-context";
1112

@@ -80,9 +81,18 @@ export default function RepositoryFinder(props: { initialQuery?: string }) {
8081
<div className="py-4">
8182
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16" width="16" height="16"><path fill="#A8A29E" d="M6 2a4 4 0 100 8 4 4 0 000-8zM0 6a6 6 0 1110.89 3.477l4.817 4.816a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 010 6z" /></svg>
8283
</div>
83-
<input type="search" className="flex-grow" placeholder="Repository" autoFocus value={searchQuery} onChange={e => search(e.target.value)} onKeyDown={onKeyDown} />
84+
<input type="search" className="flex-grow" placeholder="repository" autoFocus value={searchQuery} onChange={e => search(e.target.value)} onKeyDown={onKeyDown} />
8485
</div>
85-
<div className="mt-3 flex flex-col space-y-2 h-64 overflow-y-auto" id="search-results">
86+
<div className="mt-3 -mx-5 px-5 flex flex-col space-y-2 h-64 overflow-y-auto">
87+
{searchQuery === '' && searchResults.length === 0 &&
88+
<div className="mt-12 mx-auto w-96 text-gray-500">
89+
Paste a <a className="gp-link" href="https://www.gitpod.io/docs/context-urls">repository context URL</a>, or start typing to see suggestions from:
90+
<ul className="list-disc mt-4 pl-7 flex flex-col space-y-1">
91+
<li>Your recent repositories</li>
92+
<li>Your repositories from <Link className="gp-link" to="/integrations">connected integrations</Link></li>
93+
<li>Example repositories</li>
94+
</ul>
95+
</div>}
8696
{searchResults.slice(0, MAX_DISPLAYED_ITEMS).map((result, index) =>
8797
<a className={`px-4 py-3 rounded-xl` + (result === selectedSearchResult ? ' bg-gray-600 text-gray-50 dark:bg-gray-700' : '')} href={`/#${result}`} key={`search-result-${index}`} onMouseEnter={() => setSelectedSearchResult(result)}>
8898
{searchQuery.length < 2
@@ -157,5 +167,5 @@ async function findResults(query: string, onResults: (results: string[]) => void
157167
} catch {
158168
}
159169
// console.log('searching', query, 'in', searchData);
160-
onResults(searchData.filter(result => result.includes(query)));
170+
onResults(searchData.filter(result => result.toLowerCase().includes(query.toLowerCase())));
161171
}

components/dashboard/src/workspaces/StartWorkspaceModal.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ export function StartWorkspaceModal() {
1313
const { isStartWorkspaceModalVisible, setIsStartWorkspaceModalVisible } = useContext(StartWorkspaceModalContext);
1414

1515
return <Modal onClose={() => setIsStartWorkspaceModalVisible(false)} onEnter={() => false} visible={!!isStartWorkspaceModalVisible}>
16-
<h3 className="pb-2">New Workspace</h3>
16+
<h3 className="pb-2">Open in Gitpod</h3>
1717
<div className="border-t border-gray-200 dark:border-gray-800 mt-2 -mx-6 px-6 pt-4">
18-
<h4 className="text-base">Search or paste a repository URL</h4>
1918
<RepositoryFinder />
2019
</div>
2120
</Modal>;

components/dashboard/src/workspaces/Workspaces.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default function () {
6969
onClick: () => { if (workspaceModel) workspaceModel.limit = 200; }
7070
}]} />
7171
</div>
72-
<button onClick={() => setIsStartWorkspaceModalVisible(true)} className="ml-2">New Workspace ({StartWorkspaceModalKeyBinding})</button>
72+
<button onClick={() => setIsStartWorkspaceModalVisible(true)} className="ml-2">New Workspace <span className="opacity-60 hidden md:inline">{StartWorkspaceModalKeyBinding}</span></button>
7373
</div>
7474
<ItemsList className="app-container pb-40">
7575
<div className="border-t border-gray-200 dark:border-gray-800"></div>
@@ -99,7 +99,7 @@ export default function () {
9999
<h3 className="text-center pb-3 text-gray-500 dark:text-gray-400">No Workspaces</h3>
100100
<div className="text-center pb-6 text-gray-500">Prefix any Git repository URL with {window.location.host}/# or create a new workspace for a recently used project. <a className="gp-link" href="https://www.gitpod.io/docs/getting-started/">Learn more</a></div>
101101
<span>
102-
<button onClick={() => setIsStartWorkspaceModalVisible(true)}>New Workspace ({StartWorkspaceModalKeyBinding})</button>
102+
<button onClick={() => setIsStartWorkspaceModalVisible(true)}>New Workspace <span className="opacity-60 hidden md:inline">{StartWorkspaceModalKeyBinding}</span></button>
103103
</span>
104104
</>
105105
</div>

0 commit comments

Comments
 (0)