Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dashboard] Add autofocus to some modal #6408

Merged
merged 1 commit into from
Oct 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/dashboard/src/settings/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function Account() {
<li className="ml-5">Your subscription will be cancelled. If you obtained a Gitpod subscription through the GitHub marketplace, you need to cancel your plan there.</li>
</ol>
<p className="pt-4 pb-2 text-gray-600 dark:text-gray-400 text-base font-semibold">Type your email to confirm</p>
<input className="w-full" type="text" onChange={e => setTypedEmail(e.target.value)}></input>
<input autoFocus className="w-full" type="text" onChange={e => setTypedEmail(e.target.value)}></input>
</ConfirmationModal>

<PageWithSubMenu subMenu={settingsMenu} title='Account' subtitle='Manage account and git configuration.'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function AddEnvVarModal(p: EnvVarModalProps) {
</div> : null}
<div>
<h4>Name</h4>
<input className="w-full" type="text" value={ev.name} onChange={(v) => { update({name: v.target.value}) }} />
<input autoFocus className="w-full" type="text" value={ev.name} onChange={(v) => { update({name: v.target.value}) }} />
</div>
<div className="mt-4">
<h4>Value</h4>
Expand Down
2 changes: 1 addition & 1 deletion components/dashboard/src/teams/NewTeam.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function () {
<div className="border rounded-xl p-6 border-gray-100 dark:border-gray-800">
<h3 className="text-center text-xl mb-6">What's your team's name?</h3>
<h4>Team Name</h4>
<input className={`w-full${!!creationError ? ' error' : ''}`} type="text" onChange={event => name = event.target.value} />
<input autoFocus className={`w-full${!!creationError ? ' error' : ''}`} type="text" onChange={event => name = event.target.value} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: YES!

{!!creationError && <p className="text-gitpod-red">{creationError.message.replace(/Request \w+ failed with message: /, '')}</p>}
</div>
<div className="flex flex-row-reverse space-x-2 space-x-reverse mt-2">
Expand Down
2 changes: 1 addition & 1 deletion components/dashboard/src/teams/TeamSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default function TeamSettings() {
<li className="ml-5">All <b>members</b> of this team will lose access to this team, associated projects and workspaces.</li>
</ol>
<p className="pt-4 pb-2 text-gray-600 dark:text-gray-400 text-base font-semibold">Type <CodeText>{team?.slug}</CodeText> to confirm</p>
<input className="w-full" type="text" onChange={e => setTeamSlug(e.target.value)}></input>
<input autoFocus className="w-full" type="text" onChange={e => setTeamSlug(e.target.value)}></input>
</ConfirmationModal>
</>
}
2 changes: 1 addition & 1 deletion components/dashboard/src/workspaces/WorkspaceEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export function WorkspaceEntry({ desc, model, isAdmin, stopWorkspace }: Props) {
{errorMessage}
</div>
: null}
<input className="w-full truncate" type="text" defaultValue={workspaceDescription} ref={renameInputRef} />
<input autoFocus className="w-full truncate" type="text" defaultValue={workspaceDescription} ref={renameInputRef} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: This feels good!

<div className="mt-1">
<p className="text-gray-500">Change the description to make it easier to go back to a workspace.</p>
<p className="text-gray-500">Workspace URLs and endpoints will remain the same.</p>
Expand Down