From 57748b83926ef11eb7b07c42363121b8a1f78060 Mon Sep 17 00:00:00 2001 From: "D. Ror" Date: Wed, 3 Feb 2021 13:32:46 -0500 Subject: [PATCH] Remove unused exports. --- src/components/AppBar/AppBarComponent.tsx | 2 +- src/components/Buttons/FileInputButton.tsx | 2 +- src/components/ContextMenu/ContextMenu.tsx | 4 +- .../DataEntryTable/NewEntry/SenseDialog.tsx | 27 +++++------ .../DataEntryTable/NewEntry/VernDialog.tsx | 27 +++++------ .../GoalDisplay/HorizontalDisplay.tsx | 16 ++----- .../GoalDisplay/VerticalDisplay.tsx | 21 ++++----- .../GoalTimeline/GoalHistory/DefaultState.tsx | 5 -- .../GoalHistory/GoalHistoryComponent.tsx | 9 +--- .../GoalTimeline/GoalHistory/index.tsx | 2 +- .../GoalSuggestionsComponent.tsx | 9 +--- .../GoalTimeline/GoalSuggestions/index.tsx | 2 +- .../GoalTimeline/GoalTimelineComponent.tsx | 6 +-- src/components/GoalTimeline/index.tsx | 10 ++-- src/components/Login/AuthHeaders.tsx | 2 +- .../Login/LoginPage/LoginComponent.tsx | 2 +- src/components/Login/LoginPage/index.tsx | 8 ++-- .../Login/RegisterPage/RegisterComponent.tsx | 4 +- src/components/Login/RegisterPage/index.tsx | 6 +-- .../PasswordReset/RequestPage/component.tsx | 8 ++-- .../PasswordReset/RequestPage/index.tsx | 2 +- .../PasswordReset/ResetPage/component.tsx | 8 ++-- .../PasswordReset/ResetPage/index.tsx | 10 ++-- .../ProjectExport/ExportProjectActions.tsx | 11 ++--- .../ProjectInvite/ProjectInviteComponent.tsx | 13 ++--- src/components/ProjectInvite/index.tsx | 2 +- .../ChooseProject/ChooseProjectComponent.tsx | 18 +++---- .../ProjectScreen/ChooseProject/index.tsx | 6 +-- .../CreateProject/CreateProjectComponent.tsx | 20 +++----- .../ProjectScreen/CreateProject/index.tsx | 8 ++-- .../tests/CreateProjectComponent.test.tsx | 2 +- .../ProjectImport/ProjectImport.tsx | 14 ++---- .../ProjectLanguages/ProjectLanguages.tsx | 2 +- .../ProjectSettings/ProjectName/index.tsx | 6 +-- .../ProjectSettings/ProjectSwitch/index.tsx | 6 +-- src/components/Pronunciations/AudioPlayer.tsx | 4 +- .../Pronunciations/AudioRecorder.tsx | 2 +- .../PronunciationsComponent.tsx | 2 +- .../Pronunciations/RecorderIcon.tsx | 6 +-- .../ProjectManagement/ProjectManagement.tsx | 4 +- src/components/TreeView/TreeDepiction.tsx | 4 +- .../CharacterInventoryComponent.tsx | 6 +-- .../CharacterDetailComponent.tsx | 4 +- .../CharacterInfo/CharacterInfoComponent.tsx | 4 +- .../CharacterStatusControl.tsx | 5 +- .../CharacterWordsComponent.tsx | 2 +- .../FindAndReplaceComponent.tsx | 4 +- .../CharacterEntryComponent.tsx | 18 +++---- .../CharacterEntry/CharactersInput.tsx | 4 +- .../CharacterList/CharacterCard.tsx | 4 +- .../CharacterList/CharacterListComponent.tsx | 2 +- .../CharacterList/CharacterSetHeader.tsx | 8 ++-- .../CharacterList/CharacterStatusText.tsx | 4 +- .../DisplayProg/displayProg.tsx | 14 ++---- .../DefaultGoal/BaseGoalScreen/index.tsx | 7 ++- .../BaseGoalWidget/BaseGoalWidget.tsx | 6 +-- .../DuplicateFinder/DuplicateFinder.ts | 4 +- .../MergeDupStep/MergeDupStepActions.tsx | 10 ++-- .../MergeDupStep/MergeDupStepComponent.tsx | 10 ++-- .../MergeRow/MergeRowComponent.tsx | 11 +---- .../MergeDupStep/MergeRow/MergeStack.tsx | 4 +- .../MergeDupStep/MergeRow/index.tsx | 8 ++-- src/goals/MergeDupGoal/MergeDupStep/index.tsx | 8 ++-- src/types/goals.tsx | 12 ++--- src/types/runtimeConfig.tsx | 2 +- src/types/theme.ts | 47 ------------------- 66 files changed, 190 insertions(+), 340 deletions(-) delete mode 100644 src/components/GoalTimeline/GoalHistory/DefaultState.tsx diff --git a/src/components/AppBar/AppBarComponent.tsx b/src/components/AppBar/AppBarComponent.tsx index 555b6bac1b..9d8f2b6293 100644 --- a/src/components/AppBar/AppBarComponent.tsx +++ b/src/components/AppBar/AppBarComponent.tsx @@ -10,7 +10,7 @@ import NavigationButtons from "components/AppBar/NavigationButtons"; import ProjectNameButton from "components/AppBar/ProjectNameButton"; import UserMenu from "components/AppBar/UserMenu"; -export interface AppBarComponentProps { +interface AppBarComponentProps { currentTab: Path; } diff --git a/src/components/Buttons/FileInputButton.tsx b/src/components/Buttons/FileInputButton.tsx index 7fd8c90a19..86005521c0 100644 --- a/src/components/Buttons/FileInputButton.tsx +++ b/src/components/Buttons/FileInputButton.tsx @@ -2,7 +2,7 @@ import React from "react"; import { Button } from "@material-ui/core"; import { ButtonProps } from "@material-ui/core/Button"; -export interface BrowseProps { +interface BrowseProps { updateFile: (file: File) => void; accept?: string; children?: React.ReactNode; diff --git a/src/components/ContextMenu/ContextMenu.tsx b/src/components/ContextMenu/ContextMenu.tsx index 85dcc2573b..0268e79cf0 100644 --- a/src/components/ContextMenu/ContextMenu.tsx +++ b/src/components/ContextMenu/ContextMenu.tsx @@ -8,11 +8,11 @@ import { export type MenuType = [string, () => void]; -export interface ContextMenuProps { +interface ContextMenuProps { options: MenuType[]; anchorName: string; } -export interface ContextMenuState { +interface ContextMenuState { isOpen: boolean; } diff --git a/src/components/DataEntry/DataEntryTable/NewEntry/SenseDialog.tsx b/src/components/DataEntry/DataEntryTable/NewEntry/SenseDialog.tsx index 69f28c7a74..6d4b689d53 100644 --- a/src/components/DataEntry/DataEntryTable/NewEntry/SenseDialog.tsx +++ b/src/components/DataEntry/DataEntryTable/NewEntry/SenseDialog.tsx @@ -7,25 +7,21 @@ import { withStyles, } from "@material-ui/core"; import React from "react"; -import { - LocalizeContextProps, - Translate, - withLocalize, -} from "react-localize-redux"; +import { Translate } from "react-localize-redux"; -import theme from "types/theme"; -import { Sense, Word } from "types/word"; import DomainCell from "goals/ReviewEntries/ReviewEntriesComponent/CellComponents/DomainCell"; import { parseWord } from "goals/ReviewEntries/ReviewEntriesComponent/ReviewEntriesTypes"; +import theme from "types/theme"; +import { Sense, Word } from "types/word"; + +interface SenseDialogProps { + selectedWord: Word; + open: boolean; + handleClose: (senseIndex?: number) => void; + analysisLang: string; +} -function SenseDialog( - props: { - selectedWord: Word; - open: boolean; - handleClose: (senseIndex?: number) => void; - analysisLang: string; - } & LocalizeContextProps -) { +export default function SenseDialog(props: SenseDialogProps) { return ( ); } -export default withLocalize(SenseDialog); diff --git a/src/components/DataEntry/DataEntryTable/NewEntry/VernDialog.tsx b/src/components/DataEntry/DataEntryTable/NewEntry/VernDialog.tsx index 7eabd7aab1..35d3681b12 100644 --- a/src/components/DataEntry/DataEntryTable/NewEntry/VernDialog.tsx +++ b/src/components/DataEntry/DataEntryTable/NewEntry/VernDialog.tsx @@ -7,26 +7,22 @@ import { withStyles, } from "@material-ui/core"; import React from "react"; -import { - LocalizeContextProps, - Translate, - withLocalize, -} from "react-localize-redux"; +import { Translate } from "react-localize-redux"; -import theme from "types/theme"; -import { Word } from "types/word"; import DomainCell from "goals/ReviewEntries/ReviewEntriesComponent/CellComponents/DomainCell"; import SenseCell from "goals/ReviewEntries/ReviewEntriesComponent/CellComponents/SenseCell"; import { parseWord } from "goals/ReviewEntries/ReviewEntriesComponent/ReviewEntriesTypes"; +import theme from "types/theme"; +import { Word } from "types/word"; + +interface vernDialogProps { + vernacularWords: Word[]; + open: boolean; + handleClose: (selectedWordId?: string) => void; + analysisLang: string; +} -export function VernDialog( - props: { - vernacularWords: Word[]; - open: boolean; - handleClose: (selectedWordId?: string) => void; - analysisLang: string; - } & LocalizeContextProps -) { +export default function VernDialog(props: vernDialogProps) { return ( ); } -export default withLocalize(VernDialog); diff --git a/src/components/GoalTimeline/GoalDisplay/HorizontalDisplay.tsx b/src/components/GoalTimeline/GoalDisplay/HorizontalDisplay.tsx index 4411a1b5c8..8ee554d3b9 100644 --- a/src/components/GoalTimeline/GoalDisplay/HorizontalDisplay.tsx +++ b/src/components/GoalTimeline/GoalDisplay/HorizontalDisplay.tsx @@ -1,9 +1,5 @@ import React from "react"; -import { - LocalizeContextProps, - withLocalize, - Translate, -} from "react-localize-redux"; +import { Translate } from "react-localize-redux"; import { Typography, GridList, GridListTile, Button } from "@material-ui/core"; import { Goal } from "types/goals"; @@ -22,7 +18,7 @@ const style = { }, }; -export interface HorizontalDisplayProps { +interface HorizontalDisplayProps { data: Goal[]; width: number; numPanes: number; @@ -30,12 +26,10 @@ export interface HorizontalDisplayProps { handleChange: (name: string) => void; } -export class HorizontalDisplay extends React.Component< - HorizontalDisplayProps & LocalizeContextProps -> { +export default class HorizontalDisplay extends React.Component { optionWidth: number; - constructor(props: HorizontalDisplayProps & LocalizeContextProps) { + constructor(props: HorizontalDisplayProps) { super(props); this.optionWidth = this.props.width / 3 - 1; @@ -105,5 +99,3 @@ export class HorizontalDisplay extends React.Component< ); } } - -export default withLocalize(HorizontalDisplay); diff --git a/src/components/GoalTimeline/GoalDisplay/VerticalDisplay.tsx b/src/components/GoalTimeline/GoalDisplay/VerticalDisplay.tsx index 1e964b77bb..9a19e44904 100644 --- a/src/components/GoalTimeline/GoalDisplay/VerticalDisplay.tsx +++ b/src/components/GoalTimeline/GoalDisplay/VerticalDisplay.tsx @@ -1,10 +1,6 @@ -import React from "react"; -import { - LocalizeContextProps, - withLocalize, - Translate, -} from "react-localize-redux"; import { Typography, GridList, GridListTile, Button } from "@material-ui/core"; +import React from "react"; +import { Translate } from "react-localize-redux"; import { Goal } from "types/goals"; @@ -22,24 +18,25 @@ const style = { }, }; -export interface VerticalDisplayProps { +interface VerticalDisplayProps { data: Goal[]; height: number; numPanes: number; scrollToEnd: boolean; handleChange: (name: string) => void; } -export interface VerticalDisplayStates { + +interface VerticalDisplayStates { scrollVisible: boolean; } -export class VerticalDisplay extends React.Component< - VerticalDisplayProps & LocalizeContextProps, +export default class VerticalDisplay extends React.Component< + VerticalDisplayProps, VerticalDisplayStates > { optionHeight: number; - constructor(props: VerticalDisplayProps & LocalizeContextProps) { + constructor(props: VerticalDisplayProps) { super(props); this.state = { scrollVisible: false }; this.optionHeight = this.props.height / 3 - 1.25; @@ -118,5 +115,3 @@ export class VerticalDisplay extends React.Component< ); } } - -export default withLocalize(VerticalDisplay); diff --git a/src/components/GoalTimeline/GoalHistory/DefaultState.tsx b/src/components/GoalTimeline/GoalHistory/DefaultState.tsx deleted file mode 100644 index 13065ce2a4..0000000000 --- a/src/components/GoalTimeline/GoalHistory/DefaultState.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { GoalHistoryState } from "types/goals"; - -export const defaultState: GoalHistoryState = { - history: [], -}; diff --git a/src/components/GoalTimeline/GoalHistory/GoalHistoryComponent.tsx b/src/components/GoalTimeline/GoalHistory/GoalHistoryComponent.tsx index 147642689b..dba0158584 100644 --- a/src/components/GoalTimeline/GoalHistory/GoalHistoryComponent.tsx +++ b/src/components/GoalTimeline/GoalHistory/GoalHistoryComponent.tsx @@ -1,16 +1,13 @@ import React from "react"; -import { withLocalize, LocalizeContextProps } from "react-localize-redux"; import BaseGoalSelect from "goals/DefaultGoal/BaseGoalWidget/BaseGoalWidget"; import { Goal } from "types/goals"; -export interface GoalHistoryProps { +interface GoalHistoryProps { history: Goal[]; } -export class GoalHistory extends React.Component< - GoalHistoryProps & LocalizeContextProps -> { +export default class GoalHistory extends React.Component { render() { return (
@@ -21,5 +18,3 @@ export class GoalHistory extends React.Component< ); } } - -export default withLocalize(GoalHistory); diff --git a/src/components/GoalTimeline/GoalHistory/index.tsx b/src/components/GoalTimeline/GoalHistory/index.tsx index a57bb5b84e..b2126e247c 100644 --- a/src/components/GoalTimeline/GoalHistory/index.tsx +++ b/src/components/GoalTimeline/GoalHistory/index.tsx @@ -4,7 +4,7 @@ import GoalHistory from "components/GoalTimeline/GoalHistory/GoalHistoryComponen import { StoreState } from "types"; import { GoalHistoryState } from "types/goals"; -export function mapStateToProps(state: StoreState): GoalHistoryState { +function mapStateToProps(state: StoreState): GoalHistoryState { return { history: state.goalsState.historyState.history, }; diff --git a/src/components/GoalTimeline/GoalSuggestions/GoalSuggestionsComponent.tsx b/src/components/GoalTimeline/GoalSuggestions/GoalSuggestionsComponent.tsx index e0dfef4b39..1bb0d22cff 100644 --- a/src/components/GoalTimeline/GoalSuggestions/GoalSuggestionsComponent.tsx +++ b/src/components/GoalTimeline/GoalSuggestions/GoalSuggestionsComponent.tsx @@ -1,16 +1,13 @@ import React from "react"; -import { LocalizeContextProps, withLocalize } from "react-localize-redux"; import BaseGoalSelect from "goals/DefaultGoal/BaseGoalWidget/BaseGoalWidget"; import { Goal } from "types/goals"; -export interface GoalSuggestionsProps { +interface GoalSuggestionsProps { suggestions: Goal[]; } -export class GoalSuggestions extends React.Component< - GoalSuggestionsProps & LocalizeContextProps -> { +export default class GoalSuggestions extends React.Component { render() { return (
@@ -21,5 +18,3 @@ export class GoalSuggestions extends React.Component< ); } } - -export default withLocalize(GoalSuggestions); diff --git a/src/components/GoalTimeline/GoalSuggestions/index.tsx b/src/components/GoalTimeline/GoalSuggestions/index.tsx index 55b27729a8..30cb37fd17 100644 --- a/src/components/GoalTimeline/GoalSuggestions/index.tsx +++ b/src/components/GoalTimeline/GoalSuggestions/index.tsx @@ -4,7 +4,7 @@ import GoalSuggestions from "components/GoalTimeline/GoalSuggestions/GoalSuggest import { StoreState } from "types"; import { GoalSuggestionsState } from "types/goals"; -export function mapStateToProps(state: StoreState): GoalSuggestionsState { +function mapStateToProps(state: StoreState): GoalSuggestionsState { return { suggestions: state.goalsState.suggestionsState.suggestions, }; diff --git a/src/components/GoalTimeline/GoalTimelineComponent.tsx b/src/components/GoalTimeline/GoalTimelineComponent.tsx index 73960411c5..565a795eef 100644 --- a/src/components/GoalTimeline/GoalTimelineComponent.tsx +++ b/src/components/GoalTimeline/GoalTimelineComponent.tsx @@ -2,9 +2,9 @@ import { Button, GridList, GridListTile, Typography } from "@material-ui/core"; import React, { ReactElement } from "react"; import { Translate } from "react-localize-redux"; -import { Goal } from "types/goals"; import HorizontalDisplay from "components/GoalTimeline/GoalDisplay/HorizontalDisplay"; import VerticalDisplay from "components/GoalTimeline/GoalDisplay/VerticalDisplay"; +import { Goal } from "types/goals"; const timelineStyle = { centerDisplays: { @@ -27,7 +27,7 @@ const timelineStyle = { }, }; -export interface GoalTimelineProps { +interface GoalTimelineProps { chooseGoal: (goal: Goal) => void; loadHistory: () => void; @@ -36,7 +36,7 @@ export interface GoalTimelineProps { suggestions: Goal[]; } -export interface GoalTimelineState { +interface GoalTimelineState { portrait: boolean; reducedLandScape: boolean; } diff --git a/src/components/GoalTimeline/index.tsx b/src/components/GoalTimeline/index.tsx index a835ef7f56..70475257dd 100644 --- a/src/components/GoalTimeline/index.tsx +++ b/src/components/GoalTimeline/index.tsx @@ -1,15 +1,15 @@ import { connect } from "react-redux"; -import { StoreState } from "types"; -import { StoreStateDispatch } from "types/actions"; -import { Goal } from "types/goals"; import GoalTimeline from "components/GoalTimeline/GoalTimelineComponent"; import { asyncAddGoalToHistory, asyncGetUserEdits, } from "components/GoalTimeline/GoalsActions"; +import { StoreState } from "types"; +import { StoreStateDispatch } from "types/actions"; +import { Goal } from "types/goals"; -export function mapStateToProps(state: StoreState) { +function mapStateToProps(state: StoreState) { return { allPossibleGoals: state.goalsState.allPossibleGoals, history: state.goalsState.historyState.history, @@ -17,7 +17,7 @@ export function mapStateToProps(state: StoreState) { }; } -export function mapDispatchToProps(dispatch: StoreStateDispatch) { +function mapDispatchToProps(dispatch: StoreStateDispatch) { return { chooseGoal: (goal: Goal) => { dispatch(asyncAddGoalToHistory(goal)); diff --git a/src/components/Login/AuthHeaders.tsx b/src/components/Login/AuthHeaders.tsx index 940dfb3af2..3ed7cd4cfd 100644 --- a/src/components/Login/AuthHeaders.tsx +++ b/src/components/Login/AuthHeaders.tsx @@ -1,6 +1,6 @@ import { getCurrentUser } from "backend/localStorage"; -export interface AuthHeader { +interface AuthHeader { authorization?: string; } diff --git a/src/components/Login/LoginPage/LoginComponent.tsx b/src/components/Login/LoginPage/LoginComponent.tsx index 30a26208af..5e52f7017c 100644 --- a/src/components/Login/LoginPage/LoginComponent.tsx +++ b/src/components/Login/LoginPage/LoginComponent.tsx @@ -31,7 +31,7 @@ export interface LoginStateProps { loginFailure: boolean | undefined; } -export interface LoginState { +interface LoginState { username: string; password: string; isVerified: boolean; diff --git a/src/components/Login/LoginPage/index.tsx b/src/components/Login/LoginPage/index.tsx index 43087e1e33..bcac73410a 100644 --- a/src/components/Login/LoginPage/index.tsx +++ b/src/components/Login/LoginPage/index.tsx @@ -1,7 +1,5 @@ import { connect } from "react-redux"; -import { StoreState } from "types"; -import { StoreStateDispatch } from "types/actions"; import { asyncLogin, loginReset, @@ -11,6 +9,8 @@ import Login, { LoginDispatchProps, LoginStateProps, } from "components/Login/LoginPage/LoginComponent"; +import { StoreState } from "types"; +import { StoreStateDispatch } from "types/actions"; function mapStateToProps(state: StoreState): LoginStateProps { return { @@ -19,9 +19,7 @@ function mapStateToProps(state: StoreState): LoginStateProps { }; } -export function mapDispatchToProps( - dispatch: StoreStateDispatch -): LoginDispatchProps { +function mapDispatchToProps(dispatch: StoreStateDispatch): LoginDispatchProps { return { login: (username: string, password: string) => { dispatch(asyncLogin(username, password)); diff --git a/src/components/Login/RegisterPage/RegisterComponent.tsx b/src/components/Login/RegisterPage/RegisterComponent.tsx index d5b2ac7de3..ef7f036075 100644 --- a/src/components/Login/RegisterPage/RegisterComponent.tsx +++ b/src/components/Login/RegisterPage/RegisterComponent.tsx @@ -20,7 +20,7 @@ import history, { Path } from "browserHistory"; import { buttonSuccess } from "types/theme"; import { passwordRequirements, usernameRequirements } from "utilities"; -export interface RegisterDispatchProps { +interface RegisterDispatchProps { register?: ( name: string, username: string, @@ -36,7 +36,7 @@ export interface RegisterStateProps { failureMessage: string; } -export interface RegisterProps { +interface RegisterProps { returnToEmailInvite?: () => void; } diff --git a/src/components/Login/RegisterPage/index.tsx b/src/components/Login/RegisterPage/index.tsx index b55ebc2e72..fa52329d2f 100644 --- a/src/components/Login/RegisterPage/index.tsx +++ b/src/components/Login/RegisterPage/index.tsx @@ -1,11 +1,11 @@ import { connect } from "react-redux"; -import { StoreState } from "types"; -import { StoreStateDispatch } from "types/actions"; import { asyncRegister, registerReset } from "components/Login/LoginActions"; import Register, { RegisterStateProps, } from "components/Login/RegisterPage/RegisterComponent"; +import { StoreState } from "types"; +import { StoreStateDispatch } from "types/actions"; function mapStateToProps(state: StoreState): RegisterStateProps { return { @@ -15,7 +15,7 @@ function mapStateToProps(state: StoreState): RegisterStateProps { }; } -export function mapDispatchToProps(dispatch: StoreStateDispatch) { +function mapDispatchToProps(dispatch: StoreStateDispatch) { return { register: ( name: string, diff --git a/src/components/PasswordReset/RequestPage/component.tsx b/src/components/PasswordReset/RequestPage/component.tsx index 6f7fc43649..b687db0b51 100644 --- a/src/components/PasswordReset/RequestPage/component.tsx +++ b/src/components/PasswordReset/RequestPage/component.tsx @@ -1,6 +1,6 @@ import { Card, Grid, TextField, Typography } from "@material-ui/core"; import * as React from "react"; -import { LocalizeContextProps, Translate } from "react-localize-redux"; +import { Translate } from "react-localize-redux"; import { isEmailTaken, isUsernameTaken } from "backend"; import history, { Path } from "browserHistory"; @@ -10,7 +10,7 @@ export interface ResetRequestDispatchProps { passwordResetRequest: (email: string) => void; } -export interface ResetRequestState { +interface ResetRequestState { emailOrUsername: string; emailOrUsernameExists: boolean; loading: boolean; @@ -18,10 +18,10 @@ export interface ResetRequestState { } export default class ResetRequest extends React.Component< - ResetRequestDispatchProps & LocalizeContextProps, + ResetRequestDispatchProps, ResetRequestState > { - constructor(props: ResetRequestDispatchProps & LocalizeContextProps) { + constructor(props: ResetRequestDispatchProps) { super(props); this.state = { emailOrUsernameExists: true, diff --git a/src/components/PasswordReset/RequestPage/index.tsx b/src/components/PasswordReset/RequestPage/index.tsx index 813c3fa2c6..43cf18b87b 100644 --- a/src/components/PasswordReset/RequestPage/index.tsx +++ b/src/components/PasswordReset/RequestPage/index.tsx @@ -6,7 +6,7 @@ import ResetRequest, { ResetRequestDispatchProps, } from "components/PasswordReset/RequestPage/component"; -export function mapDispatchToProps( +function mapDispatchToProps( dispatch: StoreStateDispatch ): ResetRequestDispatchProps { return { diff --git a/src/components/PasswordReset/ResetPage/component.tsx b/src/components/PasswordReset/ResetPage/component.tsx index e610038416..2ba9cbe61a 100644 --- a/src/components/PasswordReset/ResetPage/component.tsx +++ b/src/components/PasswordReset/ResetPage/component.tsx @@ -5,10 +5,10 @@ import { Translate } from "react-localize-redux"; import { RouteComponentProps } from "react-router"; import history, { Path } from "browserHistory"; -import { passwordRequirements } from "utilities"; import { RequestState } from "components/PasswordReset/reducer"; +import { passwordRequirements } from "utilities"; -export interface MatchParams { +interface MatchParams { token: string; } @@ -16,11 +16,11 @@ export interface ResetDispatchProps { passwordReset: (token: string, password: string) => void; } -export interface PasswordResetProps extends RouteComponentProps { +interface PasswordResetProps extends RouteComponentProps { resetState: RequestState; } -export interface PasswordResetState { +interface PasswordResetState { token: string; password: string; passwordConfirm: string; diff --git a/src/components/PasswordReset/ResetPage/index.tsx b/src/components/PasswordReset/ResetPage/index.tsx index 78e9456003..5964fd1163 100644 --- a/src/components/PasswordReset/ResetPage/index.tsx +++ b/src/components/PasswordReset/ResetPage/index.tsx @@ -1,21 +1,19 @@ import { connect } from "react-redux"; -import { StoreState } from "types"; -import { StoreStateDispatch } from "types/actions"; import { asyncReset } from "components/PasswordReset/actions"; import PasswordReset, { ResetDispatchProps, } from "components/PasswordReset/ResetPage/component"; +import { StoreState } from "types"; +import { StoreStateDispatch } from "types/actions"; -export function mapStateToProps(state: StoreState) { +function mapStateToProps(state: StoreState) { return { resetState: state.passwordResetState.resetState, }; } -export function mapDispatchToProps( - dispatch: StoreStateDispatch -): ResetDispatchProps { +function mapDispatchToProps(dispatch: StoreStateDispatch): ResetDispatchProps { return { passwordReset: (token: string, password: string) => { dispatch(asyncReset(token, password)); diff --git a/src/components/ProjectExport/ExportProjectActions.tsx b/src/components/ProjectExport/ExportProjectActions.tsx index 4b605168b6..5149ea6b0b 100644 --- a/src/components/ProjectExport/ExportProjectActions.tsx +++ b/src/components/ProjectExport/ExportProjectActions.tsx @@ -43,27 +43,24 @@ export function resetExport(projectId?: string) { }; } -export function inProgress(projectId: string): ExportProjectAction { +function inProgress(projectId: string): ExportProjectAction { return { type: ExportStatus.InProgress, projectId, }; } - -export function success(projectId: string): ExportProjectAction { +function success(projectId: string): ExportProjectAction { return { type: ExportStatus.Success, projectId, }; } - -export function failure(projectId: string): ExportProjectAction { +function failure(projectId: string): ExportProjectAction { return { type: ExportStatus.Failure, projectId, }; } - -export function reset(): ExportProjectAction { +function reset(): ExportProjectAction { return { type: ExportStatus.Default }; } diff --git a/src/components/ProjectInvite/ProjectInviteComponent.tsx b/src/components/ProjectInvite/ProjectInviteComponent.tsx index 350670b110..650118adb2 100644 --- a/src/components/ProjectInvite/ProjectInviteComponent.tsx +++ b/src/components/ProjectInvite/ProjectInviteComponent.tsx @@ -1,12 +1,11 @@ import React from "react"; -import { LocalizeContextProps, withLocalize } from "react-localize-redux"; import { RouteComponentProps } from "react-router-dom"; import * as Backend from "backend"; import history, { Path } from "browserHistory"; import Register from "components/Login/RegisterPage/RegisterComponent"; -export interface ProjectInviteDispatchProps { +interface ProjectInviteDispatchProps { register?: ( name: string, user: string, @@ -27,17 +26,13 @@ interface ProjectInviteState { isAlreadyUser: boolean; } -class ProjectInvite extends React.Component< - ProjectInviteDispatchProps & - ProjectInviteStateProps & - LocalizeContextProps & - RouteComponentProps, +export default class ProjectInvite extends React.Component< + ProjectInviteDispatchProps & ProjectInviteStateProps & RouteComponentProps, ProjectInviteState > { constructor( props: ProjectInviteDispatchProps & ProjectInviteStateProps & - LocalizeContextProps & RouteComponentProps ) { super(props); @@ -100,5 +95,3 @@ class ProjectInvite extends React.Component< ); } } - -export default withLocalize(ProjectInvite); diff --git a/src/components/ProjectInvite/index.tsx b/src/components/ProjectInvite/index.tsx index 1b99e94374..11c836d5a7 100644 --- a/src/components/ProjectInvite/index.tsx +++ b/src/components/ProjectInvite/index.tsx @@ -18,7 +18,7 @@ function mapStateToProps(state: StoreState): ProjectInviteStateProps { }; } -export function mapDispatchToProps(dispatch: StoreStateDispatch) { +function mapDispatchToProps(dispatch: StoreStateDispatch) { return { register: (name: string, user: string, email: string, password: string) => { dispatch(asyncRegisterForEmailInvite(name, user, email, password)); diff --git a/src/components/ProjectScreen/ChooseProject/ChooseProjectComponent.tsx b/src/components/ProjectScreen/ChooseProject/ChooseProjectComponent.tsx index a8bb46823b..9741359b9a 100644 --- a/src/components/ProjectScreen/ChooseProject/ChooseProjectComponent.tsx +++ b/src/components/ProjectScreen/ChooseProject/ChooseProjectComponent.tsx @@ -6,30 +6,26 @@ import { Typography, } from "@material-ui/core"; import React from "react"; -import { - LocalizeContextProps, - Translate, - withLocalize, -} from "react-localize-redux"; +import { Translate } from "react-localize-redux"; import { getAllActiveProjectsByUser } from "backend"; import { getUserId } from "backend/localStorage"; import history, { Path } from "browserHistory"; import { Project } from "types/project"; -export interface ChooseProjectProps { +interface ChooseProjectProps { setCurrentProject: (project: Project) => void; } -export interface ChooseProjectState { +interface ChooseProjectState { projectList: Project[]; } -class ChooseProject extends React.Component< - ChooseProjectProps & LocalizeContextProps, +export default class ChooseProject extends React.Component< + ChooseProjectProps, ChooseProjectState > { - constructor(props: ChooseProjectProps & LocalizeContextProps) { + constructor(props: ChooseProjectProps) { super(props); this.state = { projectList: [] }; const userId = getUserId(); @@ -71,5 +67,3 @@ class ChooseProject extends React.Component< ); } } - -export default withLocalize(ChooseProject); diff --git a/src/components/ProjectScreen/ChooseProject/index.tsx b/src/components/ProjectScreen/ChooseProject/index.tsx index 3effe52ae8..9b744f8896 100644 --- a/src/components/ProjectScreen/ChooseProject/index.tsx +++ b/src/components/ProjectScreen/ChooseProject/index.tsx @@ -1,11 +1,11 @@ import { connect } from "react-redux"; -import { StoreStateDispatch } from "types/actions"; -import { Project } from "types/project"; import { setCurrentProject } from "components/Project/ProjectActions"; import ChooseProjectComponent from "components/ProjectScreen/ChooseProject/ChooseProjectComponent"; +import { StoreStateDispatch } from "types/actions"; +import { Project } from "types/project"; -export function mapDispatchToProps(dispatch: StoreStateDispatch) { +function mapDispatchToProps(dispatch: StoreStateDispatch) { return { setCurrentProject: (project: Project) => { dispatch(setCurrentProject(project)); diff --git a/src/components/ProjectScreen/CreateProject/CreateProjectComponent.tsx b/src/components/ProjectScreen/CreateProject/CreateProjectComponent.tsx index 16c133b643..003c6f915a 100644 --- a/src/components/ProjectScreen/CreateProject/CreateProjectComponent.tsx +++ b/src/components/ProjectScreen/CreateProject/CreateProjectComponent.tsx @@ -7,19 +7,15 @@ import { } from "@material-ui/core"; import { LanguagePicker, languagePickerStrings_en } from "mui-language-picker"; import * as React from "react"; -import { - LocalizeContextProps, - Translate, - withLocalize, -} from "react-localize-redux"; +import { Translate } from "react-localize-redux"; import { projectDuplicateCheck } from "backend"; -import { WritingSystem } from "types/project"; -import theme from "types/theme"; import FileInputButton from "components/Buttons/FileInputButton"; import LoadingDoneButton from "components/Buttons/LoadingDoneButton"; +import { WritingSystem } from "types/project"; +import theme from "types/theme"; -export interface CreateProjectProps { +interface CreateProjectProps { asyncCreateProject: ( name: string, vernacularLanguage: WritingSystem, @@ -41,11 +37,11 @@ interface CreateProjectState { fileName?: string; } -export class CreateProject extends React.Component< - CreateProjectProps & LocalizeContextProps, +export default class CreateProject extends React.Component< + CreateProjectProps, CreateProjectState > { - constructor(props: CreateProjectProps & LocalizeContextProps) { + constructor(props: CreateProjectProps) { super(props); this.state = { @@ -277,5 +273,3 @@ export class CreateProject extends React.Component< ); } } - -export default withLocalize(CreateProject); diff --git a/src/components/ProjectScreen/CreateProject/index.tsx b/src/components/ProjectScreen/CreateProject/index.tsx index 0eeacb75d3..0863dadb96 100644 --- a/src/components/ProjectScreen/CreateProject/index.tsx +++ b/src/components/ProjectScreen/CreateProject/index.tsx @@ -1,13 +1,13 @@ import { connect } from "react-redux"; -import { StoreState } from "types"; -import { StoreStateDispatch } from "types/actions"; -import { WritingSystem } from "types/project"; import { asyncCreateProject, reset, } from "components/ProjectScreen/CreateProject/CreateProjectActions"; import CreateProject from "components/ProjectScreen/CreateProject/CreateProjectComponent"; +import { StoreState } from "types"; +import { StoreStateDispatch } from "types/actions"; +import { WritingSystem } from "types/project"; function mapStateToProps(state: StoreState) { return { @@ -18,7 +18,7 @@ function mapStateToProps(state: StoreState) { }; } -export function mapDispatchToProps(dispatch: StoreStateDispatch) { +function mapDispatchToProps(dispatch: StoreStateDispatch) { return { asyncCreateProject: ( name: string, diff --git a/src/components/ProjectScreen/CreateProject/tests/CreateProjectComponent.test.tsx b/src/components/ProjectScreen/CreateProject/tests/CreateProjectComponent.test.tsx index 83da7c550a..f377d45dce 100644 --- a/src/components/ProjectScreen/CreateProject/tests/CreateProjectComponent.test.tsx +++ b/src/components/ProjectScreen/CreateProject/tests/CreateProjectComponent.test.tsx @@ -7,7 +7,7 @@ import renderer, { } from "react-test-renderer"; import CreateProjectComponent from "components/ProjectScreen/CreateProject"; -import { CreateProject } from "components/ProjectScreen/CreateProject/CreateProjectComponent"; +import CreateProject from "components/ProjectScreen/CreateProject/CreateProjectComponent"; const createMockStore = configureMockStore([]); const mockState = { diff --git a/src/components/ProjectSettings/ProjectImport/ProjectImport.tsx b/src/components/ProjectSettings/ProjectImport/ProjectImport.tsx index 2b71cc5328..74afef117e 100644 --- a/src/components/ProjectSettings/ProjectImport/ProjectImport.tsx +++ b/src/components/ProjectSettings/ProjectImport/ProjectImport.tsx @@ -1,9 +1,5 @@ import React from "react"; -import { - LocalizeContextProps, - Translate, - withLocalize, -} from "react-localize-redux"; +import { Translate } from "react-localize-redux"; import { Grid, Typography, Button, CircularProgress } from "@material-ui/core"; import { renderToStaticMarkup } from "react-dom/server"; @@ -28,11 +24,11 @@ interface ImportState { uploadState: UploadState; } -export class ProjectImport extends React.Component< - ImportProps & LocalizeContextProps, +export default class ProjectImport extends React.Component< + ImportProps, ImportState > { - constructor(props: ImportProps & LocalizeContextProps) { + constructor(props: ImportProps) { super(props); this.updateLiftFile = this.updateLiftFile.bind(this); this.state = { @@ -126,5 +122,3 @@ export class ProjectImport extends React.Component< ); } } - -export default withLocalize(ProjectImport); diff --git a/src/components/ProjectSettings/ProjectLanguages/ProjectLanguages.tsx b/src/components/ProjectSettings/ProjectLanguages/ProjectLanguages.tsx index ed92a11d10..f48dc13406 100644 --- a/src/components/ProjectSettings/ProjectLanguages/ProjectLanguages.tsx +++ b/src/components/ProjectSettings/ProjectLanguages/ProjectLanguages.tsx @@ -167,7 +167,7 @@ interface ImmutableWritingSystemProps { iconAction?: () => void; } -export function ImmutableWritingSystem(props: ImmutableWritingSystemProps) { +function ImmutableWritingSystem(props: ImmutableWritingSystemProps) { return ( {props.index !== undefined && {`${props.index + 1}. `}} diff --git a/src/components/ProjectSettings/ProjectName/index.tsx b/src/components/ProjectSettings/ProjectName/index.tsx index f921fed788..7b347df9cf 100644 --- a/src/components/ProjectSettings/ProjectName/index.tsx +++ b/src/components/ProjectSettings/ProjectName/index.tsx @@ -1,10 +1,10 @@ import { connect } from "react-redux"; +import { saveChangesToProject } from "components/Project/ProjectActions"; +import ProjectName from "components/ProjectSettings/ProjectName/ProjectName"; import { StoreState } from "types"; import { StoreStateDispatch } from "types/actions"; import { Project } from "types/project"; -import { saveChangesToProject } from "components/Project/ProjectActions"; -import ProjectName from "components/ProjectSettings/ProjectName/ProjectName"; function mapStateToProps(state: StoreState) { return { @@ -12,7 +12,7 @@ function mapStateToProps(state: StoreState) { }; } -export function mapDispatchToProps(dispatch: StoreStateDispatch) { +function mapDispatchToProps(dispatch: StoreStateDispatch) { return { saveChangesToProject: (project: Project) => saveChangesToProject(project, dispatch), diff --git a/src/components/ProjectSettings/ProjectSwitch/index.tsx b/src/components/ProjectSettings/ProjectSwitch/index.tsx index 1d8b5dc2ff..a48fcd9551 100644 --- a/src/components/ProjectSettings/ProjectSwitch/index.tsx +++ b/src/components/ProjectSettings/ProjectSwitch/index.tsx @@ -1,10 +1,10 @@ import { connect } from "react-redux"; +import { setCurrentProject } from "components/Project/ProjectActions"; +import ProjectSwitch from "components/ProjectSettings/ProjectSwitch/ProjectSwitch"; import { StoreState } from "types"; import { StoreStateDispatch } from "types/actions"; import { Project } from "types/project"; -import { setCurrentProject } from "components/Project/ProjectActions"; -import ProjectSwitch from "components/ProjectSettings/ProjectSwitch/ProjectSwitch"; function mapStateToProps(state: StoreState) { return { @@ -12,7 +12,7 @@ function mapStateToProps(state: StoreState) { }; } -export function mapDispatchToProps(dispatch: StoreStateDispatch) { +function mapDispatchToProps(dispatch: StoreStateDispatch) { return { setCurrentProject: (project: Project) => { dispatch(setCurrentProject(project)); diff --git a/src/components/Pronunciations/AudioPlayer.tsx b/src/components/Pronunciations/AudioPlayer.tsx index 65806a782a..234b860f78 100644 --- a/src/components/Pronunciations/AudioPlayer.tsx +++ b/src/components/Pronunciations/AudioPlayer.tsx @@ -14,15 +14,15 @@ import React, { useEffect, useState } from "react"; import { Translate } from "react-localize-redux"; import { useDispatch, useSelector } from "react-redux"; -import { StoreState } from "types"; import ButtonConfirmation from "components/Buttons/ButtonConfirmation"; import { playing, PronunciationsStatus, reset, } from "components/Pronunciations/PronunciationsActions"; +import { StoreState } from "types"; -export interface PlayerProps { +interface PlayerProps { pronunciationUrl: string; wordId: string; fileName: string; diff --git a/src/components/Pronunciations/AudioRecorder.tsx b/src/components/Pronunciations/AudioRecorder.tsx index 7e752486fd..382c7e7053 100644 --- a/src/components/Pronunciations/AudioRecorder.tsx +++ b/src/components/Pronunciations/AudioRecorder.tsx @@ -3,7 +3,7 @@ import React from "react"; import Recorder from "components/Pronunciations/Recorder"; import RecorderIcon from "components/Pronunciations/RecorderIcon"; -export interface RecorderProps { +interface RecorderProps { wordId: string; recorder?: Recorder; uploadAudio?: (wordId: string, audioFile: File) => void; diff --git a/src/components/Pronunciations/PronunciationsComponent.tsx b/src/components/Pronunciations/PronunciationsComponent.tsx index 7bbd48e76f..b4b9d2e09c 100644 --- a/src/components/Pronunciations/PronunciationsComponent.tsx +++ b/src/components/Pronunciations/PronunciationsComponent.tsx @@ -5,7 +5,7 @@ import AudioPlayer from "components/Pronunciations/AudioPlayer"; import AudioRecorder from "components/Pronunciations/AudioRecorder"; import Recorder from "components/Pronunciations/Recorder"; -export interface PronunciationProps { +interface PronunciationProps { wordId: string; pronunciationFiles: string[]; recorder?: Recorder; diff --git a/src/components/Pronunciations/RecorderIcon.tsx b/src/components/Pronunciations/RecorderIcon.tsx index 9d36372222..c9b42856bd 100644 --- a/src/components/Pronunciations/RecorderIcon.tsx +++ b/src/components/Pronunciations/RecorderIcon.tsx @@ -4,15 +4,15 @@ import React from "react"; import { Translate } from "react-localize-redux"; import { useDispatch, useSelector } from "react-redux"; -import { StoreState } from "types"; -import { recorderStatus } from "types/theme"; import { PronunciationsStatus, recording, reset, } from "components/Pronunciations/PronunciationsActions"; +import { StoreState } from "types"; +import { recorderStatus } from "types/theme"; -export interface RecorderIconProps { +interface RecorderIconProps { wordId: string; startRecording: () => void; stopRecording: () => void; diff --git a/src/components/SiteSettings/ProjectManagement/ProjectManagement.tsx b/src/components/SiteSettings/ProjectManagement/ProjectManagement.tsx index f72f2b136f..feea6787ca 100644 --- a/src/components/SiteSettings/ProjectManagement/ProjectManagement.tsx +++ b/src/components/SiteSettings/ProjectManagement/ProjectManagement.tsx @@ -3,10 +3,10 @@ import React from "react"; import { LocalizeContextProps, withLocalize } from "react-localize-redux"; import { getAllProjects } from "backend"; -import { Project } from "types/project"; -import theme from "types/theme"; import ExportProjectButton from "components/ProjectExport"; import ProjectButtonWithConfirmation from "components/SiteSettings/ProjectManagement/ProjectButtonWithConfirmation"; +import { Project } from "types/project"; +import theme from "types/theme"; interface ProjectManagementState { activeProjects: Project[]; diff --git a/src/components/TreeView/TreeDepiction.tsx b/src/components/TreeView/TreeDepiction.tsx index c9b0e4c6ea..54f62d138f 100644 --- a/src/components/TreeView/TreeDepiction.tsx +++ b/src/components/TreeView/TreeDepiction.tsx @@ -16,8 +16,8 @@ import DomainTile, { Direction } from "components/TreeView/DomainTile"; import SemanticDomainWithSubdomains from "types/SemanticDomain"; import { TreeViewHeader } from "components/TreeView/TreeViewHeader"; -export const MAX_TILE_WIDTH = 150; -export const MIN_TILE_WIDTH = 75; +const MAX_TILE_WIDTH = 150; +const MIN_TILE_WIDTH = 75; interface TreeDepictionProps { currentDomain: SemanticDomainWithSubdomains; diff --git a/src/goals/CharInventoryCreation/CharacterInventoryComponent.tsx b/src/goals/CharInventoryCreation/CharacterInventoryComponent.tsx index d963729efd..cb56d8c284 100644 --- a/src/goals/CharInventoryCreation/CharacterInventoryComponent.tsx +++ b/src/goals/CharInventoryCreation/CharacterInventoryComponent.tsx @@ -12,15 +12,15 @@ import * as React from "react"; import { Translate } from "react-localize-redux"; import history, { Path } from "browserHistory"; -import { Project } from "types/project"; -import theme from "types/theme"; import { CharacterSetEntry } from "goals/CharInventoryCreation/CharacterInventoryReducer"; import CharacterDetail from "goals/CharInventoryCreation/components/CharacterDetail"; import CharacterEntry from "goals/CharInventoryCreation/components/CharacterEntry"; import CharacterList from "goals/CharInventoryCreation/components/CharacterList"; import CharacterSetHeader from "goals/CharInventoryCreation/components/CharacterList/CharacterSetHeader"; +import { Project } from "types/project"; +import theme from "types/theme"; -export interface CharacterInventoryProps { +interface CharacterInventoryProps { setValidCharacters: (inventory: string[]) => void; setRejectedCharacters: (inventory: string[]) => void; setSelectedCharacter: (character: string) => void; diff --git a/src/goals/CharInventoryCreation/components/CharacterDetail/CharacterDetailComponent.tsx b/src/goals/CharInventoryCreation/components/CharacterDetail/CharacterDetailComponent.tsx index b6e8355666..0979be3e0c 100644 --- a/src/goals/CharInventoryCreation/components/CharacterDetail/CharacterDetailComponent.tsx +++ b/src/goals/CharInventoryCreation/components/CharacterDetail/CharacterDetailComponent.tsx @@ -2,13 +2,13 @@ import { Grid, IconButton, Typography } from "@material-ui/core"; import { Close } from "@material-ui/icons"; import * as React from "react"; -import theme from "types/theme"; import CharacterInfo from "goals/CharInventoryCreation/components/CharacterDetail/CharacterInfo"; import CharacterStatusControl from "goals/CharInventoryCreation/components/CharacterDetail/CharacterStatusControl"; import CharacterWords from "goals/CharInventoryCreation/components/CharacterDetail/CharacterWords"; import FindAndReplace from "goals/CharInventoryCreation/components/CharacterDetail/FindAndReplace"; +import theme from "types/theme"; -export interface CharacterDetailProps { +interface CharacterDetailProps { character: string; close: () => void; } diff --git a/src/goals/CharInventoryCreation/components/CharacterDetail/CharacterInfo/CharacterInfoComponent.tsx b/src/goals/CharInventoryCreation/components/CharacterDetail/CharacterInfo/CharacterInfoComponent.tsx index 65a972d49f..90326cfe6a 100644 --- a/src/goals/CharInventoryCreation/components/CharacterDetail/CharacterInfo/CharacterInfoComponent.tsx +++ b/src/goals/CharInventoryCreation/components/CharacterDetail/CharacterInfo/CharacterInfoComponent.tsx @@ -1,8 +1,8 @@ +import { Typography } from "@material-ui/core"; import * as React from "react"; import { Translate } from "react-localize-redux"; -import { Typography } from "@material-ui/core"; -export interface CharacterInfoProps { +interface CharacterInfoProps { character: string; allWords: string[]; } diff --git a/src/goals/CharInventoryCreation/components/CharacterDetail/CharacterStatusControl/CharacterStatusControl.tsx b/src/goals/CharInventoryCreation/components/CharacterDetail/CharacterStatusControl/CharacterStatusControl.tsx index fcbbf97766..bb517f9392 100644 --- a/src/goals/CharInventoryCreation/components/CharacterDetail/CharacterStatusControl/CharacterStatusControl.tsx +++ b/src/goals/CharInventoryCreation/components/CharacterDetail/CharacterStatusControl/CharacterStatusControl.tsx @@ -1,9 +1,8 @@ +import { Button, ButtonGroup } from "@material-ui/core"; import * as React from "react"; import { Translate } from "react-localize-redux"; -import Button from "@material-ui/core/Button"; -import ButtonGroup from "@material-ui/core/ButtonGroup"; -export interface CharacterStatusControlProps { +interface CharacterStatusControlProps { character: string; accept: (character: string) => void; unset: (character: string) => void; diff --git a/src/goals/CharInventoryCreation/components/CharacterDetail/CharacterWords/CharacterWordsComponent.tsx b/src/goals/CharInventoryCreation/components/CharacterDetail/CharacterWords/CharacterWordsComponent.tsx index 6b9d20d0ad..cd9ca020d1 100644 --- a/src/goals/CharInventoryCreation/components/CharacterDetail/CharacterWords/CharacterWordsComponent.tsx +++ b/src/goals/CharInventoryCreation/components/CharacterDetail/CharacterWords/CharacterWordsComponent.tsx @@ -4,7 +4,7 @@ import { Translate } from "react-localize-redux"; import { highlight } from "types/theme"; -export interface CharacterWordsProps { +interface CharacterWordsProps { character: string; allWords: string[]; } diff --git a/src/goals/CharInventoryCreation/components/CharacterDetail/FindAndReplace/FindAndReplaceComponent.tsx b/src/goals/CharInventoryCreation/components/CharacterDetail/FindAndReplace/FindAndReplaceComponent.tsx index 2d3c8d5471..1811c40a1e 100644 --- a/src/goals/CharInventoryCreation/components/CharacterDetail/FindAndReplace/FindAndReplaceComponent.tsx +++ b/src/goals/CharInventoryCreation/components/CharacterDetail/FindAndReplace/FindAndReplaceComponent.tsx @@ -2,13 +2,13 @@ import { Button, TextField, Typography } from "@material-ui/core"; import * as React from "react"; import { LocalizeContextProps, withLocalize } from "react-localize-redux"; -export interface FindAndReplaceProps { +interface FindAndReplaceProps { initialFindValue: string; allWords: string[]; findAndReplace: (findValue: string, replaceValue: string) => void; } -export interface FindAndReplaceState { +interface FindAndReplaceState { findValue: string; replaceValue: string; } diff --git a/src/goals/CharInventoryCreation/components/CharacterEntry/CharacterEntryComponent.tsx b/src/goals/CharInventoryCreation/components/CharacterEntry/CharacterEntryComponent.tsx index d6db3056ea..a5cf65f823 100644 --- a/src/goals/CharInventoryCreation/components/CharacterEntry/CharacterEntryComponent.tsx +++ b/src/goals/CharInventoryCreation/components/CharacterEntry/CharacterEntryComponent.tsx @@ -1,16 +1,12 @@ import * as React from "react"; -import { - LocalizeContextProps, - withLocalize, - Translate, -} from "react-localize-redux"; +import { Translate } from "react-localize-redux"; import { Grid, Collapse, Button } from "@material-ui/core"; import { KeyboardArrowDown } from "@material-ui/icons"; -import theme from "types/theme"; import CharactersInput from "goals/CharInventoryCreation/components/CharacterEntry/CharactersInput"; +import theme from "types/theme"; -export interface CharacterEntryProps { +interface CharacterEntryProps { setValidCharacters: (inventory: string[]) => void; validCharacters: string[]; setRejectedCharacters: (inventory: string[]) => void; @@ -25,11 +21,11 @@ interface CharacterEntryState { * Allows for viewing and entering accepted and rejected characters in a * character set */ -export class CharacterEntry extends React.Component< - CharacterEntryProps & LocalizeContextProps, +export default class CharacterEntry extends React.Component< + CharacterEntryProps, CharacterEntryState > { - constructor(props: CharacterEntryProps & LocalizeContextProps) { + constructor(props: CharacterEntryProps) { super(props); this.state = { checked: false, @@ -99,5 +95,3 @@ export class CharacterEntry extends React.Component< ); } } - -export default withLocalize(CharacterEntry); diff --git a/src/goals/CharInventoryCreation/components/CharacterEntry/CharactersInput.tsx b/src/goals/CharInventoryCreation/components/CharacterEntry/CharactersInput.tsx index ac0e02bda6..3c7d803beb 100644 --- a/src/goals/CharInventoryCreation/components/CharacterEntry/CharactersInput.tsx +++ b/src/goals/CharInventoryCreation/components/CharacterEntry/CharactersInput.tsx @@ -1,9 +1,9 @@ -import * as React from "react"; import { TextField } from "@material-ui/core"; +import * as React from "react"; import theme from "types/theme"; -export interface CharactersInputProps { +interface CharactersInputProps { setCharacters: (characters: string[]) => void; characters: string[]; label: JSX.Element; diff --git a/src/goals/CharInventoryCreation/components/CharacterList/CharacterCard.tsx b/src/goals/CharInventoryCreation/components/CharacterList/CharacterCard.tsx index 00dce91b07..29d32ffbe2 100644 --- a/src/goals/CharInventoryCreation/components/CharacterList/CharacterCard.tsx +++ b/src/goals/CharInventoryCreation/components/CharacterList/CharacterCard.tsx @@ -7,11 +7,11 @@ import { import React from "react"; import { Translate } from "react-localize-redux"; -import theme from "types/theme"; import { characterStatus } from "goals/CharInventoryCreation/CharacterInventoryReducer"; import CharacterStatusText from "goals/CharInventoryCreation/components/CharacterList/CharacterStatusText"; +import theme from "types/theme"; -export interface CharacterCardProps { +interface CharacterCardProps { char: string; count: number; status: characterStatus; diff --git a/src/goals/CharInventoryCreation/components/CharacterList/CharacterListComponent.tsx b/src/goals/CharInventoryCreation/components/CharacterList/CharacterListComponent.tsx index d1eddfc707..3a5cc23fff 100644 --- a/src/goals/CharInventoryCreation/components/CharacterList/CharacterListComponent.tsx +++ b/src/goals/CharInventoryCreation/components/CharacterList/CharacterListComponent.tsx @@ -15,7 +15,7 @@ import { import { CharacterSetEntry } from "goals/CharInventoryCreation//CharacterInventoryReducer"; import CharacterCard from "goals/CharInventoryCreation/components/CharacterList/CharacterCard"; -export interface CharacterListProps { +interface CharacterListProps { setSelectedCharacter: (character: string) => void; allCharacters: CharacterSetEntry[]; } diff --git a/src/goals/CharInventoryCreation/components/CharacterList/CharacterSetHeader.tsx b/src/goals/CharInventoryCreation/components/CharacterList/CharacterSetHeader.tsx index 8568871423..09571685e8 100644 --- a/src/goals/CharInventoryCreation/components/CharacterList/CharacterSetHeader.tsx +++ b/src/goals/CharInventoryCreation/components/CharacterList/CharacterSetHeader.tsx @@ -1,13 +1,11 @@ -import React from "react"; -import { Grid, Typography, Tooltip } from "@material-ui/core"; +import { Grid, Tooltip, Typography } from "@material-ui/core"; import { Help } from "@material-ui/icons"; +import React from "react"; import { Translate } from "react-localize-redux"; import theme from "types/theme"; -export interface CharacterSetHeaderProps {} - -export default function CharacterSetHeader(props: CharacterSetHeaderProps) { +export default function CharacterSetHeader() { return ( { +export default class DisplayProg extends React.Component { render() { return this.props.numSteps > 1 ? ( @@ -48,5 +42,3 @@ export class DisplayProg extends React.Component< return `${this.props.currentStep} / ${this.props.numSteps}`; } } - -export default withLocalize(DisplayProg); diff --git a/src/goals/DefaultGoal/BaseGoalScreen/index.tsx b/src/goals/DefaultGoal/BaseGoalScreen/index.tsx index d756f8d9f8..258c0ce3d6 100644 --- a/src/goals/DefaultGoal/BaseGoalScreen/index.tsx +++ b/src/goals/DefaultGoal/BaseGoalScreen/index.tsx @@ -1,18 +1,17 @@ import { connect } from "react-redux"; import { RouteComponentProps } from "react-router"; -import { LocalizeContextProps } from "react-localize-redux"; import BaseGoalScreen from "goals/DefaultGoal/BaseGoalScreen/BaseGoalScreen"; import { StoreState } from "types"; import { Goal, GoalProps } from "types/goals"; -export interface TParams { +interface TParams { id: string; } -export function mapStateToProps( +function mapStateToProps( state: StoreState, - ownProps: GoalProps & RouteComponentProps & LocalizeContextProps + ownProps: GoalProps & RouteComponentProps ): GoalProps { let idNumber: number = parseInt(ownProps.match.params.id); let goal: Goal | undefined; diff --git a/src/goals/DefaultGoal/BaseGoalWidget/BaseGoalWidget.tsx b/src/goals/DefaultGoal/BaseGoalWidget/BaseGoalWidget.tsx index a713dad490..7e1e3015df 100644 --- a/src/goals/DefaultGoal/BaseGoalWidget/BaseGoalWidget.tsx +++ b/src/goals/DefaultGoal/BaseGoalWidget/BaseGoalWidget.tsx @@ -1,19 +1,17 @@ +import { Card, CardContent } from "@material-ui/core"; import React from "react"; import { LocalizeContextProps, withLocalize, Translate, } from "react-localize-redux"; -import { Card, CardContent } from "@material-ui/core"; import { GoalProps } from "types/goals"; // Width of each card -export const WIDTH = 200; - +const WIDTH = 200; // The percent of regular size that deselected cards shrink to const SCALE_FACTOR_FOR_DESELECTED = 0.9; - // Width of each not-selected card const DESELECTED_WIDTH = WIDTH * SCALE_FACTOR_FOR_DESELECTED; diff --git a/src/goals/MergeDupGoal/DuplicateFinder/DuplicateFinder.ts b/src/goals/MergeDupGoal/DuplicateFinder/DuplicateFinder.ts index 00ad45f133..c7cdac813a 100644 --- a/src/goals/MergeDupGoal/DuplicateFinder/DuplicateFinder.ts +++ b/src/goals/MergeDupGoal/DuplicateFinder/DuplicateFinder.ts @@ -2,7 +2,7 @@ import * as backend from "backend"; import { hasSenses, Word } from "types/word"; import { quicksort } from "utilities"; -export interface FinderParams { +interface FinderParams { maxScore: number; maxCount: number; subCost: number; @@ -25,7 +25,7 @@ export const DefaultParams: FinderParams = { lengthFilter: 2, }; -export interface ScoredWord { +interface ScoredWord { word: Word; score: number; } diff --git a/src/goals/MergeDupGoal/MergeDupStep/MergeDupStepActions.tsx b/src/goals/MergeDupGoal/MergeDupStep/MergeDupStepActions.tsx index d53fda068d..51c4b8e723 100644 --- a/src/goals/MergeDupGoal/MergeDupStep/MergeDupStepActions.tsx +++ b/src/goals/MergeDupGoal/MergeDupStep/MergeDupStepActions.tsx @@ -1,9 +1,5 @@ import * as backend from "backend"; import * as LocalStorage from "backend/localStorage"; -import { StoreState } from "types"; -import { StoreStateDispatch } from "types/actions"; -import { maxNumSteps } from "types/goalUtilities"; -import { State, Word } from "types/word"; import DupFinder from "goals/MergeDupGoal/DuplicateFinder/DuplicateFinder"; import { MergeDups, MergeStepData } from "goals/MergeDupGoal/MergeDups"; import { @@ -11,6 +7,10 @@ import { MergeTreeReference, TreeDataSense, } from "goals/MergeDupGoal/MergeDupStep/MergeDupsTree"; +import { StoreState } from "types"; +import { StoreStateDispatch } from "types/actions"; +import { maxNumSteps } from "types/goalUtilities"; +import { State, Word } from "types/word"; export enum MergeTreeActions { CLEAR_TREE = "CLEAR_TREE", @@ -336,7 +336,7 @@ export function mergeAll() { // Blacklist Functions -export function generateBlacklistHash(wordIDs: string[]) { +function generateBlacklistHash(wordIDs: string[]) { return wordIDs.sort().reduce((val, acc) => `${acc}:${val}`, ""); } diff --git a/src/goals/MergeDupGoal/MergeDupStep/MergeDupStepComponent.tsx b/src/goals/MergeDupGoal/MergeDupStep/MergeDupStepComponent.tsx index 4f0719e0cd..0ce6db564b 100644 --- a/src/goals/MergeDupGoal/MergeDupStep/MergeDupStepComponent.tsx +++ b/src/goals/MergeDupGoal/MergeDupStep/MergeDupStepComponent.tsx @@ -22,14 +22,14 @@ import { } from "react-beautiful-dnd"; import { LocalizeContextProps, withLocalize } from "react-localize-redux"; -import theme from "types/theme"; -import { uuid } from "utilities"; import { MergeTreeReference, MergeTreeWord, TreeDataSense, } from "goals/MergeDupGoal/MergeDupStep/MergeDupsTree"; import MergeRow from "goals/MergeDupGoal/MergeDupStep/MergeRow"; +import theme from "types/theme"; +import { uuid } from "utilities"; export interface SideBar { senses: { id: string; data: TreeDataSense }[]; @@ -37,8 +37,7 @@ export interface SideBar { senseID: string; } -//interface for component props -export interface MergeDupStepProps { +interface MergeDupStepProps { words: { [wordID: string]: MergeTreeWord }; moveSenses: (src: MergeTreeReference[], dest: MergeTreeReference[]) => void; orderSense: (wordID: string, senseID: string, order: number) => void; @@ -50,8 +49,7 @@ export interface MergeDupStepProps { advanceStep?: () => void; } -//interface for component state -export interface MergeDupStepState { +interface MergeDupStepState { portrait: boolean; sideBar: SideBar; } diff --git a/src/goals/MergeDupGoal/MergeDupStep/MergeRow/MergeRowComponent.tsx b/src/goals/MergeDupGoal/MergeDupStep/MergeRow/MergeRowComponent.tsx index b18e6a501a..5455c3daaf 100644 --- a/src/goals/MergeDupGoal/MergeDupStep/MergeRow/MergeRowComponent.tsx +++ b/src/goals/MergeDupGoal/MergeDupStep/MergeRow/MergeRowComponent.tsx @@ -1,7 +1,6 @@ import { MenuItem, Paper, Select, Typography } from "@material-ui/core"; import * as React from "react"; import { Droppable } from "react-beautiful-dnd"; -import { LocalizeContextProps, withLocalize } from "react-localize-redux"; import { SideBar } from "goals/MergeDupGoal/MergeDupStep/MergeDupStepComponent"; import { @@ -12,8 +11,7 @@ import { } from "goals/MergeDupGoal/MergeDupStep/MergeDupsTree"; import MergeStack from "goals/MergeDupGoal/MergeDupStep/MergeRow/MergeStack"; -//interface for component props -export interface MergeRowProps { +interface MergeRowProps { setVern: (wordID: string, vern: string) => void; wordID: string; moveSense?: (src: MergeTreeReference, dest: MergeTreeReference) => void; @@ -24,9 +22,7 @@ export interface MergeRowProps { sideBar: SideBar; } -export class MergeRow extends React.Component< - MergeRowProps & LocalizeContextProps -> { +export default class MergeRow extends React.Component { render() { let filled = !!this.props.words[this.props.wordID]; let verns: string[] = []; @@ -117,6 +113,3 @@ export class MergeRow extends React.Component< ); } } - -//export class as default -export default withLocalize(MergeRow); diff --git a/src/goals/MergeDupGoal/MergeDupStep/MergeRow/MergeStack.tsx b/src/goals/MergeDupGoal/MergeDupStep/MergeRow/MergeStack.tsx index 19c1aecfbf..069a03ab7d 100644 --- a/src/goals/MergeDupGoal/MergeDupStep/MergeRow/MergeStack.tsx +++ b/src/goals/MergeDupGoal/MergeDupStep/MergeRow/MergeStack.tsx @@ -11,14 +11,14 @@ import React, { useCallback, useEffect, useState } from "react"; import { Draggable } from "react-beautiful-dnd"; import { useSelector } from "react-redux"; -import { StoreState } from "types"; import { SideBar } from "goals/MergeDupGoal/MergeDupStep/MergeDupStepComponent"; import { Hash, TreeDataSense, } from "goals/MergeDupGoal/MergeDupStep/MergeDupsTree"; +import { StoreState } from "types"; -export interface MergeStackProps { +interface MergeStackProps { wordID: string; senseID: string; sense: Hash; diff --git a/src/goals/MergeDupGoal/MergeDupStep/MergeRow/index.tsx b/src/goals/MergeDupGoal/MergeDupStep/MergeRow/index.tsx index 3e076b9daf..4047bd1502 100644 --- a/src/goals/MergeDupGoal/MergeDupStep/MergeRow/index.tsx +++ b/src/goals/MergeDupGoal/MergeDupStep/MergeRow/index.tsx @@ -1,18 +1,18 @@ import { connect } from "react-redux"; -import { StoreState } from "types"; -import { StoreStateDispatch } from "types/actions"; import { setVern } from "goals/MergeDupGoal/MergeDupStep/MergeDupStepActions"; import MergeRowComponent from "goals/MergeDupGoal/MergeDupStep/MergeRow/MergeRowComponent"; +import { StoreState } from "types"; +import { StoreStateDispatch } from "types/actions"; -export function mapStateToProps(state: StoreState) { +function mapStateToProps(state: StoreState) { return { words: state.mergeDuplicateGoal.tree.words, data: state.mergeDuplicateGoal.data, }; } -export function mapDispatchToProps(dispatch: StoreStateDispatch) { +function mapDispatchToProps(dispatch: StoreStateDispatch) { return { setVern: (wordID: string, vern: string) => { dispatch(setVern(wordID, vern)); diff --git a/src/goals/MergeDupGoal/MergeDupStep/index.tsx b/src/goals/MergeDupGoal/MergeDupStep/index.tsx index 1b0c54f46c..19be16b259 100644 --- a/src/goals/MergeDupGoal/MergeDupStep/index.tsx +++ b/src/goals/MergeDupGoal/MergeDupStep/index.tsx @@ -4,8 +4,6 @@ import { asyncAdvanceStep, asyncRefreshWords, } from "components/GoalTimeline/GoalsActions"; -import { StoreState } from "types"; -import { StoreStateDispatch } from "types/actions"; import { moveSenses, mergeAll, @@ -14,14 +12,16 @@ import { } from "goals/MergeDupGoal/MergeDupStep/MergeDupStepActions"; import MergeDupStepComponent from "goals/MergeDupGoal/MergeDupStep/MergeDupStepComponent"; import { MergeTreeReference } from "goals/MergeDupGoal/MergeDupStep/MergeDupsTree"; +import { StoreState } from "types"; +import { StoreStateDispatch } from "types/actions"; -export function mapStateToProps(state: StoreState) { +function mapStateToProps(state: StoreState) { return { words: state.mergeDuplicateGoal.tree.words, }; } -export function mapDispatchToProps(dispatch: StoreStateDispatch) { +function mapDispatchToProps(dispatch: StoreStateDispatch) { return { advanceStep: () => { dispatch(asyncAdvanceStep()); diff --git a/src/types/goals.tsx b/src/types/goals.tsx index 59cf9576ea..9596f1bb1b 100644 --- a/src/types/goals.tsx +++ b/src/types/goals.tsx @@ -5,24 +5,20 @@ import { import { MergeDupData, MergeStepData } from "goals/MergeDupGoal/MergeDups"; import { User } from "types/user"; -export enum GoalOption { +enum GoalOption { Complete, Abandon, Current, } -export type GoalData = CreateCharInvData | MergeDupData | {}; // | OtherTypes +type GoalData = CreateCharInvData | MergeDupData | {}; // | OtherTypes -export type GoalStep = CreateCharInvStepData | MergeStepData; // | OtherTypes +type GoalStep = CreateCharInvStepData | MergeStepData; // | OtherTypes export interface GoalProps { goal?: Goal; } -export interface GoalViewState { - state: GoalsState; -} - // The representation of goals in the redux store export interface GoalsState { historyState: GoalHistoryState; @@ -95,6 +91,6 @@ export class Goal { } } -export function generateGuid(): string { +function generateGuid(): string { return Math.floor(Math.random() * 9999999).toString(); } diff --git a/src/types/runtimeConfig.tsx b/src/types/runtimeConfig.tsx index 0fed4e1aef..d13243e812 100644 --- a/src/types/runtimeConfig.tsx +++ b/src/types/runtimeConfig.tsx @@ -1,4 +1,4 @@ -export interface RuntimeConfigItems { +interface RuntimeConfigItems { baseUrl: string; captchaRequired: boolean; captchaSiteKey: string; diff --git a/src/types/theme.ts b/src/types/theme.ts index c71930ee3f..34677309ff 100644 --- a/src/types/theme.ts +++ b/src/types/theme.ts @@ -7,9 +7,7 @@ import { Path } from "browserHistory"; // Constants which define colors later: const primary: string = blue[600]; const secondary: string = grey[200]; -const accent: string = grey[900]; const error: string = red[600]; -const hover: string = blue[100]; export const buttonSuccess = green[500]; // createProjectComponent and RegisterComponent export const highlight = yellow[100]; // goals/CharInventoryCreation/components/SampleWords/WordTileComponent.tsx @@ -63,51 +61,6 @@ const baseTheme = createMuiTheme({ }, }); -// Theme used when dynamic cards wanted -export const dynamicTheme = responsiveFontSizes( - createMuiTheme({ - typography: { ...typography }, - palette: { ...palette } as PaletteOptions, - spacing: 8, - props: { - MuiButtonBase: { - disableRipple: false, - }, - }, - overrides: { - MuiButton: { - root: { - color: accent, - backgroundColor: primary, - "&:hover": { - color: primary, - backgroundColor: hover, - }, - }, - }, - MuiCard: { - root: { - color: grey[900], - backgroundColor: primary, - "&:hover": { - color: primary, - backgroundColor: hover, - }, - }, - }, - }, - }), - dynamicFontParams -); - -// Additional styles used by various components -export const styleAddendum = { - inactive: { - color: grey[600], - backgroundColor: grey[400], - }, -}; - // Used in IconHolder export const recorderStatus = { idle: {