Skip to content

Commit 30cb5f5

Browse files
authored
refactor: login pages ui (#1454)
1 parent 4edc4be commit 30cb5f5

File tree

4 files changed

+107
-84
lines changed

4 files changed

+107
-84
lines changed

src/routes/LoginWithOAuthApp.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export const LoginWithOAuthApp: FC = () => {
7777
disabled={!values.hostname}
7878
icon={{ icon: PersonIcon, size: Size.XSMALL }}
7979
url={getNewOAuthAppURL(values.hostname)}
80+
size="xs"
8081
>
8182
Create new OAuth App
8283
</Button>
@@ -101,7 +102,10 @@ export const LoginWithOAuthApp: FC = () => {
101102
className="mt-2"
102103
icon={{ icon: BookIcon, size: Size.XSMALL }}
103104
url={Constants.GITHUB_DOCS.OAUTH_URL}
104-
/>
105+
size="xs"
106+
>
107+
Docs
108+
</Button>
105109

106110
<Button
107111
name="Login"
@@ -110,7 +114,9 @@ export const LoginWithOAuthApp: FC = () => {
110114
icon={{ icon: SignInIcon, size: Size.MEDIUM }}
111115
disabled={submitting || pristine}
112116
type="submit"
113-
/>
117+
>
118+
Login
119+
</Button>
114120
</div>
115121
</form>
116122
);

src/routes/LoginWithPersonalAccessToken.tsx

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,37 +58,39 @@ export const LoginWithPersonalAccessToken: FC = () => {
5858
name="hostname"
5959
label="Hostname"
6060
placeholder="github.202132.xyzpany.com"
61-
helpText={
62-
<div className="mt-1 italic">
63-
Change only if you are using GitHub Enterprise Server.
64-
</div>
65-
}
66-
/>
67-
68-
<FieldInput
69-
name="token"
70-
label="Token"
71-
placeholder="The 40 characters token generated on GitHub"
7261
helpText={
7362
<div>
74-
<div>
63+
<div className="mt-1 italic">
64+
Change only if you are using GitHub Enterprise Server.
65+
</div>
66+
<div className="mt-3">
7567
<Button
7668
label="Generate a PAT"
7769
disabled={!values.hostname}
7870
icon={{ icon: KeyIcon, size: Size.XSMALL }}
7971
url={getNewTokenURL(values.hostname)}
72+
size="xs"
8073
>
8174
Generate a PAT
8275
</Button>
83-
<span className="mx-1">on GitHub and paste above.</span>
76+
<span className="mx-1">
77+
on GitHub then paste your{' '}
78+
<span className="italic">token</span> below.
79+
</span>
8480
</div>
8581
<div className="mt-1 italic">
86-
The required scopes will be selected for you.
82+
The required scopes will be automatically selected for you.
8783
</div>
8884
</div>
8985
}
9086
/>
9187

88+
<FieldInput
89+
name="token"
90+
label="Token"
91+
placeholder="The 40 characters token generated on GitHub"
92+
/>
93+
9294
{!isValidToken && (
9395
<div className="mt-4 text-sm font-medium text-red-500">
9496
This token could not be validated with {values.hostname}.
@@ -100,6 +102,7 @@ export const LoginWithPersonalAccessToken: FC = () => {
100102
label="GitHub Docs"
101103
icon={{ icon: BookIcon, size: Size.XSMALL }}
102104
url={Constants.GITHUB_DOCS.PAT_URL}
105+
size="xs"
103106
>
104107
Docs
105108
</Button>

src/routes/__snapshots__/LoginWithOAuthApp.test.tsx.snap

Lines changed: 8 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/routes/__snapshots__/LoginWithPersonalAccessToken.test.tsx.snap

Lines changed: 74 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)