Skip to content

Commit a3816d2

Browse files
authored
Update auth ui appearance (#156)
1 parent 95670b1 commit a3816d2

File tree

29 files changed

+53
-26
lines changed

29 files changed

+53
-26
lines changed

packages/devextreme-cli/templates/react/application/src/App.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,33 @@ import LoadPanel from 'devextreme-react/load-panel';
66
import { NavigationProvider } from './contexts/navigation';
77
import { AuthProvider, useAuth } from './contexts/auth';
88
import { useScreenSize } from './utils/media-query';
9-
import AuthenticatedApp from './AuthenticatedApp';
10-
import PublicApp from './PublicApp';
9+
import Content from './Content';
10+
import NotAuthenticatedContent from './NotAuthenticatedContent';
1111

1212
function App() {
1313
const { user, loading } = useAuth();
14-
const screenSize = useScreenSize();
1514

1615
if (loading) {
17-
return <LoadPanel visible={true} />
16+
return <LoadPanel visible={true} />;
1817
}
1918

20-
return (
21-
<div className={`app ${screenSize}`}>
22-
{
23-
user ? <AuthenticatedApp /> : <PublicApp />
24-
}
25-
</div>
26-
);
19+
if (user) {
20+
return <Content />;
21+
}
22+
23+
return <NotAuthenticatedContent />;
2724
}
2825

2926
export default function () {
27+
const screenSize = useScreenSize();
28+
3029
return (
3130
<Router>
3231
<AuthProvider>
3332
<NavigationProvider>
34-
<App />
33+
<div className={`app ${screenSize}`}>
34+
<App />
35+
</div>
3536
</NavigationProvider>
3637
</AuthProvider>
3738
</Router>

packages/devextreme-cli/templates/react/application/src/AuthenticatedApp.js renamed to packages/devextreme-cli/templates/react/application/src/Content.js

File renamed without changes.

packages/devextreme-cli/templates/react/application/src/PublicApp.js renamed to packages/devextreme-cli/templates/react/application/src/NotAuthenticatedContent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ export default function () {
1818
</Route>
1919
<Route exact path='/reset-password' >
2020
<SingleCard
21-
title="Password reset"
22-
description="Enter your email address and we will send you a password reset link"
21+
title="Password Reset"
22+
description="Please enter the email address that you used to register, and we will send you an email with a link to reset your password."
2323
>
2424
<ResetPasswordForm />
2525
</SingleCard>

packages/devextreme-cli/templates/react/application/src/components/create-account-form/create-account-form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,4 @@ export default function (props) {
9797

9898
const emailEditorOptions = { stylingMode: 'filled', placeholder: 'Email', mode: 'email' };
9999
const passwordEditorOptions = { stylingMode: 'filled', placeholder: 'Password', mode: 'password' };
100-
const confirmedPasswordEditorOptions = { stylingMode: 'filled', placeholder: 'Re-type Your Password', mode: 'password' };
100+
const confirmedPasswordEditorOptions = { stylingMode: 'filled', placeholder: 'Confirm Password', mode: 'password' };

packages/devextreme-cli/templates/react/application/src/components/create-account-form/create-account-form.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
.create-account-form {
44
.policy-info {
5-
color: rgba(0, 0, 0, 0.54);
5+
margin: 10px 0;
6+
color: rgba($base-text-color, alpha($base-text-color) * 0.7);
67
font-size: 14px;
78
font-style: normal;
89

910
a {
10-
color: rgba(0, 0, 0, 0.54);
11+
color: rgba($base-text-color, alpha($base-text-color) * 0.7);
1112
}
1213
}
1314

packages/devextreme-cli/templates/react/application/src/components/login-form/login-form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export default function (props) {
6767
{
6868
loading
6969
? <LoadIndicator width={'24px'} height={'24px'} visible={true} />
70-
: 'Sign in'
70+
: 'Sign In'
7171
}
7272
</span>
7373
</ButtonOptions>

packages/devextreme-cli/templates/react/application/src/components/login-form/login-form.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import "../../themes/generated/variables.base.scss";
2+
13
.login-form {
24
.link {
35
text-align: center;
@@ -10,6 +12,7 @@
1012
}
1113

1214
.form-text {
13-
color: rgba(0, 0, 0, 0.54);
15+
margin: 10px 0;
16+
color: rgba($base-text-color, alpha($base-text-color) * 0.7);
1417
}
1518
}

packages/devextreme-cli/templates/react/application/src/components/reset-password-form/reset-password-form.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState, useRef, useCallback } from 'react';
2-
import { useHistory } from "react-router-dom";
2+
import { Link, useHistory } from "react-router-dom";
33
import Form, {
44
Item,
55
Label,
@@ -10,8 +10,9 @@ import Form, {
1010
} from 'devextreme-react/form';
1111
import LoadIndicator from 'devextreme-react/load-indicator';
1212
import notify from 'devextreme/ui/notify';
13+
import './reset-password-form.scss'
1314

14-
const notificationText = 'Check your email for a message with a link to update your password';
15+
const notificationText = 'We\'ve sent a link to reset your password. Check your inbox.';
1516

1617
export default function (props) {
1718
const history = useHistory();
@@ -31,7 +32,7 @@ export default function (props) {
3132
}, [history]);
3233

3334
return (
34-
<form onSubmit={onSubmit}>
35+
<form className={'reset-password-form'} onSubmit={onSubmit}>
3536
<Form formData={formData.current} disabled={loading}>
3637
<Item
3738
dataField={'email'}
@@ -44,6 +45,7 @@ export default function (props) {
4445
</Item>
4546
<ButtonItem>
4647
<ButtonOptions
48+
elementAttr={submitButtonAttributes}
4749
width={'100%'}
4850
type={'default'}
4951
useSubmitBehavior={true}
@@ -57,9 +59,15 @@ export default function (props) {
5759
</span>
5860
</ButtonOptions>
5961
</ButtonItem>
62+
<Item>
63+
<div className={'login-link'}>
64+
Return to <Link to={'/login'}>Sign In</Link>
65+
</div>
66+
</Item>
6067
</Form>
6168
</form>
6269
);
6370
}
6471

6572
const emailEditorOptions = { stylingMode: 'filled', placeholder: 'Email', mode: 'email' };
73+
const submitButtonAttributes = { class: 'submit-button' };
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@import "../../themes/generated/variables.base.scss";
2+
3+
.reset-password-form {
4+
.submit-button {
5+
margin-top: 10px;
6+
}
7+
8+
.login-link {
9+
color: $base-accent;
10+
font-size: 16px;
11+
text-align: center;
12+
}
13+
}

packages/devextreme-cli/templates/react/application/src/layouts/single-card/single-card.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
}
3030

3131
.description {
32-
color: rgba(0, 0, 0, 0.54);
32+
color: rgba($base-text-color, alpha($base-text-color) * 0.7);
33+
line-height: 18px;
3334
}
3435
}
3536
}

0 commit comments

Comments
 (0)