Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3746497
D3425.id10357.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D3425.id10357.diff
View Options
diff --git a/web/modals/concurrent-modification-modal.react.js b/web/modals/concurrent-modification-modal.react.js
--- a/web/modals/concurrent-modification-modal.react.js
+++ b/web/modals/concurrent-modification-modal.react.js
@@ -2,6 +2,7 @@
import * as React from 'react';
+import Button from '../components/button.react';
import css from '../style.css';
import { useModalContext } from './modal-provider.react';
import Modal from './modal.react';
@@ -21,11 +22,9 @@
time as you! Please refresh the entry and try again.
</p>
<div className={css['form-footer']}>
- <input
- type="submit"
- value="Refresh entry"
- onClick={props.onRefresh}
- />
+ <Button onClick={props.onRefresh} type="submit">
+ Refresh entry
+ </Button>
</div>
</div>
</Modal>
diff --git a/web/modals/threads/confirm-leave-thread-modal.react.js b/web/modals/threads/confirm-leave-thread-modal.react.js
--- a/web/modals/threads/confirm-leave-thread-modal.react.js
+++ b/web/modals/threads/confirm-leave-thread-modal.react.js
@@ -4,6 +4,7 @@
import { type ThreadInfo } from 'lib/types/thread-types';
+import Button from '../../components/button.react';
import css from '../../style.css';
import Modal from '../modal.react';
@@ -22,7 +23,9 @@
{'"?'}
</p>
<div className={css['form-footer']}>
- <input type="submit" value="Leave thread" onClick={props.onConfirm} />
+ <Button onClick={props.onConfirm} type="submit">
+ Leave Thread
+ </Button>
</div>
</div>
</Modal>
diff --git a/web/modals/threads/new-thread-modal.react.js b/web/modals/threads/new-thread-modal.react.js
--- a/web/modals/threads/new-thread-modal.react.js
+++ b/web/modals/threads/new-thread-modal.react.js
@@ -26,6 +26,7 @@
} from 'lib/utils/action-utils';
import { firstLine } from 'lib/utils/string-utils';
+import Button from '../../components/button.react';
import { useSelector } from '../../redux/redux-utils';
import { nonThreadCalendarQuery } from '../../selectors/nav-selectors';
import css from '../../style.css';
@@ -172,12 +173,13 @@
</div>
</div>
<div className={css['form-footer']}>
- <input
- type="submit"
- value="Save"
+ <Button
onClick={this.onSubmit}
disabled={this.props.inputDisabled}
- />
+ type="submit"
+ >
+ Save
+ </Button>
<div className={css['modal-form-error']}>
{this.state.errorMessage}
</div>
@@ -220,7 +222,7 @@
});
};
- onSubmit = (event: SyntheticEvent<HTMLInputElement>) => {
+ onSubmit = (event: SyntheticEvent<HTMLButtonElement>) => {
event.preventDefault();
const threadType = this.state.threadType;
diff --git a/web/modals/threads/thread-settings-modal.react.js b/web/modals/threads/thread-settings-modal.react.js
--- a/web/modals/threads/thread-settings-modal.react.js
+++ b/web/modals/threads/thread-settings-modal.react.js
@@ -36,6 +36,7 @@
} from 'lib/utils/action-utils';
import { firstLine } from 'lib/utils/string-utils';
+import Button from '../../components/button.react';
import { useModalContext } from '../../modals/modal-provider.react';
import { useSelector } from '../../redux/redux-utils';
import css from '../../style.css';
@@ -315,21 +316,19 @@
let buttons = null;
if (this.state.currentTabType === 'delete') {
buttons = (
- <input
- type="submit"
- value="Delete"
- onClick={this.onDelete}
- disabled={inputDisabled}
- />
+ <Button onClick={this.onDelete} disabled={inputDisabled}>
+ Delete
+ </Button>
);
} else {
buttons = (
- <input
+ <Button
type="submit"
- value="Save"
onClick={this.onSubmit}
disabled={inputDisabled || !this.changeQueued()}
- />
+ >
+ Save
+ </Button>
);
}
@@ -468,7 +467,7 @@
this.setState({ accountPassword: target.value });
};
- onSubmit = (event: SyntheticEvent<HTMLInputElement>) => {
+ onSubmit = (event: SyntheticEvent<HTMLButtonElement>) => {
event.preventDefault();
this.props.dispatchActionPromise(
changeThreadSettingsActionTypes,
@@ -502,7 +501,7 @@
}
}
- onDelete = (event: SyntheticEvent<HTMLInputElement>) => {
+ onDelete = (event: SyntheticEvent<HTMLButtonElement>) => {
event.preventDefault();
this.props.dispatchActionPromise(
deleteThreadActionTypes,
diff --git a/web/splash/splash.react.js b/web/splash/splash.react.js
--- a/web/splash/splash.react.js
+++ b/web/splash/splash.react.js
@@ -18,6 +18,7 @@
useServerCall,
} from 'lib/utils/action-utils';
+import Button from '../components/button.react';
import LoadingIndicator from '../loading-indicator.react';
import LogInModal from '../modals/account/log-in-modal.react';
import { useModalContext } from '../modals/modal-provider.react';
@@ -157,13 +158,13 @@
<option value="android">Android</option>
</select>
</div>
- <button
+ <Button
type="submit"
className={css.requestAccessSubmit}
onClick={this.onSubmitRequestAccess}
>
{submitButtonContent}
- </button>
+ </Button>
</form>
{androidWarning}
</div>
@@ -220,7 +221,7 @@
}
};
- onSubmitRequestAccess = (event: SyntheticEvent<HTMLInputElement>) => {
+ onSubmitRequestAccess = (event: SyntheticEvent<HTMLButtonElement>) => {
event.preventDefault();
if (this.state.email.search(validEmailRegex) === -1) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 10, 6:25 PM (17 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2853306
Default Alt Text
D3425.id10357.diff (5 KB)
Attached To
Mode
D3425: [web] [refactor] change input buttons to <Button /> component
Attached
Detach File
Event Timeline
Log In to Comment