Skip to content

Commit

Permalink
upgraded react/redux
Browse files Browse the repository at this point in the history
  • Loading branch information
Le0Michine committed Oct 1, 2018
1 parent b265188 commit ce23b4e
Show file tree
Hide file tree
Showing 18 changed files with 544 additions and 180 deletions.
582 changes: 483 additions & 99 deletions package-lock.json

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
"material-ui-icons": "^1.0.0-beta.17",
"moment": "^2.22.2",
"moment-timezone": "^0.5.21",
"react": "^16.2.0",
"react": "^16.5.2",
"react-autosuggest": "^9.3.2",
"react-dom": "^16.2.0",
"react-redux": "^5.0.6",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"react-dom": "^16.5.2",
"react-redux": "^5.0.7",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-router-redux": "^4.0.8",
"redux": "^3.7.2",
"redux": "^4.0.0",
"redux-localstorage": "^0.4.1",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.2.0",
Expand All @@ -56,17 +56,17 @@
"@types/jest": "^23.3.2",
"@types/lodash": "^4.14.116",
"@types/moment-timezone": "^0.5.3",
"@types/react": "^16.0.28",
"@types/react-dom": "^16.0.3",
"@types/react-redux": "^5.0.14",
"@types/react-router": "^4.0.19",
"@types/react-router-dom": "^4.2.3",
"@types/react-router-redux": "^5.0.10",
"@types/react": "^16.4.14",
"@types/react-dom": "^16.0.8",
"@types/react-redux": "^6.0.9",
"@types/react-router": "^4.0.31",
"@types/react-router-dom": "^4.3.1",
"@types/react-router-redux": "^5.0.16",
"@types/redux-logger": "^3.0.5",
"@types/topojson": "^3.0.2",
"@types/webpack": "^2.2.5",
"autoprefixer": "^7.2.2",
"awesome-typescript-loader": "^3.0.3",
"awesome-typescript-loader": "^5.2.1",
"babel-loader": "^8.0.4",
"babel-plugin-react-html-attrs": "^2.1.0",
"clean-webpack-plugin": "^0.1.19",
Expand All @@ -83,7 +83,7 @@
"sass-loader": "^6.0.6",
"style-loader": "^0.13.2",
"tslint": "^5.11.0",
"typescript": "^2.6.2",
"typescript": "^2.8.4",
"typings-for-css-modules-loader": "^1.7.0",
"webpack": "^4.20.2",
"webpack-cli": "^3.1.2",
Expand Down
4 changes: 1 addition & 3 deletions src/app.common/actions/DisplaySettingsActions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { ActionCreator } from "react-redux";
import { DSTSetting } from "../models";
import { Action } from "./Action";
import { DisplaySettingsInfo, DSTSetting } from "../models";
import * as moment from "moment-timezone";

export function changeShowDSTSetting(showDST: DSTSetting): Action<DSTSetting> {
return {
Expand Down
3 changes: 0 additions & 3 deletions src/app.common/actions/ScrollPositionActions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import { ActionCreator } from "react-redux";
import { Action } from "./Action";
import { DisplaySettingsInfo, DSTSetting } from "../models";
import * as moment from "moment-timezone";

export function changeScrollPostion(position: number): Action<number> {
return {
Expand Down
4 changes: 1 addition & 3 deletions src/app.common/actions/SelectedTimeSpanActions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { ActionCreator } from "react-redux";
import { Action } from "./Action";
import { TimeSpanInfo } from "../models";
import * as moment from "moment-timezone";
import { Action } from "./Action";

export function changeStartTime(hour: number, minute: number) {
return {
Expand Down
4 changes: 1 addition & 3 deletions src/app.common/actions/ThemeSettingsActions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { ActionCreator } from "react-redux";
import { Action } from "./Action";
import { DisplaySettingsInfo, DSTSetting } from "../models";
import * as moment from "moment-timezone";


export function changePrimaryColor(colorName: string): Action<string> {
return {
Expand Down
5 changes: 2 additions & 3 deletions src/app.common/actions/TimeLineActions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { ActionCreator } from "react-redux";
import { TimeZoneInfo } from "../models";
import { Action } from "./Action";
import { TimeZoneInfo, createTimeZoneInfo } from "../models";
import * as moment from "moment-timezone";


export function createOrUpdateTimeLine(timeLine: TimeZoneInfo) {
return {
Expand Down
4 changes: 1 addition & 3 deletions src/app.common/actions/TimeLineFormActions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { ActionCreator } from "react-redux";
import * as Redux from "redux";
import { TimeZoneInfo } from "../models";
import { Action } from "./Action";
import { TimeZoneInfo, createTimeZoneInfo } from "../models";

export function clearForm(id: number): Action<TimeZoneInfo> {
return {
Expand Down
5 changes: 2 additions & 3 deletions src/app.common/components/Typeahead.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { getMatches, SuggestionMatchPart } from "../util/match";
import { MenuItem } from "material-ui/Menu";
import Paper from "material-ui/Paper";
import { Theme, withStyles } from "material-ui/styles";
import TextField from "material-ui/TextField";
import Typography from "material-ui/Typography";
import * as React from "react";
import * as Autosuggest from "react-autosuggest";

import { Suggestion } from "../models";
import { getMatches, SuggestionMatchPart } from "../util/match";

const match = require("autosuggest-highlight/match");
const parse = require("autosuggest-highlight/parse");
Expand Down Expand Up @@ -198,7 +197,7 @@ class TypeaheadImpl extends React.Component<TypeaheadProps, TypeaheadState> {
}
}

const styles = (theme: Theme): React.CSSProperties => ({
const styles = (theme: Theme): any => ({
container: {
flexGrow: 1,
position: "relative",
Expand Down
15 changes: 3 additions & 12 deletions src/app.common/store.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
import * as moment from "moment";
import { applyMiddleware, compose, createStore, Store, StoreEnhancer } from "redux";
import { createLogger } from "redux-logger";

import {
AppTheme,
createTimeZoneInfo,
DisplaySettingsInfo,
ScrollPosition,
TimeSpanInfo,
TimeZoneInfo,
} from "../app.common/models";
import { Action } from "./actions";
import { localStorageEnchancer } from "./localstorage-enchancer";
import { rootReducer, initialState, IAppState } from "./reducers";
import { initialPalette } from "./themes/themes";
import { IAppState, initialState, rootReducer } from "./reducers";

export { IAppState, IAppStoreDispatcher } from "./reducers";

Expand All @@ -33,7 +24,7 @@ if (process.env.NODE_ENV === "development") {
) as any;
}

export const store: Store<IAppState> = createStore<IAppState>(
export const store: Store<IAppState> = createStore<IAppState, Action<any>, {}, {}>(
rootReducer,
initialState,
enchancer
Expand Down
3 changes: 2 additions & 1 deletion src/app.options/components/AddNewTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import TextField from "material-ui/TextField";
import * as moment from "moment-timezone";
import { KeyboardEvent } from "react";
import * as React from "react";
import { ActionCreator, connect } from "react-redux";
import { connect } from "react-redux";
import { ActionCreator } from "redux";

import { changeDisplayName, changeTimezoneId, clearForm, createOrUpdateTimeLine } from "../../app.common/actions";
import { Typeahead } from "../../app.common/components";
Expand Down
18 changes: 9 additions & 9 deletions src/app.options/components/DisplaySettings.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { FormControlLabel } from "material-ui/Form";
import { FormControl, FormControlLabel } from "material-ui/Form";
import Input, { InputLabel } from "material-ui/Input";
import { MenuItem } from "material-ui/Menu";
import Switch from "material-ui/Switch";
import * as React from "react";
import { ActionCreator, connect } from "react-redux";
import Select from "material-ui/Select";
import { FormControl } from "material-ui/Form";
import Input, { InputLabel } from "material-ui/Input";
import Switch from "material-ui/Switch";
import Typography from "material-ui/Typography";
import * as React from "react";
import { connect } from "react-redux";
import { ActionCreator } from "redux";

import {
change24HoursTimeFormatSetting,
changeDarkThemeSetting,
changePrimaryColor,
changeSecondaryColor,
changeShowControlPanelSetting,
changeShowDateLabelsSetting,
changeShowDSTSetting,
changeShowTimezoneIdSetting,
changeShowTimezoneAbbreviationSetting,
changeShowTimezoneIdSetting,
changeShowUTCOffsetSetting,
change24HoursTimeFormatSetting,
changeTimeSelectionStepSetting,
changeShowDateLabelsSetting,
} from "../../app.common/actions";
import { DisplaySettingsInfo } from "../../app.common/models";
import { AppTheme } from "../../app.common/models/AppTheme";
Expand Down
22 changes: 10 additions & 12 deletions src/app.options/components/OptionsLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
import * as React from "react";
import * as moment from "moment";
import { Link } from "react-router-dom";
import { connect, ActionCreator } from "react-redux";
import { bindActionCreators } from "redux";
import Button from "material-ui/Button";
import Card from "material-ui/Card";
import Divider from "material-ui/Divider";
import Typography from "material-ui/Typography";
import * as moment from "moment";
import * as React from "react";
import { connect } from "react-redux";
import { ActionCreator } from "redux";

import { TimeLine, Clock } from "../../app.common/components";
import { removeTimeLine, startEdit, swapTimeLines } from "../../app.common/actions";
import { Clock, TimeLine } from "../../app.common/components";
import { DisplaySettingsInfo, getHoursWithOffset, getOffset, TimeZoneInfo } from "../../app.common/models";
import { IAppState } from "../../app.common/store";
import { getManifest } from "../../app.common/util/manifest";
import AddNewTimeline from "./AddNewTimeline";
import { TimeLineControls } from "./TimeLineControls";
import { DisplaySettings } from "./DisplaySettings";
import { NavTab } from "./NavTab";
import { DisplaySettingsInfo, TimeZoneInfo, createTimeZoneInfo, getOffset, getHoursWithOffset } from "../../app.common/models";
import { IAppState, IAppStoreDispatcher } from "../../app.common/store";
import { removeTimeLine, startEdit, swapTimeLines } from "../../app.common/actions";
import * as style from "./OptionsLayout.scss";
import { getManifest } from "../../app.common/util/manifest";
import { TimeLineControls } from "./TimeLineControls";

interface OptionsLayoutDispatchProps {
swapTimeLines: ActionCreator<any>;
Expand Down
3 changes: 2 additions & 1 deletion src/app/components/BottomPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import Button from "material-ui/Button";
import Typography from "material-ui/Typography";
import * as moment from "moment";
import * as React from "react";
import { ActionCreator, connect } from "react-redux";
import { connect } from "react-redux";
import { ActionCreator } from "redux";

import { changeScrollPostion, changeSelectedTimeSpan, resetScrollPostion } from "../../app.common/actions";
import { Range } from "../../app.common/components";
Expand Down
3 changes: 2 additions & 1 deletion src/app/components/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import Paper from "material-ui/Paper";
import * as moment from "moment";
import * as React from "react";
import { ActionCreator, connect } from "react-redux";
import { connect } from "react-redux";
import { ActionCreator } from "redux";

import { changeScrollPostion, changeSelectedTimeSpan, resetScrollPostion } from "../../app.common/actions";
import { DisplaySettingsInfo, RangeValue, ScrollPosition, TimeSpanInfo } from "../../app.common/models";
Expand Down
15 changes: 8 additions & 7 deletions src/app/components/Timelines.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import * as React from "react";
import { ActionCreator, connect } from "react-redux";
import { connect } from "react-redux";
import { ActionCreator } from "redux";

import { changeScrollPostion, changeSelectedTimeSpan, resetScrollPostion } from "../../app.common/actions";
import { TimeLine, TimeSelector } from "../../app.common/components";
import {
DisplaySettingsInfo,
getHoursWithOffset,
getOffset,
RangeValue,
ScrollPosition,
TimeSpanInfo,
DisplaySettingsInfo,
getHoursWithOffset,
getOffset,
RangeValue,
ScrollPosition,
TimeSpanInfo,
} from "../../app.common/models";
import { IAppState } from "../../app.common/store";
import * as style from "./Layout.scss";
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/TopPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import SettingsIcon from "material-ui-icons/Settings";
import IconButton from "material-ui/IconButton";
import Tooltip from "material-ui/Tooltip";
import * as React from "react";
import { ActionCreator, connect } from "react-redux";
import { connect } from "react-redux";
import { ActionCreator } from "redux";

import { changeScrollPostion, changeSelectedTimeSpan, resetScrollPostion } from "../../app.common/actions";
import { Clock } from "../../app.common/components";
import { DisplaySettingsInfo, ScrollPosition } from "../../app.common/models";
import { IAppState } from "../../app.common/store";

import * as style from "./Layout.scss";

interface ILayoutStateProps {
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "Worldtime",
"description": "All time zones in one click",
"version": "1.4.192",
"version": "1.4.208",
"options_page": "options.html",
"browser_action": {
"default_icon": "icons/icon_19.png",
Expand Down

0 comments on commit ce23b4e

Please sign in to comment.