Skip to content

Commit

Permalink
Merge pull request #2887 from reosarevok/dollar-dollar-bill-yall
Browse files Browse the repository at this point in the history
Use React$ global types instead of React. ones
  • Loading branch information
reosarevok authored Mar 8, 2023
2 parents bacbf25 + 830355d commit ceefb6c
Show file tree
Hide file tree
Showing 766 changed files with 976 additions and 1,948 deletions.
4 changes: 1 addition & 3 deletions root/account/Donation.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/

import * as React from 'react';

import UserAccountLayout, {
sanitizedAccountLayoutUser,
} from '../components/UserAccountLayout.js';
Expand All @@ -27,7 +25,7 @@ const Donation = ({
days,
nag,
user,
}: Props): React.Element<typeof UserAccountLayout> => (
}: Props): React$Element<typeof UserAccountLayout> => (
<UserAccountLayout
entity={sanitizedAccountLayoutUser(user)}
page="donation"
Expand Down
2 changes: 1 addition & 1 deletion root/account/EditProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import EditProfileForm

const EditProfile = (
props: EditProfileFormPropsT,
): React.Element<typeof UserAccountLayout> | null => {
): React$Element<typeof UserAccountLayout> | null => {
const $c = React.useContext(CatalystContext);
const user = $c.user;
if (!user) {
Expand Down
4 changes: 1 addition & 3 deletions root/account/EmailVerificationStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/

import * as React from 'react';

import StatusPage from '../components/StatusPage.js';

type Props = {
Expand All @@ -17,7 +15,7 @@ type Props = {

const EmailVerificationStatus = ({
message,
}: Props): React.Element<typeof StatusPage> => (
}: Props): React$Element<typeof StatusPage> => (
<StatusPage title={l('Email Verification')}>
<p>
{nonEmpty(message)
Expand Down
4 changes: 1 addition & 3 deletions root/account/LostPassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/

import * as React from 'react';

import Layout from '../layout/index.js';
import FormCsrfToken
from '../static/scripts/edit/components/FormCsrfToken.js';
Expand All @@ -27,7 +25,7 @@ type Props = {
+form: LostPasswordFormT,
};

const LostPassword = (props: Props): React.Element<typeof Layout> => (
const LostPassword = (props: Props): React$Element<typeof Layout> => (
<Layout fullWidth title={l('Lost Password')}>
<h1>{l('Lost Password')}</h1>
<p>
Expand Down
4 changes: 1 addition & 3 deletions root/account/LostPasswordSent.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/

import * as React from 'react';

import StatusPage from '../components/StatusPage.js';
import {CONTACT_URL} from '../constants.js';

const LostPasswordSent = (): React.Element<typeof StatusPage> => (
const LostPasswordSent = (): React$Element<typeof StatusPage> => (
<StatusPage title={hyphenateTitle(l('Lost Password'), l('Email Sent!'))}>
<p>
{exp.l(
Expand Down
4 changes: 1 addition & 3 deletions root/account/LostUsername.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/

import * as React from 'react';

import Layout from '../layout/index.js';
import FormCsrfToken
from '../static/scripts/edit/components/FormCsrfToken.js';
Expand All @@ -25,7 +23,7 @@ type Props = {
+form: LostUsernameFormT,
};

const LostUsername = (props: Props): React.Element<typeof Layout> => (
const LostUsername = (props: Props): React$Element<typeof Layout> => (
<Layout fullWidth title={l('Lost Username')}>
<h1>{l('Lost Username')}</h1>
<p>
Expand Down
4 changes: 1 addition & 3 deletions root/account/LostUsernameSent.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/

import * as React from 'react';

import StatusPage from '../components/StatusPage.js';
import {CONTACT_URL} from '../constants.js';

const LostUsernameSent = (): React.Element<typeof StatusPage> => (
const LostUsernameSent = (): React$Element<typeof StatusPage> => (
<StatusPage title={hyphenateTitle(l('Lost Username'), l('Email Sent!'))}>
<p>
{exp.l(
Expand Down
2 changes: 1 addition & 1 deletion root/account/Preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import PreferencesForm

const Preferences = (
props: PreferencesFormPropsT,
): React.Element<typeof UserAccountLayout> | null => {
): React$Element<typeof UserAccountLayout> | null => {
const $c = React.useContext(CatalystContext);
const user = $c.user;
if (!user) {
Expand Down
2 changes: 1 addition & 1 deletion root/account/PreferencesSaved.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import * as React from 'react';
import StatusPage from '../components/StatusPage.js';
import {SanitizedCatalystContext} from '../context.mjs';

const PreferencesSaved = (): React.Element<typeof StatusPage> => {
const PreferencesSaved = (): React$Element<typeof StatusPage> => {
const $c = React.useContext(SanitizedCatalystContext);
return (
<StatusPage title={l('Preferences')}>
Expand Down
4 changes: 1 addition & 3 deletions root/account/ResetPasswordStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/

import * as React from 'react';

import StatusPage from '../components/StatusPage.js';

type Props = {
Expand All @@ -17,7 +15,7 @@ type Props = {

const ResetPasswordStatus = ({
message,
}: Props): React.Element<typeof StatusPage> => (
}: Props): React$Element<typeof StatusPage> => (
<StatusPage title={l('Reset Password')}>
<p>{message}</p>
</StatusPage>
Expand Down
4 changes: 1 addition & 3 deletions root/account/applications/Edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/

import * as React from 'react';

import Layout from '../../layout/index.js';
import type {ApplicationFormT}
from '../../static/scripts/account/components/ApplicationForm.js';
Expand All @@ -19,7 +17,7 @@ type Props = {
+form: ApplicationFormT,
};

const EditApplication = (props: Props): React.Element<typeof Layout> => (
const EditApplication = (props: Props): React$Element<typeof Layout> => (
<Layout fullWidth title={l('Edit Application')}>
<h1>{l('Edit Application')}</h1>
<ApplicationForm
Expand Down
4 changes: 1 addition & 3 deletions root/account/applications/Index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/

import * as React from 'react';

import PaginatedResults from '../../components/PaginatedResults.js';
import {ACCESS_SCOPE_PERMISSIONS} from '../../constants.js';
import Layout from '../../layout/index.js';
Expand Down Expand Up @@ -80,7 +78,7 @@ const Index = ({
appsPager,
tokens,
tokensPager,
}: Props): React.Element<typeof Layout> => (
}: Props): React$Element<typeof Layout> => (
<Layout fullWidth title={l('Applications')}>
<h1>{l('Applications')}</h1>

Expand Down
4 changes: 1 addition & 3 deletions root/account/applications/Register.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/

import * as React from 'react';

import Layout from '../../layout/index.js';
import * as manifest from '../../static/manifest.mjs';
import type {ApplicationFormT}
Expand All @@ -20,7 +18,7 @@ type Props = {
+form: ApplicationFormT,
};

const RegisterApplication = (props: Props): React.Element<typeof Layout> => (
const RegisterApplication = (props: Props): React$Element<typeof Layout> => (
<Layout fullWidth title={l('Register Application')}>
<h1>{l('Register Application')}</h1>
<ApplicationForm
Expand Down
4 changes: 1 addition & 3 deletions root/account/applications/Remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/

import * as React from 'react';

import ConfirmLayout from '../../components/ConfirmLayout.js';

type Props = {
Expand All @@ -17,7 +15,7 @@ type Props = {

const RemoveApplication = ({
form,
}: Props): React.Element<typeof ConfirmLayout> => (
}: Props): React$Element<typeof ConfirmLayout> => (
<ConfirmLayout
form={form}
question={l('Are you sure you want to remove this application?')}
Expand Down
4 changes: 1 addition & 3 deletions root/account/applications/RevokeAccess.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/

import * as React from 'react';

import ConfirmLayout from '../../components/ConfirmLayout.js';

type Props = {
Expand All @@ -17,7 +15,7 @@ type Props = {

const RevokeApplicationAccess = ({
form,
}: Props): React.Element<typeof ConfirmLayout> => (
}: Props): React$Element<typeof ConfirmLayout> => (
<ConfirmLayout
form={form}
question={l(
Expand Down
4 changes: 1 addition & 3 deletions root/account/sso/DiscourseRegistered.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/

import * as React from 'react';

import Layout from '../../layout/index.js';

type Props = {
Expand All @@ -17,7 +15,7 @@ type Props = {

const DiscourseRegistered = ({
emailAddress,
}: Props): React.Element<typeof Layout> => (
}: Props): React$Element<typeof Layout> => (
<Layout fullWidth title={l('Account Created')}>
<h2>{l('Account Created')}</h2>
<p style={{fontSize: '1.2em'}}>
Expand Down
4 changes: 1 addition & 3 deletions root/account/sso/DiscourseUnconfirmedEmailAddress.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/

import * as React from 'react';

import Layout from '../../layout/index.js';

const DiscourseUnconfirmedEmailAddress = (): React.Element<typeof Layout> => (
const DiscourseUnconfirmedEmailAddress = (): React$Element<typeof Layout> => (
<Layout fullWidth title={l('Unverified Email Address')}>
<h2>{l('Unverified Email Address')}</h2>
<p>
Expand Down
4 changes: 1 addition & 3 deletions root/admin/EditBanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/

import * as React from 'react';

import Layout from '../layout/index.js';
import FormCsrfToken
from '../static/scripts/edit/components/FormCsrfToken.js';
Expand All @@ -23,7 +21,7 @@ type Props = {
}>,
};

const EditBanner = ({form}: Props): React.Element<typeof Layout> => (
const EditBanner = ({form}: Props): React$Element<typeof Layout> => (
<Layout fullWidth title={l('Edit Banner Message')}>
<div id="content">
<h1>{l('Edit banner message')}</h1>
Expand Down
4 changes: 1 addition & 3 deletions root/admin/EmailSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/

import * as React from 'react';

import Layout from '../layout/index.js';
import expand2react from '../static/scripts/common/i18n/expand2react.js';
import FormRowText from '../static/scripts/edit/components/FormRowText.js';
Expand All @@ -26,7 +24,7 @@ type Props = {
const EmailSearch = ({
form,
results,
}: Props): React.Element<typeof Layout> => (
}: Props): React$Element<typeof Layout> => (
<Layout fullWidth title={l('Search users by email')}>
<div id="content">
<h1>{l('Search users by email')}</h1>
Expand Down
4 changes: 1 addition & 3 deletions root/admin/IpLookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/

import * as React from 'react';

import Layout from '../layout/index.js';

import UserList from './components/UserList.js';
Expand All @@ -21,7 +19,7 @@ type Props = {
const IpLookup = ({
ipHash,
users,
}: Props): React.Element<typeof Layout> => (
}: Props): React$Element<typeof Layout> => (
<Layout fullWidth title={l('IP lookup')}>
<div id="content">
<h1>{l('IP lookup')}</h1>
Expand Down
4 changes: 1 addition & 3 deletions root/admin/LockedUsernameSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/

import * as React from 'react';

import Layout from '../layout/index.js';
import expand2react from '../static/scripts/common/i18n/expand2react.js';
import bracketed from '../static/scripts/common/utility/bracketed.js';
Expand All @@ -30,7 +28,7 @@ const LockedUsernameSearch = ({
form,
results,
showResults,
}: Props): React.Element<typeof Layout> => (
}: Props): React$Element<typeof Layout> => (
<Layout fullWidth title="Search locked usernames">
<div id="content">
<h1>{'Search locked usernames'}</h1>
Expand Down
4 changes: 1 addition & 3 deletions root/admin/LockedUsernameUnlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/

import * as React from 'react';

import Layout from '../layout/index.js';
import expand2text from '../static/scripts/common/i18n/expand2text.js';
import FormCsrfToken
Expand All @@ -23,7 +21,7 @@ type Props = {
const LockedUsernameUnlock = ({
form,
username,
}: Props): React.Element<typeof Layout> => (
}: Props): React$Element<typeof Layout> => (
<Layout fullWidth title="Unlock username">
<div id="content">
<h1>{'Unlock username'}</h1>
Expand Down
4 changes: 1 addition & 3 deletions root/admin/PrivilegeSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/

import * as React from 'react';

import PaginatedResults from '../components/PaginatedResults.js';
import Layout from '../layout/index.js';
import FormRowCheckbox
Expand Down Expand Up @@ -42,7 +40,7 @@ const PrivilegeSearch = ({
form,
pager,
results,
}: Props): React.Element<typeof Layout> => (
}: Props): React$Element<typeof Layout> => (
<Layout fullWidth title={l('Search users by privileges')}>
<div id="content">
<h1>{l('Search users by privileges')}</h1>
Expand Down
4 changes: 1 addition & 3 deletions root/admin/attributes/Attribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/

import * as React from 'react';

import Layout from '../../layout/index.js';
import {compare} from '../../static/scripts/common/i18n.js';
import expand2react from '../../static/scripts/common/i18n/expand2react.js';
Expand Down Expand Up @@ -85,7 +83,7 @@ const renderAttributes = (attribute: AttributeT) => {
const Attribute = ({
attributes,
model,
}: Props): React.Element<typeof Layout> => (
}: Props): React$Element<typeof Layout> => (
<Layout fullWidth title={model}>
<h1>
<a href="/admin/attributes">{l('Attributes')}</a>
Expand Down
Loading

0 comments on commit ceefb6c

Please sign in to comment.