author
int64
658
755k
date
stringlengths
19
19
timezone
int64
-46,800
43.2k
hash
stringlengths
40
40
message
stringlengths
5
490
mods
list
language
stringclasses
20 values
license
stringclasses
3 values
repo
stringlengths
5
68
original_message
stringlengths
12
491
129,187
04.10.2019 12:58:07
14,400
1236b5d87ca7178816892e22d9271234673d6329
[server] Update react-router from flow-typed
[ { "change_type": "MODIFY", "old_path": "server/flow-typed/npm/react-router_v5.x.x.js", "new_path": "server/flow-typed/npm/react-router_v5.x.x.js", "diff": "-// flow-typed signature: 05910bbabd87fd1003a3fdba9a7bc58b\n-// flow-typed version: ad8465c97a/react-router_v5.x.x/flow_>=v0.63.x <=v0.103.x\n+// flow-typed signature: 80f03b85756c359f80a69bddbefbf16d\n+// flow-typed version: 0fc30f59a5/react-router_v5.x.x/flow_>=v0.63.x <=v0.103.x\ndeclare module \"react-router\" {\n// NOTE: many of these are re-exported by react-router-dom and\n@@ -146,5 +146,4 @@ declare module \"react-router\" {\nmatchPath: typeof matchPath,\ngeneratePath: typeof generatePath,\n};\n-\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Update react-router from flow-typed
129,187
06.10.2019 21:44:10
14,400
4dbbf8cf8db72bc5a974f10813ad2a1370e166b1
[web] Update react-color from flow-typed
[ { "change_type": "MODIFY", "old_path": "web/flow-typed/npm/react-color_v2.x.x.js", "new_path": "web/flow-typed/npm/react-color_v2.x.x.js", "diff": "-// flow-typed signature: e76c8d9a93ab9a5364f75e5bbf1915ab\n-// flow-typed version: c6154227d1/react-color_v2.x.x/flow_>=v0.56.x <=v0.103.x\n+// flow-typed signature: 6e9a8aa9b75de0d2f7b8af8ce775346c\n+// flow-typed version: b5454b8595/react-color_v2.x.x/flow_>=v0.56.x <=v0.103.x\ndeclare module \"react-color\" {\nimport type { ComponentType, Component } from 'react';\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[web] Update react-color from flow-typed
129,187
06.10.2019 21:49:18
14,400
6973245b7519ff53e7bf69e6f28451657a032f32
[server] Update express libdefs
[ { "change_type": "MODIFY", "old_path": "server/flow-typed/npm/cookie-parser_v1.x.x.js", "new_path": "server/flow-typed/npm/cookie-parser_v1.x.x.js", "diff": "-// flow-typed signature: cda4a81a8221c6d34f3689a9fad65f2a\n-// flow-typed version: c6154227d1/cookie-parser_v1.x.x/flow_>=v0.93.x <=v0.103.x\n-\n/**\n* Flow libdef for 'cookie-parser'\n* See https://www.npmjs.com/package/cookie-parser\n@@ -13,179 +10,31 @@ import type { Socket } from 'net';\ndeclare module 'cookie-parser' {\n/**\n* NOTE:\n- * The following block has all been copied from\n- * https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/express_v4.x.x/flow_v0.93.x-/express_v4.x.x.js#L103-L105\n+ * The following block has all been copied from the express libdef\n*/\n/* -------------------------- 8< ------------------------------------------------------------------ */\n- declare type express$RenderCallback = (\n- err: Error | null,\n- html?: string\n- ) => mixed;\n-\n- declare type express$CookieOptions = {\n- domain?: string,\n- encode?: (value: string) => string,\n- expires?: Date,\n- httpOnly?: boolean,\n- maxAge?: number,\n- path?: string,\n- secure?: boolean,\n- signed?: boolean,\n- };\n-\ndeclare type express$RouterOptions = {\ncaseSensitive?: boolean,\nmergeParams?: boolean,\n- strict?: boolean,\n+ strict?: boolean\n};\n- declare interface express$RouteMethodType<T> {\n- (middleware: express$Middleware): T;\n- (...middleware: Array<express$Middleware>): T;\n- (\n- path: express$Path | express$Path[],\n- ...middleware: Array<express$Middleware>\n- ): T;\n+ declare class express$RequestResponseBase {\n+ app: express$Application<any, any>;\n+ get(field: string): string | void;\n}\ndeclare type express$RequestParams = {\n- [param: string]: string,\n+ [param: string]: string\n};\n- declare type express$SendFileOptions = {\n- maxAge?: number,\n- root?: string,\n- lastModified?: boolean,\n- headers?: { [name: string]: string },\n- dotfiles?: 'allow' | 'deny' | 'ignore',\n- };\n-\n- declare class express$Application extends express$Router\n- mixins events$EventEmitter {\n- constructor(): void;\n- locals: { [name: string]: mixed };\n- mountpath: string;\n- listen(\n- port: number,\n- hostname?: string,\n- backlog?: number,\n- callback?: (err?: ?Error) => mixed\n- ): ?http.Server;\n- listen(\n- port: number,\n- hostname?: string,\n- callback?: (err?: ?Error) => mixed\n- ): ?http.Server;\n- listen(port: number, callback?: (err?: ?Error) => mixed): ?http.Server;\n- listen(path: string, callback?: (err?: ?Error) => mixed): ?http.Server;\n- listen(handle: Object, callback?: (err?: ?Error) => mixed): ?http.Server;\n- disable(name: string): void;\n- disabled(name: string): boolean;\n- enable(name: string): express$Application;\n- enabled(name: string): boolean;\n- engine(name: string, callback: Function): void;\n- /**\n- * Mixed will not be taken as a value option. Issue around using the GET http method name and the get for settings.\n- */\n- // get(name: string): mixed;\n- set(name: string, value: mixed): mixed;\n- render(\n- name: string,\n- optionsOrFunction: { [name: string]: mixed },\n- callback: express$RenderCallback\n- ): void;\n- handle(\n- req: http$IncomingMessage<>,\n- res: http$ServerResponse,\n- next?: ?express$NextFunction\n- ): void;\n- // callable signature is not inherited\n- (\n- req: http$IncomingMessage<>,\n- res: http$ServerResponse,\n- next?: ?express$NextFunction\n- ): void;\n- }\n-\n- declare type express$Path = string | RegExp;\n-\n- declare class express$Route {\n- all: express$RouteMethodType<this>;\n- get: express$RouteMethodType<this>;\n- post: express$RouteMethodType<this>;\n- put: express$RouteMethodType<this>;\n- head: express$RouteMethodType<this>;\n- delete: express$RouteMethodType<this>;\n- options: express$RouteMethodType<this>;\n- trace: express$RouteMethodType<this>;\n- copy: express$RouteMethodType<this>;\n- lock: express$RouteMethodType<this>;\n- mkcol: express$RouteMethodType<this>;\n- move: express$RouteMethodType<this>;\n- purge: express$RouteMethodType<this>;\n- propfind: express$RouteMethodType<this>;\n- proppatch: express$RouteMethodType<this>;\n- unlock: express$RouteMethodType<this>;\n- report: express$RouteMethodType<this>;\n- mkactivity: express$RouteMethodType<this>;\n- checkout: express$RouteMethodType<this>;\n- merge: express$RouteMethodType<this>;\n-\n- // @TODO Missing 'm-search' but get flow illegal name error.\n-\n- notify: express$RouteMethodType<this>;\n- subscribe: express$RouteMethodType<this>;\n- unsubscribe: express$RouteMethodType<this>;\n- patch: express$RouteMethodType<this>;\n- search: express$RouteMethodType<this>;\n- connect: express$RouteMethodType<this>;\n- }\n-\n- declare class express$Router extends express$Route {\n- constructor(options?: express$RouterOptions): void;\n- route(path: string): express$Route;\n- static (options?: express$RouterOptions): express$Router;\n- use(middleware: express$Middleware): this;\n- use(...middleware: Array<express$Middleware>): this;\n- use(\n- path: express$Path | express$Path[],\n- ...middleware: Array<express$Middleware>\n- ): this;\n- use(path: string, router: express$Router): this;\n- handle(\n- req: http$IncomingMessage<>,\n- res: http$ServerResponse,\n- next: express$NextFunction\n- ): void;\n- param(\n- param: string,\n- callback: (\n- req: express$Request,\n- res: express$Response,\n- next: express$NextFunction,\n- id: string\n- ) => mixed\n- ): void;\n- (\n- req: http$IncomingMessage<>,\n- res: http$ServerResponse,\n- next?: ?express$NextFunction\n- ): void;\n- }\n-\n- declare class express$RequestResponseBase {\n- app: express$Application;\n- get(field: string): string | void;\n- }\n-\n- declare class express$Request extends http$IncomingMessage\n- mixins express$RequestResponseBase {\n+ declare class express$Request extends http$IncomingMessage mixins express$RequestResponseBase {\nbaseUrl: string;\nbody: mixed;\ncookies: { [cookie: string]: string };\n- connection: Socket;\n+ connection: net$Socket;\nfresh: boolean;\nhostname: string;\nip: string;\n@@ -194,7 +43,7 @@ declare module 'cookie-parser' {\noriginalUrl: string;\nparams: express$RequestParams;\npath: string;\n- protocol: 'https' | 'http';\n+ protocol: \"https\" | \"http\";\nquery: { [name: string]: string | Array<string> };\nroute: string;\nsecure: boolean;\n@@ -208,12 +57,37 @@ declare module 'cookie-parser' {\nacceptsEncodings(...encoding: Array<string>): string | false;\nacceptsLanguages(...lang: Array<string>): string | false;\nheader(field: string): string | void;\n- is(type: string): boolean;\n+ is(type: string): string | false;\nparam(name: string, defaultValue?: string): string | void;\n}\n- declare class express$Response extends http$ServerResponse\n- mixins express$RequestResponseBase {\n+ declare type express$CookieOptions = {\n+ domain?: string,\n+ encode?: (value: string) => string,\n+ expires?: Date,\n+ httpOnly?: boolean,\n+ maxAge?: number,\n+ path?: string,\n+ secure?: boolean,\n+ signed?: boolean\n+ };\n+\n+ declare type express$Path = string | RegExp;\n+\n+ declare type express$RenderCallback = (\n+ err: Error | null,\n+ html?: string\n+ ) => mixed;\n+\n+ declare type express$SendFileOptions = {\n+ maxAge?: number,\n+ root?: string,\n+ lastModified?: boolean,\n+ headers?: { [name: string]: string },\n+ dotfiles?: \"allow\" | \"deny\" | \"ignore\"\n+ };\n+\n+ declare class express$Response extends http$ServerResponse mixins express$RequestResponseBase {\nheadersSent: boolean;\nlocals: { [name: string]: mixed };\nappend(field: string, value?: string): this;\n@@ -254,28 +128,159 @@ declare module 'cookie-parser' {\nreq: express$Request;\n}\n- declare type express$NextFunction = (err?: ?Error | 'route') => mixed;\n- declare type express$Middleware =\n- | ((\n- req: express$Request,\n- res: express$Response,\n- next: express$NextFunction\n- ) => mixed)\n- | ((\n- error: Error,\n- req: express$Request,\n- res: express$Response,\n+ declare type express$NextFunction = (err?: ?Error | \"route\") => mixed;\n+ declare type express$Middleware<Req: express$Request, Res: express$Response> =\n+ ((req: Req, res: Res, next: express$NextFunction) => mixed) |\n+ ((error: Error, req: Req, res: Res, next: express$NextFunction) => mixed);\n+\n+ declare interface express$RouteMethodType<\n+ T,\n+ Req: express$Request,\n+ Res: express$Response,\n+ > {\n+ (middleware: express$Middleware<Req, Res>): T;\n+ (...middleware: Array<express$Middleware<Req, Res>>): T;\n+ (\n+ path: express$Path | $ReadOnlyArray<express$Path>,\n+ ...middleware: Array<express$Middleware<Req, Res>>\n+ ): T;\n+ }\n+\n+ declare class express$Route<Req: express$Request, Res: express$Response> {\n+ all: express$RouteMethodType<this, Req, Res>;\n+ get: express$RouteMethodType<this, Req, Res>;\n+ post: express$RouteMethodType<this, Req, Res>;\n+ put: express$RouteMethodType<this, Req, Res>;\n+ head: express$RouteMethodType<this, Req, Res>;\n+ delete: express$RouteMethodType<this, Req, Res>;\n+ options: express$RouteMethodType<this, Req, Res>;\n+ trace: express$RouteMethodType<this, Req, Res>;\n+ copy: express$RouteMethodType<this, Req, Res>;\n+ lock: express$RouteMethodType<this, Req, Res>;\n+ mkcol: express$RouteMethodType<this, Req, Res>;\n+ move: express$RouteMethodType<this, Req, Res>;\n+ purge: express$RouteMethodType<this, Req, Res>;\n+ propfind: express$RouteMethodType<this, Req, Res>;\n+ proppatch: express$RouteMethodType<this, Req, Res>;\n+ unlock: express$RouteMethodType<this, Req, Res>;\n+ report: express$RouteMethodType<this, Req, Res>;\n+ mkactivity: express$RouteMethodType<this, Req, Res>;\n+ checkout: express$RouteMethodType<this, Req, Res>;\n+ merge: express$RouteMethodType<this, Req, Res>;\n+\n+ // @TODO Missing 'm-search' but get flow illegal name error.\n+\n+ notify: express$RouteMethodType<this, Req, Res>;\n+ subscribe: express$RouteMethodType<this, Req, Res>;\n+ unsubscribe: express$RouteMethodType<this, Req, Res>;\n+ patch: express$RouteMethodType<this, Req, Res>;\n+ search: express$RouteMethodType<this, Req, Res>;\n+ connect: express$RouteMethodType<this, Req, Res>;\n+ }\n+\n+ declare class express$Router<\n+ Req: express$Request,\n+ Res: express$Response,\n+ > extends express$Route<Req, Res> {\n+ constructor(options?: express$RouterOptions): void;\n+ route(path: string): express$Route<Req, Res>;\n+ static <Req2: express$Request, Res2: express$Response>(\n+ options?: express$RouterOptions,\n+ ): express$Router<Req2, Res2>;\n+ use(middleware: express$Middleware<Req, Res>): this;\n+ use(...middleware: Array<express$Middleware<Req, Res>>): this;\n+ use(\n+ path: express$Path | $ReadOnlyArray<express$Path>,\n+ ...middleware: Array<express$Middleware<Req, Res>>\n+ ): this;\n+ use(path: string, router: express$Router<Req, Res>): this;\n+ handle(\n+ req: http$IncomingMessage<>,\n+ res: http$ServerResponse,\nnext: express$NextFunction\n- ) => mixed);\n+ ): void;\n+ param(\n+ param: string,\n+ callback: (\n+ req: Req,\n+ res: Res,\n+ next: express$NextFunction,\n+ value: string,\n+ paramName: string,\n+ ) => mixed\n+ ): void;\n+ (\n+ req: http$IncomingMessage<>,\n+ res: http$ServerResponse,\n+ next?: ?express$NextFunction\n+ ): void;\n+ }\n+\n+ /*\n+ With flow-bin ^0.59, express app.listen() is deemed to return any and fails flow type coverage.\n+ Which is ironic because https://github.com/facebook/flow/blob/master/Changelog.md#misc-2 (release notes for 0.59)\n+ says \"Improves typings for Node.js HTTP server listen() function.\" See that? IMPROVES!\n+ To work around this issue, we changed Server to ?Server here, so that our invocations of express.listen() will\n+ not be deemed to lack type coverage.\n+ */\n+\n+ declare class express$Application<\n+ Req: express$Request,\n+ Res: express$Response,\n+ > extends express$Router<Req, Res> mixins events$EventEmitter {\n+ constructor(): void;\n+ locals: { [name: string]: mixed };\n+ mountpath: string;\n+ listen(\n+ port: number,\n+ hostname?: string,\n+ backlog?: number,\n+ callback?: (err?: ?Error) => mixed\n+ ): ?http$Server;\n+ listen(\n+ port: number,\n+ hostname?: string,\n+ callback?: (err?: ?Error) => mixed\n+ ): ?http$Server;\n+ listen(port: number, callback?: (err?: ?Error) => mixed): ?http$Server;\n+ listen(path: string, callback?: (err?: ?Error) => mixed): ?http$Server;\n+ listen(handle: Object, callback?: (err?: ?Error) => mixed): ?http$Server;\n+ disable(name: string): void;\n+ disabled(name: string): boolean;\n+ enable(name: string): this;\n+ enabled(name: string): boolean;\n+ engine(name: string, callback: Function): void;\n+ /**\n+ * Mixed will not be taken as a value option. Issue around using the GET http method name and the get for settings.\n+ */\n+ // get(name: string): mixed;\n+ set(name: string, value: mixed): mixed;\n+ render(\n+ name: string,\n+ optionsOrFunction: { [name: string]: mixed },\n+ callback: express$RenderCallback\n+ ): void;\n+ handle(\n+ req: http$IncomingMessage<>,\n+ res: http$ServerResponse,\n+ next?: ?express$NextFunction\n+ ): void;\n+ // callable signature is not inherited\n+ (\n+ req: http$IncomingMessage<>,\n+ res: http$ServerResponse,\n+ next?: ?express$NextFunction\n+ ): void;\n+ }\n/* -------------------------- 8< ------------------------------------------------------------------ */\n- declare export type Middleware = express$Middleware;\n+ declare export type Middleware = express$Middleware<express$Request, express$Response>;\ndeclare function cookieParser(\nsecret?: string | Array<string>,\noptions?: mixed\n- ): express$Middleware;\n+ ): Middleware;\ndeclare export default typeof cookieParser;\n}\n" }, { "change_type": "RENAME", "old_path": "server/flow-typed/npm/express_v4.16.x.js", "new_path": "server/flow-typed/npm/express_v4.17.x.js", "diff": "-// flow-typed signature: 2d8ba774d9de59f2fd35fbdf39c24f08\n-// flow-typed version: c6154227d1/express_v4.16.x/flow_>=v0.94.x <=v0.103.x\n-\ndeclare type express$RouterOptions = {\ncaseSensitive?: boolean,\nmergeParams?: boolean,\n@@ -8,7 +5,7 @@ declare type express$RouterOptions = {\n};\ndeclare class express$RequestResponseBase {\n- app: express$Application;\n+ app: express$Application<any, any>;\nget(field: string): string | void;\n}\n@@ -16,6 +13,33 @@ declare type express$RequestParams = {\n[param: string]: string\n};\n+/*\n+ NOTE: Use caution when extending `express$Request` or `express$Response`. When\n+ a request first hits the server, its `req` and `res` will not have any\n+ additional properties, even if you explicitly type them with your custom\n+ subclass. Subsequent middleware may assign these properties, but you must be\n+ cognizant of this ordering. One way to handle this is marking all properties\n+ as optional to force refinement every time a property is accessed. Therefore,\n+ we advise that you always mark properties as _optional_ in `express$Request`\n+ and `express$Response` subclasses.\n+\n+ You may decide not to do this, in which case the typings will be unsound and\n+ the behavior will be similar to how arrays work in Flow. See here for more\n+ information: https://flow.org/en/docs/types/arrays/#toc-array-access-is-unsafe\n+\n+ See #3578 and #3337 for additional discussion. If you have ideas on how to\n+ improve these typings, please share them in #3578 or open a new issue.\n+\n+ **BAD**\n+ declare class test_express$CustomRequest extends express$Request {\n+ foo: string;\n+ }\n+\n+ **GOOD**\n+ declare class test_express$CustomRequest extends express$Request {\n+ foo: string | void;\n+ }\n+*/\ndeclare class express$Request extends http$IncomingMessage mixins express$RequestResponseBase {\nbaseUrl: string;\nbody: mixed;\n@@ -115,69 +139,77 @@ declare class express$Response extends http$ServerResponse mixins express$Reques\n}\ndeclare type express$NextFunction = (err?: ?Error | \"route\") => mixed;\n-declare type express$Middleware =\n- | ((\n- req: express$Request,\n- res: express$Response,\n- next: express$NextFunction\n- ) => mixed)\n- | ((\n- error: Error,\n- req: express$Request,\n- res: express$Response,\n- next: express$NextFunction\n- ) => mixed);\n-declare interface express$RouteMethodType<T> {\n- (middleware: express$Middleware): T;\n- (...middleware: Array<express$Middleware>): T;\n+declare type express$Middleware<\n+ Req: express$Request = express$Request,\n+ Res: express$Response = express$Response,\n+> =\n+ ((req: Req, res: Res, next: express$NextFunction) => mixed) |\n+ ((error: Error, req: Req, res: Res, next: express$NextFunction) => mixed);\n+\n+declare interface express$RouteMethodType<\n+ T,\n+ Req: express$Request = express$Request,\n+ Res: express$Response = express$Response,\n+> {\n+ (middleware: express$Middleware<Req, Res>): T;\n+ (...middleware: Array<express$Middleware<Req, Res>>): T;\n(\n- path: express$Path | express$Path[],\n- ...middleware: Array<express$Middleware>\n+ path: express$Path | $ReadOnlyArray<express$Path>,\n+ ...middleware: Array<express$Middleware<Req, Res>>\n): T;\n}\n-declare class express$Route {\n- all: express$RouteMethodType<this>;\n- get: express$RouteMethodType<this>;\n- post: express$RouteMethodType<this>;\n- put: express$RouteMethodType<this>;\n- head: express$RouteMethodType<this>;\n- delete: express$RouteMethodType<this>;\n- options: express$RouteMethodType<this>;\n- trace: express$RouteMethodType<this>;\n- copy: express$RouteMethodType<this>;\n- lock: express$RouteMethodType<this>;\n- mkcol: express$RouteMethodType<this>;\n- move: express$RouteMethodType<this>;\n- purge: express$RouteMethodType<this>;\n- propfind: express$RouteMethodType<this>;\n- proppatch: express$RouteMethodType<this>;\n- unlock: express$RouteMethodType<this>;\n- report: express$RouteMethodType<this>;\n- mkactivity: express$RouteMethodType<this>;\n- checkout: express$RouteMethodType<this>;\n- merge: express$RouteMethodType<this>;\n+\n+declare class express$Route<\n+ Req: express$Request = express$Request,\n+ Res: express$Response = express$Response,\n+> {\n+ all: express$RouteMethodType<this, Req, Res>;\n+ get: express$RouteMethodType<this, Req, Res>;\n+ post: express$RouteMethodType<this, Req, Res>;\n+ put: express$RouteMethodType<this, Req, Res>;\n+ head: express$RouteMethodType<this, Req, Res>;\n+ delete: express$RouteMethodType<this, Req, Res>;\n+ options: express$RouteMethodType<this, Req, Res>;\n+ trace: express$RouteMethodType<this, Req, Res>;\n+ copy: express$RouteMethodType<this, Req, Res>;\n+ lock: express$RouteMethodType<this, Req, Res>;\n+ mkcol: express$RouteMethodType<this, Req, Res>;\n+ move: express$RouteMethodType<this, Req, Res>;\n+ purge: express$RouteMethodType<this, Req, Res>;\n+ propfind: express$RouteMethodType<this, Req, Res>;\n+ proppatch: express$RouteMethodType<this, Req, Res>;\n+ unlock: express$RouteMethodType<this, Req, Res>;\n+ report: express$RouteMethodType<this, Req, Res>;\n+ mkactivity: express$RouteMethodType<this, Req, Res>;\n+ checkout: express$RouteMethodType<this, Req, Res>;\n+ merge: express$RouteMethodType<this, Req, Res>;\n// @TODO Missing 'm-search' but get flow illegal name error.\n- notify: express$RouteMethodType<this>;\n- subscribe: express$RouteMethodType<this>;\n- unsubscribe: express$RouteMethodType<this>;\n- patch: express$RouteMethodType<this>;\n- search: express$RouteMethodType<this>;\n- connect: express$RouteMethodType<this>;\n+ notify: express$RouteMethodType<this, Req, Res>;\n+ subscribe: express$RouteMethodType<this, Req, Res>;\n+ unsubscribe: express$RouteMethodType<this, Req, Res>;\n+ patch: express$RouteMethodType<this, Req, Res>;\n+ search: express$RouteMethodType<this, Req, Res>;\n+ connect: express$RouteMethodType<this, Req, Res>;\n}\n-declare class express$Router extends express$Route {\n+declare class express$Router<\n+ Req: express$Request = express$Request,\n+ Res: express$Response = express$Response,\n+> extends express$Route<Req, Res> {\nconstructor(options?: express$RouterOptions): void;\n- route(path: string): express$Route;\n- static (options?: express$RouterOptions): express$Router;\n- use(middleware: express$Middleware): this;\n- use(...middleware: Array<express$Middleware>): this;\n+ route(path: string): express$Route<Req, Res>;\n+ static <Req2: express$Request, Res2: express$Response>(\n+ options?: express$RouterOptions,\n+ ): express$Router<Req2, Res2>;\n+ use(middleware: express$Middleware<Req, Res>): this;\n+ use(...middleware: Array<express$Middleware<Req, Res>>): this;\nuse(\n- path: express$Path | express$Path[],\n- ...middleware: Array<express$Middleware>\n+ path: express$Path | $ReadOnlyArray<express$Path>,\n+ ...middleware: Array<express$Middleware<Req, Res>>\n): this;\n- use(path: string, router: express$Router): this;\n+ use(path: string, router: express$Router<Req, Res>): this;\nhandle(\nreq: http$IncomingMessage<>,\nres: http$ServerResponse,\n@@ -186,10 +218,11 @@ declare class express$Router extends express$Route {\nparam(\nparam: string,\ncallback: (\n- req: express$Request,\n- res: express$Response,\n+ req: Req,\n+ res: Res,\nnext: express$NextFunction,\n- id: string\n+ value: string,\n+ paramName: string,\n) => mixed\n): void;\n(\n@@ -207,7 +240,10 @@ To work around this issue, we changed Server to ?Server here, so that our invoca\nnot be deemed to lack type coverage.\n*/\n-declare class express$Application extends express$Router mixins events$EventEmitter {\n+declare class express$Application<\n+ Req: express$Request = express$Request,\n+ Res: express$Response = express$Response,\n+> extends express$Router<Req, Res> mixins events$EventEmitter {\nconstructor(): void;\nlocals: { [name: string]: mixed };\nmountpath: string;\n@@ -227,7 +263,7 @@ declare class express$Application extends express$Router mixins events$EventEmit\nlisten(handle: Object, callback?: (err?: ?Error) => mixed): ?http$Server;\ndisable(name: string): void;\ndisabled(name: string): boolean;\n- enable(name: string): express$Application;\n+ enable(name: string): this;\nenabled(name: string): boolean;\nengine(name: string, callback: Function): void;\n/**\n@@ -284,18 +320,27 @@ declare type express$UrlEncodedOptions = {\ndeclare module \"express\" {\ndeclare export type RouterOptions = express$RouterOptions;\ndeclare export type CookieOptions = express$CookieOptions;\n- declare export type Middleware = express$Middleware;\n+ declare export type Middleware<\n+ Req: express$Request = express$Request,\n+ Res: express$Response = express$Response,\n+ > = express$Middleware<Req, Res>;\ndeclare export type NextFunction = express$NextFunction;\ndeclare export type RequestParams = express$RequestParams;\ndeclare export type $Response = express$Response;\ndeclare export type $Request = express$Request;\n- declare export type $Application = express$Application;\n+ declare export type $Application<\n+ Req: express$Request = express$Request,\n+ Res: express$Response = express$Response,\n+ > = express$Application<Req, Res>;\ndeclare module.exports: {\n- (): express$Application, // If you try to call like a function, it will use this signature\n- json: (opts: ?JsonOptions) => express$Middleware,\n- static: (root: string, options?: Object) => express$Middleware, // `static` property on the function\n- Router: typeof express$Router, // `Router` property on the function\n- urlencoded: (opts: ?express$UrlEncodedOptions) => express$Middleware,\n+ // If you try to call like a function, it will use this signature\n+ <Req: express$Request, Res: express$Response>(): express$Application<Req, Res>,\n+ json: (opts: ?JsonOptions) => express$Middleware<>,\n+ // `static` property on the function\n+ static: <Req: express$Request, Res: express$Response>(root: string, options?: Object) => express$Middleware<Req, Res>,\n+ // `Router` property on the function\n+ Router: typeof express$Router,\n+ urlencoded: (opts: ?express$UrlEncodedOptions) => express$Middleware<>,\n};\n}\n" }, { "change_type": "MODIFY", "old_path": "server/package.json", "new_path": "server/package.json", "diff": "\"common-tags\": \"^1.7.2\",\n\"cookie-parser\": \"^1.4.3\",\n\"dateformat\": \"^3.0.3\",\n- \"express\": \"^4.16.2\",\n+ \"express\": \"^4.17.1\",\n\"express-ws\": \"^4.0.0\",\n\"firebase-admin\": \"^8.6.0\",\n\"geoip-lite\": \"^1.3.8\",\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -4670,7 +4670,7 @@ express-ws@^4.0.0:\ndependencies:\nws \"^5.2.0\"\n-express@^4.16.2, express@^4.17.1:\n+express@^4.17.1:\nversion \"4.17.1\"\nresolved \"https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134\"\nintegrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Update express libdefs
129,187
06.10.2019 22:38:25
14,400
72c3e1027b2582440ae54cfbb3eee7fecaf23f38
[native] Update devtools usage Don't need explicit packages anymore
[ { "change_type": "DELETE", "old_path": "native/flow-typed/npm/react-devtools_vx.x.x.js", "new_path": null, "diff": "-// flow-typed signature: 066685947eacc7b27d4ad752bb55a030\n-// flow-typed version: <<STUB>>/react-devtools_v^3.0.0/flow_v0.98.0\n-\n-/**\n- * This is an autogenerated libdef stub for:\n- *\n- * 'react-devtools'\n- *\n- * Fill this stub out by replacing all the `any` types.\n- *\n- * Once filled out, we encourage you to share your work with the\n- * community by sending a pull request to:\n- * https://github.com/flowtype/flow-typed\n- */\n-\n-declare module 'react-devtools' {\n- declare module.exports: any;\n-}\n-\n-/**\n- * We include stubs for each file inside this npm package in case you need to\n- * require those files directly. Feel free to delete any files that aren't\n- * needed.\n- */\n-declare module 'react-devtools/app' {\n- declare module.exports: any;\n-}\n-\n-declare module 'react-devtools/bin' {\n- declare module.exports: any;\n-}\n-\n-// Filename aliases\n-declare module 'react-devtools/app.js' {\n- declare module.exports: $Exports<'react-devtools/app'>;\n-}\n-declare module 'react-devtools/bin.js' {\n- declare module.exports: $Exports<'react-devtools/bin'>;\n-}\n-declare module 'react-devtools/index' {\n- declare module.exports: $Exports<'react-devtools'>;\n-}\n-declare module 'react-devtools/index.js' {\n- declare module.exports: $Exports<'react-devtools'>;\n-}\n" }, { "change_type": "DELETE", "old_path": "native/flow-typed/npm/redux-devtools-extension_v2.x.x.js", "new_path": null, "diff": "-// flow-typed signature: dde9329b5d39c60765e23c080dc5d018\n-// flow-typed version: 9931c6ffb0/redux-devtools-extension_v2.x.x/flow_>=v0.47.x <=v0.103.x\n-\n-import type { ActionCreator, StoreEnhancer } from 'redux';\n-import typeof { compose } from 'redux';\n-\n-declare type $npm$ReduxDevtoolsExtension$DevToolsOptions = {\n- name?: string,\n- actionCreators?: Array<ActionCreator<any>> | { [string]: ActionCreator<any> },\n- latency?: number,\n- maxAge?: number,\n- serialize?: boolean | {\n- date?: boolean;\n- regex?: boolean;\n- undefined?: boolean;\n- error?: boolean;\n- symbol?: boolean;\n- map?: boolean;\n- set?: boolean;\n- function?: boolean | Function;\n- },\n- actionSanitizer?: <A: { type: string }>(action: A, id: number) => A,\n- stateSanitizer?: <S>(state: S, index: number) => S,\n- actionsBlacklist?: string | string[],\n- actionsWhitelist?: string | string[],\n- predicate?: <S, A: { type: string }>(state: S, action: A) => boolean,\n- shouldRecordChanges?: boolean,\n- pauseActionType?: string,\n- autoPause?: boolean,\n- shouldStartLocked?: boolean,\n- shouldHotReload?: boolean,\n- shouldCatchErrors?: boolean,\n- features?: {\n- pause?: boolean,\n- lock?: boolean,\n- persist?: boolean,\n- export?: boolean | \"custom\",\n- import?: boolean | \"custom\",\n- jump?: boolean,\n- skip?: boolean,\n- reorder?: boolean,\n- dispatch?: boolean,\n- test?: boolean\n- }\n-};\n-\n-declare function $npm$ReduxDevtoolsExtension$composeWithDevTools<A, B>(ab: A => B): A => B;\n-declare function $npm$ReduxDevtoolsExtension$composeWithDevTools(options: $npm$ReduxDevtoolsExtension$DevToolsOptions): compose;\n-declare function $npm$ReduxDevtoolsExtension$composeWithDevTools<A, B, C>(\n- bc: B => C,\n- ab: A => B\n-): A => C;\n-declare function $npm$ReduxDevtoolsExtension$composeWithDevTools<A, B, C, D>(\n- cd: C => D,\n- bc: B => C,\n- ab: A => B\n-): A => D;\n-declare function $npm$ReduxDevtoolsExtension$composeWithDevTools<A, B, C, D, E>(\n- de: D => E,\n- cd: C => D,\n- bc: B => C,\n- ab: A => B\n-): A => E;\n-declare function $npm$ReduxDevtoolsExtension$composeWithDevTools<A, B, C, D, E, F>(\n- ef: E => F,\n- de: D => E,\n- cd: C => D,\n- bc: B => C,\n- ab: A => B\n-): A => F;\n-declare function $npm$ReduxDevtoolsExtension$composeWithDevTools<A, B, C, D, E, F, G>(\n- fg: F => G,\n- ef: E => F,\n- de: D => E,\n- cd: C => D,\n- bc: B => C,\n- ab: A => B\n-): A => G;\n-declare function $npm$ReduxDevtoolsExtension$composeWithDevTools<A, B, C, D, E, F, G, H>(\n- gh: G => H,\n- fg: F => G,\n- ef: E => F,\n- de: D => E,\n- cd: C => D,\n- bc: B => C,\n- ab: A => B\n-): A => H;\n-declare function $npm$ReduxDevtoolsExtension$composeWithDevTools<A, B, C, D, E, F, G, H, I>(\n- hi: H => I,\n- gh: G => H,\n- fg: F => G,\n- ef: E => F,\n- de: D => E,\n- cd: C => D,\n- bc: B => C,\n- ab: A => B\n-): A => H;\n-\n-declare function $npm$ReduxDevtoolsExtension$devToolsEnhancer<S, A>(options?: $npm$ReduxDevtoolsExtension$DevToolsOptions): StoreEnhancer<S, A>;\n-\n-declare module 'redux-devtools-extension' {\n- declare export type DevToolsOptions = $npm$ReduxDevtoolsExtension$DevToolsOptions;\n-\n- declare export var composeWithDevTools: typeof $npm$ReduxDevtoolsExtension$composeWithDevTools;\n- declare export var devToolsEnhancer: typeof $npm$ReduxDevtoolsExtension$devToolsEnhancer;\n-}\n-\n-declare module 'redux-devtools-extension/developmentOnly' {\n- declare export type DevToolsOptions = $npm$ReduxDevtoolsExtension$DevToolsOptions;\n-\n- declare export var composeWithDevTools: typeof $npm$ReduxDevtoolsExtension$composeWithDevTools;\n- declare export var devToolsEnhancer: typeof $npm$ReduxDevtoolsExtension$devToolsEnhancer;\n-}\n-\n-declare module 'redux-devtools-extension/logOnly' {\n- declare export type DevToolsOptions = $npm$ReduxDevtoolsExtension$DevToolsOptions;\n-\n- declare export var composeWithDevTools: typeof $npm$ReduxDevtoolsExtension$composeWithDevTools;\n- declare export var devToolsEnhancer: typeof $npm$ReduxDevtoolsExtension$devToolsEnhancer;\n-}\n-\n-declare module 'redux-devtools-extension/logOnlyInProduction' {\n- declare export type DevToolsOptions = $npm$ReduxDevtoolsExtension$DevToolsOptions;\n-\n- declare export var composeWithDevTools: typeof $npm$ReduxDevtoolsExtension$composeWithDevTools;\n- declare export var devToolsEnhancer: typeof $npm$ReduxDevtoolsExtension$devToolsEnhancer;\n-}\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"start\": \"react-native start\",\n\"test\": \"jest\",\n\"lint\": \"eslint .\",\n- \"devtools\": \"react-devtools\",\n\"logfirebase\": \"adb shell logcat | grep -E -i 'FIRMessagingModule|firebase'\"\n},\n\"dependencies\": {\n\"reactotron-react-native\": \"4.0.0-beta.1\",\n\"reactotron-redux\": \"^3.1.1\",\n\"redux\": \"^4.0.4\",\n- \"redux-devtools-extension\": \"^2.13.2\",\n\"redux-persist\": \"^5.4.0\",\n\"redux-thunk\": \"^2.2.0\",\n\"reselect\": \"^4.0.0\",\n\"jetifier\": \"^1.6.4\",\n\"metro-react-native-babel-preset\": \"^0.56.0\",\n\"postinstall-postinstall\": \"^2.0.0\",\n- \"react-devtools\": \"^3.0.0\",\n\"react-test-renderer\": \"16.8.6\"\n},\n\"jest\": {\n" }, { "change_type": "MODIFY", "old_path": "native/redux/redux-setup.js", "new_path": "native/redux/redux-setup.js", "diff": "@@ -38,8 +38,8 @@ import {\ncreateStore,\napplyMiddleware,\ntype Store,\n+ compose,\n} from 'redux';\n-import { composeWithDevTools } from 'redux-devtools-extension';\nimport { persistStore, persistReducer, REHYDRATE } from 'redux-persist';\nimport PropTypes from 'prop-types';\nimport {\n@@ -403,19 +403,21 @@ function appBecameInactive() {\nappLastBecameInactive = Date.now();\n}\n-let enhancers;\n-const reactNavigationMiddleware = createReactNavigationReduxMiddleware(\n+const middleware = applyMiddleware(\n+ thunk,\n+ createReactNavigationReduxMiddleware(\n(state: AppState) => state.navInfo.navigationState,\n+ ),\n+ reduxLoggerMiddleware,\n);\n+const composeFunc = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\n+ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\n+ : compose;\n+let enhancers;\nif (reactotron) {\n- enhancers = composeWithDevTools(\n- applyMiddleware(thunk, reactNavigationMiddleware, reduxLoggerMiddleware),\n- reactotron.createEnhancer(),\n- );\n+ enhancers = composeFunc(middleware, reactotron.createEnhancer());\n} else {\n- enhancers = composeWithDevTools(\n- applyMiddleware(thunk, reactNavigationMiddleware, reduxLoggerMiddleware),\n- );\n+ enhancers = composeFunc(middleware);\n}\nconst store: Store<AppState, *> = createStore(\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Update devtools usage Don't need explicit packages anymore
129,187
06.10.2019 23:41:21
14,400
9aac94abae1ca900656ee6256038d81f85f2ed1a
[web] Get rid of react-text-truncate Haven't actually been using this in forever
[ { "change_type": "DELETE", "old_path": "web/flow-typed/npm/react-text-truncate_vx.x.x.js", "new_path": null, "diff": "-// flow-typed signature: a336c479daf12a511637d13f3b9ca936\n-// flow-typed version: <<STUB>>/react-text-truncate_v^0.10.2/flow_v0.98.0\n-\n-/**\n- * This is an autogenerated libdef stub for:\n- *\n- * 'react-text-truncate'\n- *\n- * Fill this stub out by replacing all the `any` types.\n- *\n- * Once filled out, we encourage you to share your work with the\n- * community by sending a pull request to:\n- * https://github.com/flowtype/flow-typed\n- */\n-\n-declare module 'react-text-truncate' {\n- declare module.exports: any;\n-}\n-\n-/**\n- * We include stubs for each file inside this npm package in case you need to\n- * require those files directly. Feel free to delete any files that aren't\n- * needed.\n- */\n-declare module 'react-text-truncate/lib/index' {\n- declare module.exports: any;\n-}\n-\n-declare module 'react-text-truncate/server' {\n- declare module.exports: any;\n-}\n-\n-declare module 'react-text-truncate/src/App' {\n- declare module.exports: any;\n-}\n-\n-declare module 'react-text-truncate/src/index' {\n- declare module.exports: any;\n-}\n-\n-declare module 'react-text-truncate/src/TextTruncate' {\n- declare module.exports: any;\n-}\n-\n-declare module 'react-text-truncate/webpack.config.dev' {\n- declare module.exports: any;\n-}\n-\n-declare module 'react-text-truncate/webpack.config' {\n- declare module.exports: any;\n-}\n-\n-// Filename aliases\n-declare module 'react-text-truncate/lib/index.js' {\n- declare module.exports: $Exports<'react-text-truncate/lib/index'>;\n-}\n-declare module 'react-text-truncate/server.js' {\n- declare module.exports: $Exports<'react-text-truncate/server'>;\n-}\n-declare module 'react-text-truncate/src/App.js' {\n- declare module.exports: $Exports<'react-text-truncate/src/App'>;\n-}\n-declare module 'react-text-truncate/src/index.js' {\n- declare module.exports: $Exports<'react-text-truncate/src/index'>;\n-}\n-declare module 'react-text-truncate/src/TextTruncate.js' {\n- declare module.exports: $Exports<'react-text-truncate/src/TextTruncate'>;\n-}\n-declare module 'react-text-truncate/webpack.config.dev.js' {\n- declare module.exports: $Exports<'react-text-truncate/webpack.config.dev'>;\n-}\n-declare module 'react-text-truncate/webpack.config.js' {\n- declare module.exports: $Exports<'react-text-truncate/webpack.config'>;\n-}\n" }, { "change_type": "MODIFY", "old_path": "web/package.json", "new_path": "web/package.json", "diff": "\"react-router\": \"^5.1.2\",\n\"react-router-dom\": \"^5.1.2\",\n\"react-switch\": \"^2.3.2\",\n- \"react-text-truncate\": \"^0.10.2\",\n\"react-timeago\": \"^3.4.3\",\n\"redux\": \"^4.0.4\",\n\"redux-devtools-extension\": \"^2.13.2\",\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -10312,13 +10312,6 @@ react-test-renderer@16.8.6:\nreact-is \"^16.8.6\"\nscheduler \"^0.13.6\"\n-react-text-truncate@^0.10.2:\n- version \"0.10.4\"\n- resolved \"https://registry.yarnpkg.com/react-text-truncate/-/react-text-truncate-0.10.4.tgz#f34f2f64666f61e26d00fda8d52325ef75e729aa\"\n- integrity sha1-808vZGZvYeJtAP2o1SMl73XnKao=\n- dependencies:\n- prop-types \"^15.5.7\"\n-\nreact-timeago@^3.4.3:\nversion \"3.4.3\"\nresolved \"https://registry.yarnpkg.com/react-timeago/-/react-timeago-3.4.3.tgz#eb9061eefb044e4a2b09ce8c99d34645b2dbfa25\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[web] Get rid of react-text-truncate Haven't actually been using this in forever
129,187
07.10.2019 00:07:38
14,400
41cf8544d0bd5834119d83c8d263cf507abbba3a
Fix yarn dev 1. `native`: Add `yarn dev` (used to be `yarn start`) 2. `server`: Run `rsync` once on `yarn dev` start 3. `server`: Create `dist` dir after `cleaninstall` so that `nodemon` picks up changes when they occur
[ { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"private\": true,\n\"scripts\": {\n\"postinstall\": \"node link-workspaces.js && cd ../ && patch-package && npx flow-mono create-symlinks native/.flowconfig && cd native && npx jetify\",\n- \"start\": \"react-native start\",\n+ \"dev\": \"react-native start\",\n\"test\": \"jest\",\n\"lint\": \"eslint .\",\n\"logfirebase\": \"adb shell logcat | grep -E -i 'FIRMessagingModule|firebase'\"\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"postinstall-postinstall\": \"^2.0.0\"\n},\n\"scripts\": {\n- \"clean\": \"rm -rf node_modules/ && rm -rf lib/node_modules/ && rm -rf web/node_modules/ && rm -rf native/node_modules/ && rm -rf server/node_modules/ && rm -rf web/dist/ && rm -rf server/dist/ && rm -rf native/ios/Pods\",\n+ \"clean\": \"rm -rf node_modules/ && rm -rf lib/node_modules/ && rm -rf web/node_modules/ && rm -rf native/node_modules/ && rm -rf server/node_modules/ && rm -rf web/dist/ && rm -rf server/dist/ && mkdir server/dist && rm -rf native/ios/Pods\",\n\"cleaninstall\": \"npm run clean && yarn && cd native/ios && (pod install || true)\",\n\"postinstall\": \"patch-package\"\n}\n" }, { "change_type": "MODIFY", "old_path": "server/package.json", "new_path": "server/package.json", "diff": "\"prod-build\": \"npm run babel && npm run rsync && npm run update-geoip\",\n\"update-geoip\": \"cd ../node_modules/geoip-lite && npm run updatedb\",\n\"prod\": \"node --experimental-modules --loader ./loader.mjs --es-module-specifier-resolution node dist/server\",\n- \"dev-rsync\": \"chokidar -s 'src/**/*.json' 'src/**/*.build.js' -c 'npm run rsync' > /dev/null 2>&1\",\n+ \"dev-rsync\": \"chokidar --initial -s 'src/**/*.json' 'src/**/*.build.js' -c 'npm run rsync' > /dev/null 2>&1\",\n\"dev\": \"NODE_ENV=dev concurrently --names=\\\"BABEL,RSYNC,NODEM\\\" -c \\\"bgBlue.bold,bgMagenta.bold,bgGreen.bold\\\" \\\"npm run babel -- --watch\\\" \\\"npm run dev-rsync\\\" \\\"nodemon -e js,json --watch dist --experimental-modules --loader ./loader.mjs --es-module-specifier-resolution node dist/server\\\"\",\n\"script\": \"node --experimental-modules --loader ./loader.mjs\"\n},\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Fix yarn dev 1. `native`: Add `yarn dev` (used to be `yarn start`) 2. `server`: Run `rsync` once on `yarn dev` start 3. `server`: Create `dist` dir after `cleaninstall` so that `nodemon` picks up changes when they occur
129,187
07.10.2019 10:47:17
14,400
12163e406094ea0e8924a4ac5d76ab596db3f030
[server] Update express from flow-typed
[ { "change_type": "MODIFY", "old_path": "server/flow-typed/npm/cookie-parser_v1.x.x.js", "new_path": "server/flow-typed/npm/cookie-parser_v1.x.x.js", "diff": "+// flow-typed signature: 4b0c9d45a87420675a90e7f1239da4e3\n+// flow-typed version: 2f514ea8dd/cookie-parser_v1.x.x/flow_>=v0.93.x <=v0.103.x\n+\n/**\n* Flow libdef for 'cookie-parser'\n* See https://www.npmjs.com/package/cookie-parser\n" }, { "change_type": "MODIFY", "old_path": "server/flow-typed/npm/express_v4.17.x.js", "new_path": "server/flow-typed/npm/express_v4.17.x.js", "diff": "+// flow-typed signature: 4a2e9d8f7d4830b8f23ef5921e97806d\n+// flow-typed version: 2f514ea8dd/express_v4.17.x/flow_>=v0.94.x <=v0.103.x\n+\ndeclare type express$RouterOptions = {\ncaseSensitive?: boolean,\nmergeParams?: boolean,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Update express from flow-typed
129,187
08.10.2019 02:58:56
14,400
b8d2329a0a96509fa3f0bf8a65e7de5d9f43ef89
app.build.js -> app.build.cjs Otherwise Node 12.11 complains that it has `require` statements
[ { "change_type": "MODIFY", "old_path": "server/loader.mjs", "new_path": "server/loader.mjs", "diff": "@@ -18,17 +18,7 @@ export async function resolve(\nspecifier,\n`server/dist/${specifier}`,\n);\n-\n- let format;\n- if (url.search(/json(:[0-9]+)?$/) !== -1) {\n- format = 'json';\n- } else if (specifier === 'web/dist/app.build') {\n- format = 'commonjs';\n- } else {\n- format = 'module';\n- }\n-\n- return { url, format };\n+ return { url, format: defaultResult.format };\n}\n// We prefer to resolve packages as modules so that Node allows us to do\n" }, { "change_type": "MODIFY", "old_path": "server/package.json", "new_path": "server/package.json", "diff": "\"description\": \"\",\n\"main\": \"dist/server\",\n\"scripts\": {\n- \"babel\": \"babel src/ --out-dir dist/ --config-file ./.babelrc --verbose --ignore 'src/lib/flow-typed','src/lib/node_modules','src/lib/package.json','src/web/flow-typed','src/web/node_modules','src/web/package.json','src/web/dist/*.build.js','src/web/webpack.config.js','src/web/account-bar.react.js','src/web/app.react.js','src/web/calendar','src/web/chat','src/web/flow','src/web/loading-indicator.react.js','src/web/modals','src/web/root.js','src/web/router-history.js','src/web/script.js','src/web/selectors/chat-selectors.js','src/web/selectors/entry-selectors.js','src/web/splash','src/web/vector-utils.js','src/web/vectors.react.js'\",\n- \"rsync\": \"rsync -rLpmuv --exclude '*/package.json' --exclude '*/node_modules/*' --include '*.json' --include 'app.build.js' --exclude '*.*' src/ dist/\",\n+ \"babel\": \"babel src/ --out-dir dist/ --config-file ./.babelrc --verbose --ignore 'src/lib/flow-typed','src/lib/node_modules','src/lib/package.json','src/web/flow-typed','src/web/node_modules','src/web/package.json','src/web/dist','src/web/webpack.config.js','src/web/account-bar.react.js','src/web/app.react.js','src/web/calendar','src/web/chat','src/web/flow','src/web/loading-indicator.react.js','src/web/modals','src/web/root.js','src/web/router-history.js','src/web/script.js','src/web/selectors/chat-selectors.js','src/web/selectors/entry-selectors.js','src/web/splash','src/web/vector-utils.js','src/web/vectors.react.js'\",\n+ \"rsync\": \"rsync -rLpmuv --exclude '*/package.json' --exclude '*/node_modules/*' --include '*.json' --include '*.cjs' --exclude '*.*' src/ dist/\",\n\"prod-build\": \"npm run babel && npm run rsync && npm run update-geoip\",\n\"update-geoip\": \"cd ../node_modules/geoip-lite && npm run updatedb\",\n\"prod\": \"node --experimental-modules --loader ./loader.mjs --es-module-specifier-resolution node dist/server\",\n" }, { "change_type": "MODIFY", "old_path": "server/src/responders/website-responders.js", "new_path": "server/src/responders/website-responders.js", "diff": "@@ -31,7 +31,7 @@ import { threadHasPermission } from 'lib/shared/thread-utils';\nimport 'web/server-rendering';\nimport * as ReduxSetup from 'web/redux-setup';\n-import App from 'web/dist/app.build';\n+import App from 'web/dist/app.build.cjs';\nimport { navInfoFromURL } from 'web/url-utils';\nimport { activeThreadFromNavInfo } from 'web/selectors/nav-selectors';\n" }, { "change_type": "MODIFY", "old_path": "web/webpack.config.js", "new_path": "web/webpack.config.js", "diff": "@@ -231,7 +231,7 @@ module.exports = function(env) {\nserver: [ './server-rendering.js', './app.react.js' ],\n},\noutput: {\n- filename: 'app.build.js',\n+ filename: 'app.build.cjs',\nlibrary: 'app',\nlibraryTarget: 'commonjs2',\npath: path.join(__dirname, 'dist'),\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
app.build.js -> app.build.cjs Otherwise Node 12.11 complains that it has `require` statements
129,187
08.10.2019 15:20:58
14,400
b97a1cf1640ff68cccadf658eda9ed9920d31ab9
[native] codeVersion -> 35 Won't release this one to the people. Just for long-term internal testing
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -131,8 +131,8 @@ android {\napplicationId \"org.squadcal\"\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 33\n- versionName \"0.0.33\"\n+ versionCode 35\n+ versionName \"0.0.35\"\n}\nsplits {\nabi {\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal/Info.debug.plist", "new_path": "native/ios/SquadCal/Info.debug.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.34</string>\n+ <string>0.0.35</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>34</string>\n+ <string>35</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal/Info.release.plist", "new_path": "native/ios/SquadCal/Info.release.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.34</string>\n+ <string>0.0.35</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>34</string>\n+ <string>35</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/redux/persist.js", "new_path": "native/redux/persist.js", "diff": "@@ -142,7 +142,7 @@ const persistConfig = {\nmigrate: createMigrate(migrations, { debug: __DEV__ }),\n};\n-const codeVersion = 34;\n+const codeVersion = 35;\n// This local exists to avoid a circular dependency where redux-setup needs to\n// import all the navigation and screen stuff, but some of those screens want to\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] codeVersion -> 35 Won't release this one to the people. Just for long-term internal testing
129,187
08.10.2019 16:29:24
14,400
fac387f01cc3746426eeaf277e0f624a28862232
[server] Fix server dev environment for new app.build.cjs file
[ { "change_type": "MODIFY", "old_path": "server/package.json", "new_path": "server/package.json", "diff": "\"prod-build\": \"npm run babel && npm run rsync && npm run update-geoip\",\n\"update-geoip\": \"cd ../node_modules/geoip-lite && npm run updatedb\",\n\"prod\": \"node --experimental-modules --loader ./loader.mjs --es-module-specifier-resolution node dist/server\",\n- \"dev-rsync\": \"chokidar --initial -s 'src/**/*.json' 'src/**/*.build.js' -c 'npm run rsync' > /dev/null 2>&1\",\n- \"dev\": \"NODE_ENV=dev concurrently --names=\\\"BABEL,RSYNC,NODEM\\\" -c \\\"bgBlue.bold,bgMagenta.bold,bgGreen.bold\\\" \\\"npm run babel -- --watch\\\" \\\"npm run dev-rsync\\\" \\\"nodemon -e js,json --watch dist --experimental-modules --loader ./loader.mjs --es-module-specifier-resolution node dist/server\\\"\",\n+ \"dev-rsync\": \"chokidar --initial --silent -s 'src/**/*.json' 'src/**/*.cjs' -c 'npm run rsync > /dev/null 2>&1'\",\n+ \"dev\": \"NODE_ENV=dev concurrently --names=\\\"BABEL,RSYNC,NODEM\\\" -c \\\"bgBlue.bold,bgMagenta.bold,bgGreen.bold\\\" \\\"npm run babel -- --watch\\\" \\\"npm run dev-rsync\\\" \\\"nodemon -e js,json,cjs --watch dist --experimental-modules --loader ./loader.mjs --es-module-specifier-resolution node dist/server\\\"\",\n\"script\": \"node --experimental-modules --loader ./loader.mjs\"\n},\n\"author\": \"\",\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Fix server dev environment for new app.build.cjs file
129,187
08.10.2019 17:22:57
14,400
4e2563e1583767a95508dd8822845ee25ba733ce
[web] Fix Request Access scrolling in Splash
[ { "change_type": "MODIFY", "old_path": "web/splash/splash.react.js", "new_path": "web/splash/splash.react.js", "diff": "@@ -51,6 +51,7 @@ class Splash extends React.PureComponent<Props, State> {\nrequestAccess: PropTypes.func.isRequired,\n};\nemailInput: ?HTMLInputElement;\n+ bottomContainer: ?HTMLDivElement;\nstate = {\nplatform: \"ios\",\nemail: \"\",\n@@ -148,7 +149,7 @@ class Splash extends React.PureComponent<Props, State> {\n</div>\n</div>\n</div>\n- <div className={css.bottomContainer}>\n+ <div className={css.bottomContainer} ref={this.bottomContainerRef}>\n<div className={css.bottom}>\n<div className={css.headerRest}>\n<div className={css.prompt}>\n@@ -199,6 +200,10 @@ class Splash extends React.PureComponent<Props, State> {\n);\n}\n+ bottomContainerRef = (bottomContainer: ?HTMLDivElement) => {\n+ this.bottomContainer = bottomContainer;\n+ }\n+\nemailInputRef = (emailInput: ?HTMLInputElement) => {\nthis.emailInput = emailInput;\n}\n@@ -218,17 +223,19 @@ class Splash extends React.PureComponent<Props, State> {\nonClickRequestAccess = (event: SyntheticEvent<HTMLAnchorElement>) => {\nevent.preventDefault();\n- if (this.emailInput) {\n- this.emailInput.focus();\n- }\n+ const { bottomContainer } = this;\n+ invariant(bottomContainer, \"bottomContainer should exist\");\nconst formHeight = 180;\nconst contentHeight = 790;\nconst guaranteesSpace = contentHeight - window.innerHeight + formHeight;\n- if (window.scrollY >= guaranteesSpace) {\n+ if (bottomContainer.scrollTop >= guaranteesSpace) {\nreturn;\n}\nconst defaultScrollHeight = 390;\n- window.scrollTo({ top: Math.max(defaultScrollHeight, guaranteesSpace) });\n+ bottomContainer.scrollTo({ top: Math.max(defaultScrollHeight, guaranteesSpace) });\n+ if (this.emailInput) {\n+ this.emailInput.focus();\n+ }\n}\nonSubmitRequestAccess = (event: SyntheticEvent<HTMLInputElement>) => {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[web] Fix Request Access scrolling in Splash
129,187
08.10.2019 17:46:35
14,400
8c215c86f715cbe4dc1992dda4dfe7ae4e02c454
[native] Fix up some components for iOS dark mode
[ { "change_type": "MODIFY", "old_path": "native/account/modal-components.react.js", "new_path": "native/account/modal-components.react.js", "diff": "@@ -55,6 +55,7 @@ const styles = StyleSheet.create({\nfontSize: 20,\npadding: 0,\nmargin: 0,\n+ color: 'black',\n},\n});\n" }, { "change_type": "MODIFY", "old_path": "native/app.react.js", "new_path": "native/app.react.js", "diff": "@@ -623,7 +623,7 @@ class AppWithNavigationState extends React.PureComponent<Props> {\nstate={this.props.navigationState}\ndispatch={this.props.dispatch}\n/>\n- <ConnectedStatusBar />\n+ <ConnectedStatusBar barStyle=\"dark-content\" />\n<DisconnectedBarVisibilityHandler />\n<DimensionsUpdater />\n<ConnectivityUpdater />\n" }, { "change_type": "ADD", "old_path": null, "new_path": "patches/react-native+0.60.6.patch", "diff": "+diff --git a/node_modules/react-native/React/Modules/RCTStatusBarManager.m b/node_modules/react-native/React/Modules/RCTStatusBarManager.m\n+index 9b6f9d6..d15fd73 100644\n+--- a/node_modules/react-native/React/Modules/RCTStatusBarManager.m\n++++ b/node_modules/react-native/React/Modules/RCTStatusBarManager.m\n+@@ -14,17 +14,44 @@\n+ #if !TARGET_OS_TV\n+ @implementation RCTConvert (UIStatusBar)\n+\n+-RCT_ENUM_CONVERTER(UIStatusBarStyle, (@{\n+- @\"default\": @(UIStatusBarStyleDefault),\n+- @\"light-content\": @(UIStatusBarStyleLightContent),\n+- @\"dark-content\": @(UIStatusBarStyleDefault),\n+-}), UIStatusBarStyleDefault, integerValue);\n+-\n+-RCT_ENUM_CONVERTER(UIStatusBarAnimation, (@{\n+- @\"none\": @(UIStatusBarAnimationNone),\n+- @\"fade\": @(UIStatusBarAnimationFade),\n+- @\"slide\": @(UIStatusBarAnimationSlide),\n+-}), UIStatusBarAnimationNone, integerValue);\n+++ (UIStatusBarStyle)UIStatusBarStyle:(id)json RCT_DYNAMIC\n++{\n++ static NSDictionary *mapping;\n++ static dispatch_once_t onceToken;\n++ dispatch_once(&onceToken, ^{\n++ if (@available(iOS 13.0, *)) {\n++ mapping = @{\n++ @\"default\" : @(UIStatusBarStyleDefault),\n++ @\"light-content\" : @(UIStatusBarStyleLightContent),\n++#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \\\n++ __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0\n++ @\"dark-content\" : @(UIStatusBarStyleDarkContent)\n++#else\n++ @\"dark-content\": @(UIStatusBarStyleDefault)\n++#endif\n++ };\n++\n++ } else {\n++ mapping = @{\n++ @\"default\" : @(UIStatusBarStyleDefault),\n++ @\"light-content\" : @(UIStatusBarStyleLightContent),\n++ @\"dark-content\" : @(UIStatusBarStyleDefault)\n++ };\n++ }\n++ });\n++ return _RCT_CAST(\n++ type, [RCTConvertEnumValue(\"UIStatusBarStyle\", mapping, @(UIStatusBarStyleDefault), json) integerValue]);\n++}\n++\n++RCT_ENUM_CONVERTER(\n++ UIStatusBarAnimation,\n++ (@{\n++ @\"none\" : @(UIStatusBarAnimationNone),\n++ @\"fade\" : @(UIStatusBarAnimationFade),\n++ @\"slide\" : @(UIStatusBarAnimationSlide),\n++ }),\n++ UIStatusBarAnimationNone,\n++ integerValue);\n+\n+ @end\n+ #endif\n+@@ -36,8 +63,9 @@ static BOOL RCTViewControllerBasedStatusBarAppearance()\n+ static BOOL value;\n+ static dispatch_once_t onceToken;\n+ dispatch_once(&onceToken, ^{\n+- value = [[[NSBundle mainBundle] objectForInfoDictionaryKey:\n+- @\"UIViewControllerBasedStatusBarAppearance\"] ?: @YES boolValue];\n++ value =\n++ [[[NSBundle mainBundle] objectForInfoDictionaryKey:@\"UIViewControllerBasedStatusBarAppearance\"]\n++ ?: @YES boolValue];\n+ });\n+\n+ return value;\n+@@ -47,8 +75,7 @@ static BOOL RCTViewControllerBasedStatusBarAppearance()\n+\n+ - (NSArray<NSString *> *)supportedEvents\n+ {\n+- return @[@\"statusBarFrameDidChange\",\n+- @\"statusBarFrameWillChange\"];\n++ return @[ @\"statusBarFrameDidChange\", @\"statusBarFrameWillChange\" ];\n+ }\n+\n+ #if !TARGET_OS_TV\n+@@ -56,8 +83,14 @@ static BOOL RCTViewControllerBasedStatusBarAppearance()\n+ - (void)startObserving\n+ {\n+ NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];\n+- [nc addObserver:self selector:@selector(applicationDidChangeStatusBarFrame:) name:UIApplicationDidChangeStatusBarFrameNotification object:nil];\n+- [nc addObserver:self selector:@selector(applicationWillChangeStatusBarFrame:) name:UIApplicationWillChangeStatusBarFrameNotification object:nil];\n++ [nc addObserver:self\n++ selector:@selector(applicationDidChangeStatusBarFrame:)\n++ name:UIApplicationDidChangeStatusBarFrameNotification\n++ object:nil];\n++ [nc addObserver:self\n++ selector:@selector(applicationWillChangeStatusBarFrame:)\n++ name:UIApplicationWillChangeStatusBarFrameNotification\n++ object:nil];\n+ }\n+\n+ - (void)stopObserving\n+@@ -74,11 +107,11 @@ - (void)emitEvent:(NSString *)eventName forNotification:(NSNotification *)notifi\n+ {\n+ CGRect frame = [notification.userInfo[UIApplicationStatusBarFrameUserInfoKey] CGRectValue];\n+ NSDictionary *event = @{\n+- @\"frame\": @{\n+- @\"x\": @(frame.origin.x),\n+- @\"y\": @(frame.origin.y),\n+- @\"width\": @(frame.size.width),\n+- @\"height\": @(frame.size.height),\n++ @\"frame\" : @{\n++ @\"x\" : @(frame.origin.x),\n++ @\"y\" : @(frame.origin.y),\n++ @\"width\" : @(frame.size.width),\n++ @\"height\" : @(frame.size.height),\n+ },\n+ };\n+ [self sendEventWithName:eventName body:event];\n+@@ -94,15 +127,14 @@ - (void)applicationWillChangeStatusBarFrame:(NSNotification *)notification\n+ [self emitEvent:@\"statusBarFrameWillChange\" forNotification:notification];\n+ }\n+\n+-RCT_EXPORT_METHOD(getHeight:(RCTResponseSenderBlock)callback)\n++RCT_EXPORT_METHOD(getHeight : (RCTResponseSenderBlock)callback)\n+ {\n+- callback(@[@{\n+- @\"height\": @(RCTSharedApplication().statusBarFrame.size.height),\n+- }]);\n++ callback(@[ @{\n++ @\"height\" : @(RCTSharedApplication().statusBarFrame.size.height),\n++ } ]);\n+ }\n+\n+-RCT_EXPORT_METHOD(setStyle:(UIStatusBarStyle)statusBarStyle\n+- animated:(BOOL)animated)\n++RCT_EXPORT_METHOD(setStyle : (UIStatusBarStyle)statusBarStyle animated : (BOOL)animated)\n+ {\n+ if (RCTViewControllerBasedStatusBarAppearance()) {\n+ RCTLogError(@\"RCTStatusBarManager module requires that the \\\n+@@ -110,14 +142,12 @@ - (void)applicationWillChangeStatusBarFrame:(NSNotification *)notification\n+ } else {\n+ #pragma clang diagnostic push\n+ #pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n+- [RCTSharedApplication() setStatusBarStyle:statusBarStyle\n+- animated:animated];\n++ [RCTSharedApplication() setStatusBarStyle:statusBarStyle animated:animated];\n+ }\n+ #pragma clang diagnostic pop\n+ }\n+\n+-RCT_EXPORT_METHOD(setHidden:(BOOL)hidden\n+- withAnimation:(UIStatusBarAnimation)animation)\n++RCT_EXPORT_METHOD(setHidden : (BOOL)hidden withAnimation : (UIStatusBarAnimation)animation)\n+ {\n+ if (RCTViewControllerBasedStatusBarAppearance()) {\n+ RCTLogError(@\"RCTStatusBarManager module requires that the \\\n+@@ -125,17 +155,16 @@ - (void)applicationWillChangeStatusBarFrame:(NSNotification *)notification\n+ } else {\n+ #pragma clang diagnostic push\n+ #pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n+- [RCTSharedApplication() setStatusBarHidden:hidden\n+- withAnimation:animation];\n++ [RCTSharedApplication() setStatusBarHidden:hidden withAnimation:animation];\n+ #pragma clang diagnostic pop\n+ }\n+ }\n+\n+-RCT_EXPORT_METHOD(setNetworkActivityIndicatorVisible:(BOOL)visible)\n++RCT_EXPORT_METHOD(setNetworkActivityIndicatorVisible : (BOOL)visible)\n+ {\n+ RCTSharedApplication().networkActivityIndicatorVisible = visible;\n+ }\n+\n+-#endif //TARGET_OS_TV\n++#endif // TARGET_OS_TV\n+\n+ @end\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Fix up some components for iOS dark mode
129,187
08.10.2019 17:48:24
14,400
ac91a266019866850773b662d474fedf22da5699
[native] codeVersion -> 36 Won't release this one to the people immediately
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -131,8 +131,8 @@ android {\napplicationId \"org.squadcal\"\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 35\n- versionName \"0.0.35\"\n+ versionCode 36\n+ versionName \"0.0.36\"\n}\nsplits {\nabi {\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal/Info.debug.plist", "new_path": "native/ios/SquadCal/Info.debug.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.35</string>\n+ <string>0.0.36</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>35</string>\n+ <string>36</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal/Info.release.plist", "new_path": "native/ios/SquadCal/Info.release.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.35</string>\n+ <string>0.0.36</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>35</string>\n+ <string>36</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/redux/persist.js", "new_path": "native/redux/persist.js", "diff": "@@ -142,7 +142,7 @@ const persistConfig = {\nmigrate: createMigrate(migrations, { debug: __DEV__ }),\n};\n-const codeVersion = 35;\n+const codeVersion = 36;\n// This local exists to avoid a circular dependency where redux-setup needs to\n// import all the navigation and screen stuff, but some of those screens want to\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] codeVersion -> 36 Won't release this one to the people immediately
129,187
08.10.2019 17:53:49
14,400
1879a642279a9da8aad9346b98d92b56a6c0dd94
[web] Always focus on emailInput in Splash on Request Access
[ { "change_type": "MODIFY", "old_path": "web/splash/splash.react.js", "new_path": "web/splash/splash.react.js", "diff": "@@ -228,11 +228,12 @@ class Splash extends React.PureComponent<Props, State> {\nconst formHeight = 180;\nconst contentHeight = 790;\nconst guaranteesSpace = contentHeight - window.innerHeight + formHeight;\n- if (bottomContainer.scrollTop >= guaranteesSpace) {\n- return;\n- }\n+ if (bottomContainer.scrollTop < guaranteesSpace) {\nconst defaultScrollHeight = 390;\n- bottomContainer.scrollTo({ top: Math.max(defaultScrollHeight, guaranteesSpace) });\n+ bottomContainer.scrollTo({\n+ top: Math.max(defaultScrollHeight, guaranteesSpace),\n+ });\n+ }\nif (this.emailInput) {\nthis.emailInput.focus();\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[web] Always focus on emailInput in Splash on Request Access
129,187
08.10.2019 18:11:45
14,400
f713490d71ea2c63fca8d2ad1f62e3458830ee09
[native] Only default StatusBar to dark-content on iOS Note that this is included in the v36 native release on Android, despite being past that version bump commit...
[ { "change_type": "MODIFY", "old_path": "native/app.react.js", "new_path": "native/app.react.js", "diff": "@@ -105,6 +105,9 @@ if (Platform.OS === \"android\") {\nconst msInDay = 24 * 60 * 60 * 1000;\nconst ReduxifiedRootNavigator = createReduxContainer(RootNavigator);\n+const defaultStatusBarStyle = Platform.OS === \"ios\"\n+ ? \"dark-content\"\n+ : \"default\";\ntype NativeDispatch = Dispatch & ((action: NavigationAction) => boolean);\n@@ -623,7 +626,7 @@ class AppWithNavigationState extends React.PureComponent<Props> {\nstate={this.props.navigationState}\ndispatch={this.props.dispatch}\n/>\n- <ConnectedStatusBar barStyle=\"dark-content\" />\n+ <ConnectedStatusBar barStyle={defaultStatusBarStyle} />\n<DisconnectedBarVisibilityHandler />\n<DimensionsUpdater />\n<ConnectivityUpdater />\n" }, { "change_type": "MODIFY", "old_path": "native/connected-status-bar.react.js", "new_path": "native/connected-status-bar.react.js", "diff": "@@ -14,7 +14,7 @@ type InjectedProps = {\nglobalLoadingStatus: LoadingStatus,\n};\ntype OwnProps = {\n- barStyle?: \"light-content\" | \"dark-content\",\n+ barStyle?: \"default\" | \"light-content\" | \"dark-content\",\nanimated?: bool,\n};\nclass ConnectedStatusBar extends React.PureComponent<InjectedProps & OwnProps> {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Only default StatusBar to dark-content on iOS Note that this is included in the v36 native release on Android, despite being past that version bump commit...
129,187
09.10.2019 14:04:53
14,400
0b69f4cf1c35f601067022740b95633a41b0aec9
[native] Explicitly set TextInputs to black On iOS dark mode they default to white
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-input-bar.react.js", "new_path": "native/chat/chat-input-bar.react.js", "diff": "@@ -553,6 +553,7 @@ const styles = StyleSheet.create({\nfontSize: 16,\nborderColor: '#AAAAAAAA',\nborderWidth: 1,\n+ color: 'black',\n},\nbottomAligned: {\nalignSelf: 'flex-end',\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat-thread-list.react.js", "new_path": "native/chat/chat-thread-list.react.js", "diff": "@@ -320,6 +320,7 @@ const styles = StyleSheet.create({\nfontSize: 16,\npadding: 0,\nmarginVertical: 0,\n+ color: 'black',\n},\nflatList: {\nflex: 1,\n" }, { "change_type": "MODIFY", "old_path": "native/components/thread-list.react.js", "new_path": "native/components/thread-list.react.js", "diff": "@@ -173,6 +173,7 @@ const styles = StyleSheet.create({\nfontSize: 16,\npadding: 0,\nmarginVertical: 0,\n+ color: 'black',\n},\n});\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Explicitly set TextInputs to black On iOS dark mode they default to white
129,187
09.10.2019 18:22:16
14,400
5b14efc98573fcdf3fb2b086e6db658779df6f2b
[native] Shared component for SafeAreaView
[ { "change_type": "MODIFY", "old_path": "native/account/logged-out-modal.react.js", "new_path": "native/account/logged-out-modal.react.js", "diff": "@@ -34,7 +34,6 @@ import invariant from 'invariant';\nimport Icon from 'react-native-vector-icons/FontAwesome';\nimport OnePassword from 'react-native-onepassword';\nimport PropTypes from 'prop-types';\n-import { SafeAreaView } from 'react-navigation';\nimport _isEqual from 'lodash/fp/isEqual';\nimport { fetchNewCookieFromNativeCredentials } from 'lib/utils/action-utils';\n@@ -71,8 +70,8 @@ import {\nsetStateForContainer,\n} from '../utils/state-container';\nimport { LoggedOutModalRouteName } from '../navigation/route-names';\n+import SafeAreaView from '../components/safe-area-view.react';\n-const forceInset = { top: 'always', bottom: 'always' };\nlet initialAppLoad = true;\ntype LoggedOutMode = \"loading\" | \"prompt\" | \"log-in\" | \"register\";\n@@ -698,7 +697,7 @@ class LoggedOutModal extends React.PureComponent<Props, State> {\nreturn (\n<React.Fragment>\n{background}\n- <SafeAreaView forceInset={forceInset} style={styles.container}>\n+ <SafeAreaView style={styles.container}>\n{statusBar}\n{animatedContent}\n{buttons}\n" }, { "change_type": "MODIFY", "old_path": "native/account/verification-modal.react.js", "new_path": "native/account/verification-modal.react.js", "diff": "@@ -37,7 +37,6 @@ import Icon from 'react-native-vector-icons/FontAwesome';\nimport invariant from 'invariant';\nimport OnePassword from 'react-native-onepassword';\nimport PropTypes from 'prop-types';\n-import { SafeAreaView } from 'react-navigation';\nimport { registerFetchKey } from 'lib/reducers/loading-reducer';\nimport { connect } from 'lib/utils/redux-utils';\n@@ -60,8 +59,7 @@ import {\nremoveKeyboardListener,\n} from '../keyboard';\nimport { VerificationModalRouteName } from '../navigation/route-names';\n-\n-const forceInset = { top: 'always', bottom: 'always' };\n+import SafeAreaView from '../components/safe-area-view.react';\ntype VerificationModalMode = \"simple-text\" | \"reset-password\";\ntype Props = {\n@@ -468,7 +466,7 @@ class InnerVerificationModal extends React.PureComponent<Props, State> {\nreturn (\n<React.Fragment>\n{background}\n- <SafeAreaView forceInset={forceInset} style={styles.container}>\n+ <SafeAreaView style={styles.container}>\n{statusBar}\n{animatedContent}\n{closeButton}\n" }, { "change_type": "MODIFY", "old_path": "native/calendar/calendar.react.js", "new_path": "native/calendar/calendar.react.js", "diff": "@@ -32,7 +32,7 @@ import {\nconnectionStatusPropType,\n} from 'lib/types/socket-types';\n-import React from 'react';\n+import * as React from 'react';\nimport {\nView,\nStyleSheet,\n@@ -45,7 +45,6 @@ import {\nLayoutAnimation,\nTouchableWithoutFeedback,\n} from 'react-native';\n-import { SafeAreaView } from 'react-navigation';\nimport Icon from 'react-native-vector-icons/FontAwesome';\nimport PropTypes from 'prop-types';\nimport invariant from 'invariant';\n@@ -96,6 +95,7 @@ import {\nThreadPickerModalRouteName,\n} from '../navigation/route-names';\nimport DisconnectedBar from '../navigation/disconnected-bar.react';\n+import SafeAreaView from '../components/safe-area-view.react';\nexport type EntryInfoWithHeight = {|\n...EntryInfo,\n@@ -123,8 +123,6 @@ type ExtraData = $ReadOnly<{|\n// navigationOptions.tabBarOnPress below.\nlet currentCalendarRef: ?Calendar = null;\n-const forceInset = { top: 'always', bottom: 'never' };\n-\ntype Props = {\nnavigation: NavigationScreenProp<NavigationRoute>,\n// Redux state\n@@ -777,7 +775,7 @@ class Calendar extends React.PureComponent<Props, State> {\n);\n}\nreturn (\n- <SafeAreaView forceInset={forceInset} style={styles.container}>\n+ <SafeAreaView style={styles.container}>\n<DisconnectedBar />\n<TextHeightMeasurer\ntextToMeasure={this.state.textToMeasure}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/components/safe-area-view.react.js", "diff": "+// @flow\n+\n+import type { ViewStyle } from '../types/styles';\n+\n+import * as React from 'react';\n+import { SafeAreaView } from 'react-navigation';\n+\n+const forceInset = { top: 'always', bottom: 'never' };\n+\n+type Props = {|\n+ style?: ViewStyle,\n+ children?: React.Node,\n+|};\n+function InsetSafeAreaView(props: Props) {\n+ const { style, children } = props;\n+ return (\n+ <SafeAreaView forceInset={forceInset} style={style}>\n+ {children}\n+ </SafeAreaView>\n+ );\n+}\n+\n+export default InsetSafeAreaView;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Shared component for SafeAreaView
129,187
09.10.2019 18:23:07
14,400
2a4cea28bc687eedc2b63eabe081de468773f15c
[native] Set keyboardHidesTabBar to false Otherwise `KeyboardAvoidingView` gets weird
[ { "change_type": "MODIFY", "old_path": "native/navigation/header.react.js", "new_path": "native/navigation/header.react.js", "diff": "@@ -5,11 +5,11 @@ import { Header } from 'react-navigation-stack';\nimport DisconnectedBar from './disconnected-bar.react';\n-export default function CustomHeader(props: *) {\n+export default function CustomHeader(props: React.ElementProps<typeof Header>) {\nreturn (\n- <React.Fragment>\n+ <>\n<Header {...props} />\n<DisconnectedBar />\n- </React.Fragment>\n+ </>\n);\n}\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/navigation-setup.js", "new_path": "native/navigation/navigation-setup.js", "diff": "@@ -176,6 +176,9 @@ if (Platform.OS === \"android\") {\n{\ninitialRouteName: CalendarRouteName,\nlazy: false,\n+ tabBarOptions: {\n+ keyboardHidesTabBar: false,\n+ },\n},\n);\n}\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -10217,9 +10217,9 @@ react-navigation-redux-helpers@^4.0.0:\ninvariant \"^2.2.2\"\nreact-navigation-stack@^1.9.0:\n- version \"1.9.3\"\n- resolved \"https://registry.yarnpkg.com/react-navigation-stack/-/react-navigation-stack-1.9.3.tgz#956a41796878d82c4db506075afea5e3cef64120\"\n- integrity sha512-MwQ55tfTJ5LhSdCHc8EMAH3bVinJ1hTLYhyxx7KgnReUl4BZ9s/Qn0fKC95BgSefAeunEphQPLHNNBygDN6uKw==\n+ version \"1.9.4\"\n+ resolved \"https://registry.yarnpkg.com/react-navigation-stack/-/react-navigation-stack-1.9.4.tgz#9de7537bb83a1d30a177957bc7932b9447f4c409\"\n+ integrity sha512-0Iv8t99RPsznXVadlHGRwOJqLzJmj96PfWiwmZEhVnbNwMVXMLz3oOno0LL9tbiukQxEaFAKUIblElpd9izS6w==\ndependencies:\nprop-types \"^15.7.2\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Set keyboardHidesTabBar to false Otherwise `KeyboardAvoidingView` gets weird
129,187
10.10.2019 01:08:32
14,400
1950bcd37dff16cda9954e2ce0279bb0434d038c
[native] Use new library in-app notifs Moving from `react-native-in-app-notification` to `react-native-in-app-message`
[ { "change_type": "MODIFY", "old_path": "native/app.react.js", "new_path": "native/app.react.js", "diff": "@@ -18,11 +18,9 @@ import {\nLinking,\nView,\nStyleSheet,\n- DeviceInfo,\n} from 'react-native';\nimport { createReduxContainer } from 'react-navigation-redux-helpers';\nimport PropTypes from 'prop-types';\n-import { InAppNotificationProvider } from 'react-native-in-app-notification';\nimport SplashScreen from 'react-native-splash-screen';\nimport Orientation from 'react-native-orientation-locker';\n@@ -36,7 +34,6 @@ import { RootNavigator } from './navigation/navigation-setup';\nimport { handleURLActionType } from './redux/action-types';\nimport { store, appBecameInactive } from './redux/redux-setup';\nimport ConnectedStatusBar from './connected-status-bar.react';\n-import NotificationBody from './push/notification-body.react';\nimport ErrorBoundary from './error-boundary.react';\nimport DisconnectedBarVisibilityHandler\nfrom './navigation/disconnected-bar-visibility-handler.react';\n@@ -50,7 +47,6 @@ if (Platform.OS === \"android\") {\nUIManager.setLayoutAnimationEnabledExperimental(true);\n}\n-const inAppNotificationHeight = DeviceInfo.isIPhoneX_deprecated ? 104 : 80;\nconst ReduxifiedRootNavigator = createReduxContainer(RootNavigator);\nconst defaultStatusBarStyle = Platform.OS === \"ios\"\n? \"dark-content\"\n@@ -132,10 +128,6 @@ class AppWithNavigationState extends React.PureComponent<Props, State> {\nrender() {\nconst { detectUnsupervisedBackground } = this.state;\nreturn (\n- <InAppNotificationProvider\n- height={inAppNotificationHeight}\n- notificationBodyComponent={NotificationBody}\n- >\n<View style={styles.app}>\n<Socket\ndetectUnsupervisedBackgroundRef={this.detectUnsupervisedBackgroundRef}\n@@ -152,7 +144,6 @@ class AppWithNavigationState extends React.PureComponent<Props, State> {\ndetectUnsupervisedBackground={detectUnsupervisedBackground}\n/>\n</View>\n- </InAppNotificationProvider>\n);\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/flow-typed/npm/react-native-in-app-message_vx.x.x.js", "diff": "+// flow-typed signature: c8f5e67bd187545b77bb1a40e8d75ad1\n+// flow-typed version: <<STUB>>/react-native-in-app-message_v1.0.2/flow_v0.98.0\n+\n+/**\n+ * This is an autogenerated libdef stub for:\n+ *\n+ * 'react-native-in-app-message'\n+ *\n+ * Fill this stub out by replacing all the `any` types.\n+ *\n+ * Once filled out, we encourage you to share your work with the\n+ * community by sending a pull request to:\n+ * https://github.com/flowtype/flow-typed\n+ */\n+\n+declare module 'react-native-in-app-message' {\n+ declare module.exports: any;\n+}\n+\n+/**\n+ * We include stubs for each file inside this npm package in case you need to\n+ * require those files directly. Feel free to delete any files that aren't\n+ * needed.\n+ */\n+declare module 'react-native-in-app-message/src/Noification/androidStyle' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-in-app-message/src/Noification' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-in-app-message/src/Noification/iOStyle' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-in-app-message/src/Noification/Notification.android' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-in-app-message/src/Noification/Notification.ios' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-in-app-message/src/Noification/NotificationBase' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-in-app-message/src/RNInAppMessage/Blur' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-in-app-message/src/RNInAppMessage' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-in-app-message/src/RNInAppMessage/TapticFeedbackNativeModule' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-in-app-message/src/Util' {\n+ declare module.exports: any;\n+}\n+\n+// Filename aliases\n+declare module 'react-native-in-app-message/index' {\n+ declare module.exports: $Exports<'react-native-in-app-message'>;\n+}\n+declare module 'react-native-in-app-message/index.js' {\n+ declare module.exports: $Exports<'react-native-in-app-message'>;\n+}\n+declare module 'react-native-in-app-message/src/Noification/androidStyle.js' {\n+ declare module.exports: $Exports<'react-native-in-app-message/src/Noification/androidStyle'>;\n+}\n+declare module 'react-native-in-app-message/src/Noification/index' {\n+ declare module.exports: $Exports<'react-native-in-app-message/src/Noification'>;\n+}\n+declare module 'react-native-in-app-message/src/Noification/index.js' {\n+ declare module.exports: $Exports<'react-native-in-app-message/src/Noification'>;\n+}\n+declare module 'react-native-in-app-message/src/Noification/iOStyle.js' {\n+ declare module.exports: $Exports<'react-native-in-app-message/src/Noification/iOStyle'>;\n+}\n+declare module 'react-native-in-app-message/src/Noification/Notification.android.js' {\n+ declare module.exports: $Exports<'react-native-in-app-message/src/Noification/Notification.android'>;\n+}\n+declare module 'react-native-in-app-message/src/Noification/Notification.ios.js' {\n+ declare module.exports: $Exports<'react-native-in-app-message/src/Noification/Notification.ios'>;\n+}\n+declare module 'react-native-in-app-message/src/Noification/NotificationBase.js' {\n+ declare module.exports: $Exports<'react-native-in-app-message/src/Noification/NotificationBase'>;\n+}\n+declare module 'react-native-in-app-message/src/RNInAppMessage/Blur.js' {\n+ declare module.exports: $Exports<'react-native-in-app-message/src/RNInAppMessage/Blur'>;\n+}\n+declare module 'react-native-in-app-message/src/RNInAppMessage/index' {\n+ declare module.exports: $Exports<'react-native-in-app-message/src/RNInAppMessage'>;\n+}\n+declare module 'react-native-in-app-message/src/RNInAppMessage/index.js' {\n+ declare module.exports: $Exports<'react-native-in-app-message/src/RNInAppMessage'>;\n+}\n+declare module 'react-native-in-app-message/src/RNInAppMessage/TapticFeedbackNativeModule.js' {\n+ declare module.exports: $Exports<'react-native-in-app-message/src/RNInAppMessage/TapticFeedbackNativeModule'>;\n+}\n+declare module 'react-native-in-app-message/src/Util.js' {\n+ declare module.exports: $Exports<'react-native-in-app-message/src/Util'>;\n+}\n" }, { "change_type": "DELETE", "old_path": "native/flow-typed/npm/react-native-in-app-notification_vx.x.x.js", "new_path": null, "diff": "-// flow-typed signature: efaa17399395d7192fbff78431625831\n-// flow-typed version: <<STUB>>/react-native-in-app-notification_v^2.1.0/flow_v0.98.0\n-\n-/**\n- * This is an autogenerated libdef stub for:\n- *\n- * 'react-native-in-app-notification'\n- *\n- * Fill this stub out by replacing all the `any` types.\n- *\n- * Once filled out, we encourage you to share your work with the\n- * community by sending a pull request to:\n- * https://github.com/flowtype/flow-typed\n- */\n-\n-declare module 'react-native-in-app-notification' {\n- declare module.exports: any;\n-}\n-\n-/**\n- * We include stubs for each file inside this npm package in case you need to\n- * require those files directly. Feel free to delete any files that aren't\n- * needed.\n- */\n-declare module 'react-native-in-app-notification/DefaultNotificationBody.android' {\n- declare module.exports: any;\n-}\n-\n-declare module 'react-native-in-app-notification/DefaultNotificationBody.ios' {\n- declare module.exports: any;\n-}\n-\n-declare module 'react-native-in-app-notification/Notification' {\n- declare module.exports: any;\n-}\n-\n-// Filename aliases\n-declare module 'react-native-in-app-notification/DefaultNotificationBody.android.js' {\n- declare module.exports: $Exports<'react-native-in-app-notification/DefaultNotificationBody.android'>;\n-}\n-declare module 'react-native-in-app-notification/DefaultNotificationBody.ios.js' {\n- declare module.exports: $Exports<'react-native-in-app-notification/DefaultNotificationBody.ios'>;\n-}\n-declare module 'react-native-in-app-notification/Notification.js' {\n- declare module.exports: $Exports<'react-native-in-app-notification/Notification'>;\n-}\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -76,6 +76,8 @@ PODS:\n- React\n- react-native-image-resizer (1.0.1):\n- React\n+ - react-native-in-app-message (1.0.2):\n+ - React\n- react-native-keyboard-input (5.3.1):\n- React\n- react-native-keyboard-tracking-view\n@@ -159,6 +161,7 @@ DEPENDENCIES:\n- React-jsinspector (from `../../node_modules/react-native/ReactCommon/jsinspector`)\n- \"react-native-cameraroll (from `../../node_modules/@react-native-community/cameraroll`)\"\n- react-native-image-resizer (from `../../node_modules/react-native-image-resizer`)\n+ - react-native-in-app-message (from `../../node_modules/react-native-in-app-message`)\n- react-native-keyboard-input (from `../../node_modules/react-native-keyboard-input`)\n- react-native-keyboard-tracking-view (from `../../node_modules/react-native-keyboard-tracking-view`)\n- \"react-native-netinfo (from `../../node_modules/@react-native-community/netinfo`)\"\n@@ -226,6 +229,8 @@ EXTERNAL SOURCES:\n:path: \"../../node_modules/@react-native-community/cameraroll\"\nreact-native-image-resizer:\n:path: \"../../node_modules/react-native-image-resizer\"\n+ react-native-in-app-message:\n+ :path: \"../../node_modules/react-native-in-app-message\"\nreact-native-keyboard-input:\n:path: \"../../node_modules/react-native-keyboard-input\"\nreact-native-keyboard-tracking-view:\n@@ -300,6 +305,7 @@ SPEC CHECKSUMS:\nReact-jsinspector: a58b86545a0185f69768e78ac96ca9fe43fa3694\nreact-native-cameraroll: 3e5e34d36d93548ae7770ee8ab7b2ae9e778f571\nreact-native-image-resizer: 48eb06a18a6d0a632ffa162a51ca61a68fb5322f\n+ react-native-in-app-message: f91de5009620af01456531118264c93e249b83ec\nreact-native-keyboard-input: 83520632cab76a827bdf1db0aa1c87a047f7c18b\nreact-native-keyboard-tracking-view: bf1f758a529e1e87f8a76044414b168251d59d37\nreact-native-netinfo: 6bb847e64f45a2d69c6173741111cfd95c669301\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"react-native-gesture-handler\": \"^1.4.1\",\n\"react-native-hyperlink\": \"^0.0.16\",\n\"react-native-image-resizer\": \"^1.0.1\",\n- \"react-native-in-app-notification\": \"^3.0.0\",\n+ \"react-native-in-app-message\": \"^1.0.2\",\n\"react-native-keyboard-input\": \"^5.3.1\",\n\"react-native-keychain\": \"^4.0.0\",\n\"react-native-notifications\": \"git+https://git@github.com/ashoat/react-native-notifications.git\",\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/push/in-app-notif.react.js", "diff": "+// @flow\n+\n+import * as React from 'react';\n+import { View, Text, StyleSheet, Platform } from 'react-native';\n+\n+type Props = {|\n+ title: ?string,\n+ message: string,\n+|};\n+function InAppNotif(props: Props) {\n+ const title = props.title\n+ ? <Text style={styles.title}>{props.title}{\"\\n\"}</Text>\n+ : null;\n+ return (\n+ <View style={styles.notif}>\n+ <Text style={styles.text}>\n+ {title}\n+ {props.message}\n+ </Text>\n+ </View>\n+ );\n+}\n+\n+const styles = StyleSheet.create({\n+ notif: {\n+ textAlign: 'left',\n+ alignItems: 'flex-start',\n+ alignSelf: 'flex-start',\n+ justifyContent: 'flex-start',\n+ width: '100%',\n+ },\n+ text: {\n+ ...Platform.select({\n+ ios: {\n+ fontSize: 16,\n+ marginTop: 16,\n+ marginBottom: 6,\n+ color: 'black',\n+ },\n+ default: {\n+ fontSize: 18,\n+ marginVertical: 16,\n+ },\n+ }),\n+ marginHorizontal: 10,\n+ },\n+ title: {\n+ color: 'black',\n+ fontWeight: 'bold',\n+ },\n+});\n+\n+export default InAppNotif;\n" }, { "change_type": "DELETE", "old_path": "native/push/notification-body.react.js", "new_path": null, "diff": "-// @flow\n-\n-import type { ImageSource } from 'react-native/Libraries/Image/ImageSource';\n-\n-import * as React from 'react';\n-import { View, StyleSheet, DeviceInfo, Platform } from 'react-native';\n-import DefaultNotificationBody\n- from 'react-native-in-app-notification/src/DefaultNotificationBody';\n-\n-type Props = {\n- title: string,\n- message: string,\n- onPress: () => void,\n- isOpen: bool,\n- iconApp: ImageSource,\n- icon: ImageSource,\n- vibrate: bool,\n- onClose: () => void,\n-};\n-class NotificationBody extends React.PureComponent<Props> {\n-\n- render() {\n- return (\n- <View style={styles.notificationBodyContainer}>\n- <DefaultNotificationBody\n- title={this.props.title}\n- message={this.props.message}\n- onPress={this.onPress}\n- isOpen={this.props.isOpen}\n- iconApp={this.props.iconApp}\n- icon={this.props.icon}\n- vibrate={this.props.vibrate}\n- onClose={this.props.onClose}\n- />\n- </View>\n- );\n- }\n-\n- onPress = () => {\n- const { onPress } = this.props;\n- if (onPress) {\n- // onPress is null when the notification is animating closed. It's not\n- // clear why this needs to be the case, but isn't fixed as of\n- // react-native-in-app-notification@3.0.0. Especially weird given that\n- // DefaultNotificationBody crashes if passed a null onPress and pressed.\n- onPress();\n- }\n- }\n-\n-}\n-\n-const styles = StyleSheet.create({\n- notificationBodyContainer: {\n- flex: 1,\n- paddingTop: DeviceInfo.isIPhoneX_deprecated ? 24 : 0,\n- backgroundColor: Platform.OS === \"ios\" ? \"#050505\" : \"#FFFFFF\",\n- },\n-});\n-\n-export default NotificationBody;\n" }, { "change_type": "MODIFY", "old_path": "native/push/push-handler.react.js", "new_path": "native/push/push-handler.react.js", "diff": "@@ -20,7 +20,6 @@ import {\n} from 'lib/types/socket-types';\nimport type {\nRemoteMessage,\n- Notification,\nNotificationOpen,\n} from 'react-native-firebase';\n@@ -33,7 +32,7 @@ import {\nAlert,\n} from 'react-native';\nimport NotificationsIOS from 'react-native-notifications';\n-import { withInAppNotification } from 'react-native-in-app-notification';\n+import { Notification as InAppNotification } from 'react-native-in-app-message';\nimport { connect } from 'lib/utils/redux-utils';\nimport { unreadCount } from 'lib/selectors/thread-selectors';\n@@ -62,13 +61,12 @@ import {\n} from './android';\nimport { getFirebase } from './firebase';\nimport { saveMessageInfos } from './utils';\n+import InAppNotif from './in-app-notif.react';\nconst msInDay = 24 * 60 * 60 * 1000;\ntype Props = {\ndetectUnsupervisedBackground: ?((alreadyClosed: bool) => bool),\n- // withInAppNotification\n- showNotification: (spec: {...}) => void,\n// Redux state\nrehydrateConcluded: bool,\nunreadCount: number,\n@@ -88,11 +86,16 @@ type Props = {\ndeviceType: DeviceType,\n) => Promise<string>,\n};\n-class PushHandler extends React.PureComponent<Props> {\n+type State = {|\n+ inAppNotifProps: ?{|\n+ customComponent: React.Node,\n+ onPress: () => void,\n+ |};\n+|};\n+class PushHandler extends React.PureComponent<Props, State> {\nstatic propTypes = {\ndetectUnsupervisedBackground: PropTypes.func,\n- showNotification: PropTypes.func.isRequired,\nrehydrateConcluded: PropTypes.bool.isRequired,\nunreadCount: PropTypes.number.isRequired,\nactiveThread: PropTypes.string,\n@@ -106,6 +109,9 @@ class PushHandler extends React.PureComponent<Props> {\ndispatchActionPromise: PropTypes.func.isRequired,\nsetDeviceToken: PropTypes.func.isRequired,\n};\n+ state = {\n+ inAppNotifProps: null,\n+ };\ncurrentState: ?string = NativeAppState.currentState;\nappStarted = 0;\nandroidTokenListener: ?(() => void) = null;\n@@ -217,7 +223,7 @@ class PushHandler extends React.PureComponent<Props> {\n}\n}\n- componentDidUpdate(prevProps: Props) {\n+ componentDidUpdate(prevProps: Props, prevState: State) {\nif (this.props.activeThread !== prevProps.activeThread) {\nthis.clearNotifsOfThread();\n}\n@@ -247,6 +253,13 @@ class PushHandler extends React.PureComponent<Props> {\n) {\nthis.ensurePushNotifsEnabled();\n}\n+\n+ if (\n+ this.state.inAppNotifProps &&\n+ this.state.inAppNotifProps !== prevState.inAppNotifProps\n+ ) {\n+ InAppNotification.show();\n+ }\n}\nupdateBadgeCount() {\n@@ -492,10 +505,14 @@ class PushHandler extends React.PureComponent<Props> {\nif (threadID === this.props.activeThread) {\nreturn;\n}\n- this.props.showNotification({\n- message,\n- title,\n- onPress: () => this.onPressNotificationForThread(threadID, false),\n+ this.setState({\n+ inAppNotifProps: {\n+ customComponent: <InAppNotif title={title} message={message} />,\n+ onPress: () => {\n+ InAppNotification.hide();\n+ this.onPressNotificationForThread(threadID, false);\n+ },\n+ },\n});\n}\n@@ -530,7 +547,7 @@ class PushHandler extends React.PureComponent<Props> {\n}\nrender() {\n- return null;\n+ return <InAppNotification {...this.state.inAppNotifProps} />;\n}\n}\n@@ -553,4 +570,4 @@ export default connect(\nupdatesCurrentAsOf: state.updatesCurrentAsOf,\n}),\n{ setDeviceToken },\n-)(withInAppNotification(PushHandler));\n+)(PushHandler);\n" }, { "change_type": "ADD", "old_path": null, "new_path": "patches/react-native-in-app-message+1.0.2.patch", "diff": "+diff --git a/node_modules/react-native-in-app-message/react-native-in-app-message.podspec b/node_modules/react-native-in-app-message/react-native-in-app-message.podspec\n+new file mode 100644\n+index 0000000..3e0041f\n+--- /dev/null\n++++ b/node_modules/react-native-in-app-message/react-native-in-app-message.podspec\n+@@ -0,0 +1,16 @@\n++require 'json'\n++package = JSON.parse(File.read('package.json'))\n++\n++Pod::Spec.new do |s|\n++ s.name = \"react-native-in-app-message\"\n++ s.version = package[\"version\"]\n++ s.summary = package[\"description\"]\n++ s.homepage = \"https://github.com/KirillGudkov/react-native-in-app-message\"\n++ s.author = { \"Kirill Gudkov\" => \"for.example.nickname@gmail.com\" }\n++ s.ios.deployment_target = '9.0'\n++ s.license = package[\"license\"]\n++ s.source_files = \"src/RNInAppMessage/ios/RNInAppMessage/**/*.{h,m}\"\n++ s.source = { :git => \"https://github.com/KirillGudkov/react-native-in-app-message.git\", :tag => \"v#{s.version}\" }\n++\n++ s.dependency 'React'\n++end\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -10058,19 +10058,10 @@ react-native-image-resizer@^1.0.1:\nresolved \"https://registry.yarnpkg.com/react-native-image-resizer/-/react-native-image-resizer-1.0.1.tgz#e9eeb7f81596ffc490f822897952b046c07ee95c\"\nintegrity sha512-upBF/9TIs4twg19dSkSaDW/MzMpNbysEXtPuapu3GqvOuGIYHKQ30v6httDn7rIb6uCcNIWL1BwZJM2cDt/C9Q==\n-react-native-in-app-notification@^3.0.0:\n- version \"3.0.0\"\n- resolved \"https://registry.yarnpkg.com/react-native-in-app-notification/-/react-native-in-app-notification-3.0.0.tgz#1ebc4f8f463fe70b366b17901441c81806656632\"\n- integrity sha512-0oLUcS/TgLJFfyQkp6FxgQslJnnsvXaVyca8QvFWbw44cjK8zDqDk3HiOQKdW/UCbRbTQ0akMwgjESxNEGgIMg==\n- dependencies:\n- hoist-non-react-statics \"^3.0.1\"\n- react-native-iphone-x-helper \"^1.2.0\"\n- react-native-swipe-gestures \"^1.0.2\"\n-\n-react-native-iphone-x-helper@^1.2.0:\n- version \"1.2.1\"\n- resolved \"https://registry.yarnpkg.com/react-native-iphone-x-helper/-/react-native-iphone-x-helper-1.2.1.tgz#645e2ffbbb49e80844bb4cbbe34a126fda1e6772\"\n- integrity sha512-/VbpIEp8tSNNHIvstuA3Swx610whci1Zpc9mqNkqn14DkMbw+ORviln2u0XyHG1kPvvwTNGZY6QpeFwxYaSdbQ==\n+react-native-in-app-message@^1.0.2:\n+ version \"1.0.2\"\n+ resolved \"https://registry.yarnpkg.com/react-native-in-app-message/-/react-native-in-app-message-1.0.2.tgz#e971c039bcd0e238306f73fbea43fc866aa94a69\"\n+ integrity sha512-dbzC3AMT5CzGafzUu8ifFMd5g6v0Ww5q9oQgw8RRqjMhggoXDipct9BBI9g4tAoUB2xE2axqu2tKC5pnpBnbdQ==\nreact-native-keyboard-input@^5.3.1:\nversion \"5.3.1\"\n@@ -10156,11 +10147,6 @@ react-native-splash-screen@^3.2.0:\nresolved \"https://registry.yarnpkg.com/react-native-splash-screen/-/react-native-splash-screen-3.2.0.tgz#d47ec8557b1ba988ee3ea98d01463081b60fff45\"\nintegrity sha512-Ls9qiNZzW/OLFoI25wfjjAcrf2DZ975hn2vr6U9gyuxi2nooVbzQeFoQS5vQcbCt9QX5NY8ASEEAtlLdIa6KVg==\n-react-native-swipe-gestures@^1.0.2:\n- version \"1.0.4\"\n- resolved \"https://registry.yarnpkg.com/react-native-swipe-gestures/-/react-native-swipe-gestures-1.0.4.tgz#6a9c6613bfe06cd9014a36a2c4a09f719ff62451\"\n- integrity sha512-C/vz0KPHNyqHk3uF4Cz/jzd/0N8z34ZgsjAZUh/RsXPH2FtJJf3Fw73pQDWJSoCMtvVadlztb8xQ+/aEQrll7w==\n-\nreact-native-tab-view@^2.9.0:\nversion \"2.10.0\"\nresolved \"https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-2.10.0.tgz#5e249e5650502010013449ffd4e5edc18a95364b\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use new library in-app notifs Moving from `react-native-in-app-notification` to `react-native-in-app-message`
129,187
10.10.2019 01:18:28
14,400
8e8a3f21557664af3712b305e43dcc77cf2d4e07
[native] codeVersion -> 37 Won't release this one to the people immediately
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -131,8 +131,8 @@ android {\napplicationId \"org.squadcal\"\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 36\n- versionName \"0.0.36\"\n+ versionCode 37\n+ versionName \"0.0.37\"\n}\nsplits {\nabi {\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal/Info.debug.plist", "new_path": "native/ios/SquadCal/Info.debug.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.36</string>\n+ <string>0.0.37</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>36</string>\n+ <string>37</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal/Info.release.plist", "new_path": "native/ios/SquadCal/Info.release.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.36</string>\n+ <string>0.0.37</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>36</string>\n+ <string>37</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/redux/persist.js", "new_path": "native/redux/persist.js", "diff": "@@ -143,7 +143,7 @@ const persistConfig = {\ntimeout: __DEV__ ? 0 : undefined,\n};\n-const codeVersion = 36;\n+const codeVersion = 37;\n// This local exists to avoid a circular dependency where redux-setup needs to\n// import all the navigation and screen stuff, but some of those screens want to\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] codeVersion -> 37 Won't release this one to the people immediately
129,187
11.10.2019 15:18:39
14,400
844b5fd9541b2df6f9669588f6bce230898d7702
[web] Fix color splotches in ThreadPicker
[ { "change_type": "MODIFY", "old_path": "web/calendar/thread-picker.react.js", "new_path": "web/calendar/thread-picker.react.js", "diff": "@@ -24,7 +24,7 @@ type OptionProps = {\nclass ThreadPickerOption extends React.PureComponent<OptionProps> {\nrender() {\n- const colorStyle = { backgroundColor: `#{this.props.threadInfo.color}` };\n+ const colorStyle = { backgroundColor: `#${this.props.threadInfo.color}` };\nreturn (\n<div className={css.option} onClick={this.onClick}>\n<span className={css.thread}>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[web] Fix color splotches in ThreadPicker
129,187
11.10.2019 17:10:40
14,400
669b095021740f2437b845d8f183f04921b5a95d
[web] Use scrollTop instead of scrollTo in Splash
[ { "change_type": "MODIFY", "old_path": "web/splash/splash.react.js", "new_path": "web/splash/splash.react.js", "diff": "@@ -25,6 +25,8 @@ import css from './splash.css';\nimport LoadingIndicator from '../loading-indicator.react';\nimport LogInModal from '../modals/account/log-in-modal.react';\n+const defaultRequestAccessScrollHeight = 390;\n+\ntype Props = {\nsetModal: (modal: ?React.Node) => void,\ncurrentModal: ?React.Node,\n@@ -229,10 +231,10 @@ class Splash extends React.PureComponent<Props, State> {\nconst contentHeight = 790;\nconst guaranteesSpace = contentHeight - window.innerHeight + formHeight;\nif (bottomContainer.scrollTop < guaranteesSpace) {\n- const defaultScrollHeight = 390;\n- bottomContainer.scrollTo({\n- top: Math.max(defaultScrollHeight, guaranteesSpace),\n- });\n+ bottomContainer.scrollTop = Math.max(\n+ defaultRequestAccessScrollHeight,\n+ guaranteesSpace,\n+ );\n}\nif (this.emailInput) {\nthis.emailInput.focus();\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[web] Use scrollTop instead of scrollTo in Splash
129,187
11.10.2019 17:36:29
14,400
7d4886123be703afa17306cb197a959954e95370
[native] mergePrefixIntoBody
[ { "change_type": "MODIFY", "old_path": "lib/shared/notif-utils.js", "new_path": "lib/shared/notif-utils.js", "diff": "@@ -493,8 +493,25 @@ function notifCollapseKeyForRawMessageInfo(\n}\n}\n+type Unmerged = $ReadOnly<{\n+ body: string,\n+ title: string,\n+ prefix?: string,\n+ ...\n+}>;\n+type Merged = {|\n+ body: string,\n+ title: string,\n+|};\n+function mergePrefixIntoBody(unmerged: Unmerged): Merged {\n+ const { body, title, prefix } = unmerged;\n+ const merged = prefix ? `${prefix} ${body}` : body;\n+ return { body: merged, title };\n+}\n+\nexport {\nnotificationPressActionType,\nnotifTextsForMessageInfo,\nnotifCollapseKeyForRawMessageInfo,\n+ mergePrefixIntoBody,\n};\n" }, { "change_type": "MODIFY", "old_path": "native/push/android.js", "new_path": "native/push/android.js", "diff": "@@ -5,23 +5,19 @@ import type { RemoteMessage } from 'react-native-firebase';\nimport invariant from 'invariant';\n+import { mergePrefixIntoBody } from 'lib/shared/notif-utils';\n+\nimport {\nrecordAndroidNotificationActionType,\nrescindAndroidNotificationActionType,\n} from '../redux/action-types';\nimport { getFirebase } from './firebase';\n-\nimport { saveMessageInfos } from './utils';\nimport { store, dispatch } from '../redux/redux-setup';\nconst androidNotificationChannelID = 'default';\nconst vibrationSpec = [ 500, 500 ];\n-type Texts = {|\n- title: string,\n- prefix: string,\n- body: string,\n-|};\nfunction handleAndroidMessage(\nmessage: RemoteMessage,\nupdatesCurrentAsOf: number,\n@@ -72,10 +68,10 @@ function handleAndroidMessage(\nif (!id && customNotification) {\n({ id, body, threadID } = customNotification);\n}\n- const merged = prefix ? `${prefix} ${body}` : body;\n+ ({ body } = mergePrefixIntoBody({ body, title, prefix }));\nif (handleIfActive) {\n- const texts = { title, body: merged };\n+ const texts = { title, body };\nconst isActive = handleIfActive(threadID, texts);\nif (isActive) {\nreturn;\n@@ -84,7 +80,7 @@ function handleAndroidMessage(\nconst notification = new firebase.notifications.Notification()\n.setNotificationId(id)\n- .setBody(merged)\n+ .setBody(body)\n.setData({ threadID })\n.android.setTag(id)\n.android.setChannelId(androidNotificationChannelID)\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] mergePrefixIntoBody
129,187
11.10.2019 17:39:45
14,400
c0011bd147da27ed05f32d27e082738edaca3103
Separate out title and body for iOS in-app notifs
[ { "change_type": "MODIFY", "old_path": "native/push/push-handler.react.js", "new_path": "native/push/push-handler.react.js", "diff": "@@ -40,7 +40,10 @@ import {\nsetDeviceTokenActionTypes,\nsetDeviceToken,\n} from 'lib/actions/device-actions';\n-import { notificationPressActionType } from 'lib/shared/notif-utils';\n+import {\n+ notificationPressActionType,\n+ mergePrefixIntoBody,\n+} from 'lib/shared/notif-utils';\nimport {\nrecordNotifPermissionAlertActionType,\n@@ -479,7 +482,12 @@ class PushHandler extends React.PureComponent<Props, State> {\nif (messageInfos) {\nthis.saveMessageInfos(messageInfos);\n}\n- this.showInAppNotification(threadID, notification.getMessage());\n+ let title = null;\n+ let body = notification.getMessage();\n+ if (notification.getData().title) {\n+ ({ title, body } = mergePrefixIntoBody(notification.getData()));\n+ }\n+ this.showInAppNotification(threadID, body, title);\nnotification.finish(NotificationsIOS.FetchResult.NewData);\n}\n" }, { "change_type": "MODIFY", "old_path": "server/src/push/send.js", "new_path": "server/src/push/send.js", "diff": "@@ -468,9 +468,14 @@ function prepareIOSNotification(\nconst notification = new apn.Notification();\nnotification.topic = \"org.squadcal.app\";\nif (!badgeOnly) {\n- const { merged } = notifTextsForMessageInfo(allMessageInfos, threadInfo);\n+ const { merged, ...rest } =\n+ notifTextsForMessageInfo(allMessageInfos, threadInfo);\nnotification.body = merged;\nnotification.sound = \"default\";\n+ notification.payload = {\n+ ...notification.payload,\n+ ...rest,\n+ };\n}\nnotification.badge = unreadCount;\nnotification.threadId = threadInfo.id;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Separate out title and body for iOS in-app notifs
129,187
11.10.2019 17:44:25
14,400
6f6e113dd6d923fb51b981d7838083f2bf6d9284
[native] codeVersion -> 38
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -131,8 +131,8 @@ android {\napplicationId \"org.squadcal\"\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 37\n- versionName \"0.0.37\"\n+ versionCode 38\n+ versionName \"0.0.38\"\n}\nsplits {\nabi {\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal/Info.debug.plist", "new_path": "native/ios/SquadCal/Info.debug.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.37</string>\n+ <string>0.0.38</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>37</string>\n+ <string>38</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal/Info.release.plist", "new_path": "native/ios/SquadCal/Info.release.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.37</string>\n+ <string>0.0.38</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>37</string>\n+ <string>38</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/redux/persist.js", "new_path": "native/redux/persist.js", "diff": "@@ -143,7 +143,7 @@ const persistConfig = {\ntimeout: __DEV__ ? 0 : undefined,\n};\n-const codeVersion = 37;\n+const codeVersion = 38;\n// This local exists to avoid a circular dependency where redux-setup needs to\n// import all the navigation and screen stuff, but some of those screens want to\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] codeVersion -> 38
129,187
11.10.2019 19:04:00
14,400
5d9c0a060e77ac955c964482895be9dbe3e83187
[server] Render React using a stream to improve performance
[ { "change_type": "MODIFY", "old_path": "server/src/responders/handlers.js", "new_path": "server/src/responders/handlers.js", "diff": "@@ -17,7 +17,7 @@ import { deleteCookie } from '../deleters/cookie-deleters';\nexport type JSONResponder = (viewer: Viewer, input: any) => Promise<*>;\nexport type DownloadResponder\n= (viewer: Viewer, req: $Request, res: $Response) => Promise<void>;\n-export type HTMLResponder = (viewer: Viewer, url: string) => Promise<string>;\n+export type HTMLResponder = DownloadResponder;\nexport type UploadResponder = (viewer: Viewer, req: $Request) => Promise<*>;\nfunction jsonHandler(responder: JSONResponder) {\n@@ -101,9 +101,9 @@ function htmlHandler(responder: HTMLResponder) {\nreturn async (req: $Request, res: $Response) => {\ntry {\nconst viewer = await fetchViewerForHomeRequest(req);\n- const rendered = await responder(viewer, req.url);\naddCookieToHomeResponse(viewer, res);\n- res.send(rendered);\n+ res.type('html');\n+ await responder(viewer, req, res);\n} catch (e) {\nconsole.warn(e);\nif (!res.headersSent) {\n" }, { "change_type": "MODIFY", "old_path": "server/src/responders/website-responders.js", "new_path": "server/src/responders/website-responders.js", "diff": "@@ -46,7 +46,7 @@ import { activityUpdater } from '../updaters/activity-updaters';\nimport urlFacts from '../../facts/url';\nconst { basePath, baseDomain } = urlFacts;\n-const { renderToString } = ReactDOMServer;\n+const { renderToNodeStream } = ReactDOMServer;\nconst { Provider } = ReactRedux;\nconst { reducer } = ReduxSetup;\nconst { Route, StaticRouter } = ReactRouter;\n@@ -79,11 +79,15 @@ async function getAssetInfo() {\nreturn assetInfo;\n}\n-async function websiteResponder(viewer: Viewer, url: string): Promise<string> {\n+async function websiteResponder(\n+ viewer: Viewer,\n+ req: $Request,\n+ res: $Response,\n+): Promise<void> {\nlet navInfo;\ntry {\nnavInfo = navInfoFromURL(\n- url,\n+ req.url,\n{ now: currentDateInTimeZone(viewer.timeZone) },\n);\n} catch (e) {\n@@ -190,10 +194,10 @@ async function websiteResponder(viewer: Viewer, url: string): Promise<string> {\n}: AppState),\n);\nconst routerContext = {};\n- const rendered = renderToString(\n+ const reactStream = renderToNodeStream(\n<Provider store={store}>\n<StaticRouter\n- location={url}\n+ location={req.url}\nbasename={baseURL}\ncontext={routerContext}\n>\n@@ -210,7 +214,7 @@ async function websiteResponder(viewer: Viewer, url: string): Promise<string> {\nconst stringifiedState =\nJSON.stringify(filteredState).replace(/</g, '\\\\u003c');\n- let result = html`\n+ res.write(html`\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n@@ -249,15 +253,16 @@ async function websiteResponder(viewer: Viewer, url: string): Promise<string> {\n</head>\n<body>\n<div id=\"react-root\">\n- `;\n- result += rendered;\n- result += html`\n+ `);\n+ reactStream.pipe(res, { end: false });\n+ reactStream.on('end', () => {\n+ res.end(html`\n</div>\n<script src=\"${jsURL}\"></script>\n</body>\n</html>\n- `;\n- return result;\n+ `);\n+ });\n}\nasync function handleVerificationRequest(\n" }, { "change_type": "MODIFY", "old_path": "server/src/session/cookies.js", "new_path": "server/src/session/cookies.js", "diff": "@@ -675,7 +675,7 @@ async function createNewUserCookie(\n// This gets called after createNewUserCookie and from websiteResponder. If the\n// Viewer's sessionIdentifierType is COOKIE_ID then the cookieID is used as the\n-// session identifier; otherwise, a new ID is create for the session.\n+// session identifier; otherwise, a new ID is created for the session.\nasync function setNewSession(\nviewer: Viewer,\ncalendarQuery: CalendarQuery,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Render React using a stream to improve performance
129,187
11.10.2019 20:13:46
14,400
1d7375be40eff64ed7fa9e8831ae618caa4704c9
[server] Restructure websiteResponder into promises About to introduce something that will stream the store JSON to the browser
[ { "change_type": "MODIFY", "old_path": "server/src/responders/website-responders.js", "new_path": "server/src/responders/website-responders.js", "diff": "@@ -28,6 +28,7 @@ import { verifyField } from 'lib/types/verify-types';\nimport { mostRecentMessageTimestamp } from 'lib/shared/message-utils';\nimport { mostRecentReadThread } from 'lib/selectors/thread-selectors';\nimport { threadHasPermission } from 'lib/shared/thread-utils';\n+import { promiseAll } from 'lib/utils/promises';\nimport 'web/server-rendering';\nimport * as ReduxSetup from 'web/redux-setup';\n@@ -51,6 +52,9 @@ const { Provider } = ReactRedux;\nconst { reducer } = ReduxSetup;\nconst { Route, StaticRouter } = ReactRouter;\n+const baseURL = basePath.replace(/\\/$/, '');\n+const baseHref = baseDomain + baseURL;\n+\ntype AssetInfo = {| jsURL: string, fontsURL: string, cssInclude: string |};\nlet assetInfo: ?AssetInfo = null;\nasync function getAssetInfo() {\n@@ -84,9 +88,9 @@ async function websiteResponder(\nreq: $Request,\nres: $Response,\n): Promise<void> {\n- let navInfo;\n+ let initialNavInfo;\ntry {\n- navInfo = navInfoFromURL(\n+ initialNavInfo = navInfoFromURL(\nreq.url,\n{ now: currentDateInTimeZone(viewer.timeZone) },\n);\n@@ -95,54 +99,107 @@ async function websiteResponder(\n}\nconst calendarQuery = {\n- startDate: navInfo.startDate,\n- endDate: navInfo.endDate,\n+ startDate: initialNavInfo.startDate,\n+ endDate: initialNavInfo.endDate,\nfilters: defaultCalendarFilters,\n};\nconst threadSelectionCriteria = { joinedThreads: true };\nconst initialTime = Date.now();\n- const [\n- { threadInfos, userInfos: threadUserInfos },\n- currentUserInfo,\n- { rawEntryInfos, userInfos: entryUserInfos },\n- { rawMessageInfos, truncationStatuses, userInfos: messageUserInfos },\n- verificationResult,\n- { jsURL, fontsURL, cssInclude },\n- ] = await Promise.all([\n- fetchThreadInfos(viewer),\n- fetchCurrentUserInfo(viewer),\n- fetchEntryInfos(viewer, [ calendarQuery ]),\n- fetchMessageInfos(\n+ const assetInfoPromise = getAssetInfo();\n+ const threadInfoPromise = fetchThreadInfos(viewer);\n+ const messageInfoPromise = fetchMessageInfos(\nviewer,\nthreadSelectionCriteria,\ndefaultNumberPerThread,\n- ),\n- handleVerificationRequest(viewer, navInfo.verify),\n- getAssetInfo(),\n- viewer.loggedIn ? setNewSession(viewer, calendarQuery, initialTime) : null,\n- ]);\n+ );\n+ const entryInfoPromise = fetchEntryInfos(viewer, [ calendarQuery ]);\n+ const currentUserInfoPromise = fetchCurrentUserInfo(viewer);\n+ const serverVerificationResultPromise = handleVerificationRequest(\n+ viewer,\n+ initialNavInfo.verify,\n+ );\n- const messageStore = freshMessageStore(\n+ const sessionIDPromise = (async () => {\n+ if (viewer.loggedIn) {\n+ await setNewSession(viewer, calendarQuery, initialTime);\n+ }\n+ return viewer.sessionID;\n+ })();\n+\n+ const threadStorePromise = (async () => {\n+ const { threadInfos } = await threadInfoPromise;\n+ return { threadInfos, inconsistencyResponses: [] };\n+ })();\n+ const messageStorePromise = (async () => {\n+ const [\n+ { threadInfos },\n+ { rawMessageInfos, truncationStatuses },\n+ ] = await Promise.all([ threadInfoPromise, messageInfoPromise ] );\n+ return freshMessageStore(\nrawMessageInfos,\ntruncationStatuses,\nmostRecentMessageTimestamp(rawMessageInfos, initialTime),\nthreadInfos,\n);\n+ })();\n+ const entryStorePromise = (async () => {\n+ const { rawEntryInfos } = await entryInfoPromise;\n+ return {\n+ entryInfos: _keyBy('id')(rawEntryInfos),\n+ daysToEntries: daysToEntriesFromEntryInfos(rawEntryInfos),\n+ lastUserInteractionCalendar: initialTime,\n+ inconsistencyResponses: [],\n+ };\n+ })();\n+ const userInfoPromise = (async () => {\n+ const [\n+ { userInfos: threadUserInfos },\n+ { userInfos: messageUserInfos },\n+ { userInfos: entryUserInfos },\n+ ] = await Promise.all([\n+ threadInfoPromise,\n+ messageInfoPromise,\n+ entryInfoPromise,\n+ ]);\n+ return {\n+ ...messageUserInfos,\n+ ...entryUserInfos,\n+ ...threadUserInfos,\n+ };\n+ })();\n- const threadID = navInfo.activeChatThreadID;\n+ const navInfoPromise = (async () => {\n+ const [ { threadInfos }, messageStore ] = await Promise.all([\n+ threadInfoPromise,\n+ messageStorePromise,\n+ ]);\n+ let finalNavInfo = initialNavInfo;\n+\n+ const requestedActiveChatThreadID = finalNavInfo.activeChatThreadID;\nif (\n- threadID &&\n- !threadHasPermission(threadInfos[threadID], threadPermissions.VISIBLE)\n+ requestedActiveChatThreadID &&\n+ !threadHasPermission(\n+ threadInfos[requestedActiveChatThreadID],\n+ threadPermissions.VISIBLE,\n+ )\n) {\n- navInfo.activeChatThreadID = null;\n+ finalNavInfo.activeChatThreadID = null;\n}\n- if (!navInfo.activeChatThreadID) {\n+\n+ if (!finalNavInfo.activeChatThreadID) {\nconst mostRecentThread = mostRecentReadThread(messageStore, threadInfos);\nif (mostRecentThread) {\n- navInfo.activeChatThreadID = mostRecentThread;\n+ finalNavInfo.activeChatThreadID = mostRecentThread;\n}\n}\n+\n+ return finalNavInfo;\n+ })();\n+\n+\n+ const updateActivityPromise = (async () => {\n+ const [ navInfo ] = await Promise.all([ navInfoPromise, sessionIDPromise ]);\nconst activeThread = activeThreadFromNavInfo(navInfo);\nif (activeThread) {\nawait activityUpdater(\n@@ -150,69 +207,9 @@ async function websiteResponder(\n{ updates: [ { focus: true, threadID: activeThread } ] },\n);\n}\n+ })();\n- const baseURL = basePath.replace(/\\/$/, '');\n- const store: Store<AppState, Action> = createStore(\n- reducer,\n- ({\n- navInfo,\n- currentUserInfo,\n- sessionID: viewer.sessionID,\n- serverVerificationResult: verificationResult,\n- entryStore: {\n- entryInfos: _keyBy('id')(rawEntryInfos),\n- daysToEntries: daysToEntriesFromEntryInfos(rawEntryInfos),\n- lastUserInteractionCalendar: initialTime,\n- inconsistencyResponses: [],\n- },\n- threadStore: {\n- threadInfos,\n- inconsistencyResponses: [],\n- },\n- userInfos: {\n- ...messageUserInfos,\n- ...entryUserInfos,\n- ...threadUserInfos,\n- },\n- messageStore,\n- updatesCurrentAsOf: initialTime,\n- loadingStatuses: {},\n- calendarFilters: defaultCalendarFilters,\n- // We can use paths local to the <base href> on web\n- urlPrefix: \"\",\n- windowDimensions: { width: 0, height: 0 },\n- baseHref: baseDomain + baseURL,\n- connection: {\n- ...defaultConnectionInfo(\"web\", viewer.timeZone),\n- actualizedCalendarQuery: calendarQuery,\n- },\n- watchedThreadIDs: [],\n- foreground: true,\n- nextLocalID: 0,\n- timeZone: viewer.timeZone,\n- userAgent: viewer.userAgent,\n- }: AppState),\n- );\n- const routerContext = {};\n- const reactStream = renderToNodeStream(\n- <Provider store={store}>\n- <StaticRouter\n- location={req.url}\n- basename={baseURL}\n- context={routerContext}\n- >\n- <Route path=\"*\" component={App.default} />\n- </StaticRouter>\n- </Provider>,\n- );\n- if (routerContext.url) {\n- throw new ServerError(\"URL modified during server render!\");\n- }\n-\n- const state = store.getState();\n- const filteredState = { ...state, timeZone: null, userAgent: null };\n- const stringifiedState =\n- JSON.stringify(filteredState).replace(/</g, '\\\\u003c');\n+ const { jsURL, fontsURL, cssInclude } = await assetInfoPromise;\nres.write(html`\n<!DOCTYPE html>\n@@ -246,6 +243,42 @@ async function websiteResponder(\n<meta name=\"application-name\" content=\"SquadCal\" />\n<meta name=\"msapplication-TileColor\" content=\"#b91d47\" />\n<meta name=\"theme-color\" content=\"#b91d47\" />\n+ `);\n+\n+ const statePromises = {\n+ navInfo: navInfoPromise,\n+ currentUserInfo: currentUserInfoPromise,\n+ sessionID: sessionIDPromise,\n+ serverVerificationResult: serverVerificationResultPromise,\n+ entryStore: entryStorePromise,\n+ threadStore: threadStorePromise,\n+ userInfos: userInfoPromise,\n+ messageStore: messageStorePromise,\n+ updatesCurrentAsOf: initialTime,\n+ loadingStatuses: {},\n+ calendarFilters: defaultCalendarFilters,\n+ // We can use paths local to the <base href> on web\n+ urlPrefix: \"\",\n+ windowDimensions: { width: 0, height: 0 },\n+ baseHref,\n+ connection: {\n+ ...defaultConnectionInfo(\"web\", viewer.timeZone),\n+ actualizedCalendarQuery: calendarQuery,\n+ },\n+ watchedThreadIDs: [],\n+ foreground: true,\n+ nextLocalID: 0,\n+ timeZone: viewer.timeZone,\n+ userAgent: viewer.userAgent,\n+ cookie: undefined,\n+ deviceToken: undefined,\n+ };\n+ const state = await promiseAll(statePromises);\n+\n+ const filteredState = { ...state, timeZone: null, userAgent: null };\n+ const stringifiedState =\n+ JSON.stringify(filteredState).replace(/</g, '\\\\u003c');\n+ res.write(html`\n<script>\nvar preloadedState = ${stringifiedState};\nvar baseURL = \"${baseURL}\";\n@@ -254,7 +287,27 @@ async function websiteResponder(\n<body>\n<div id=\"react-root\">\n`);\n+\n+ await updateActivityPromise;\n+\n+ const store: Store<AppState, Action> = createStore(reducer, state);\n+ const routerContext = {};\n+ const reactStream = renderToNodeStream(\n+ <Provider store={store}>\n+ <StaticRouter\n+ location={req.url}\n+ basename={baseURL}\n+ context={routerContext}\n+ >\n+ <Route path=\"*\" component={App.default} />\n+ </StaticRouter>\n+ </Provider>,\n+ );\n+ if (routerContext.url) {\n+ throw new ServerError(\"URL modified during server render!\");\n+ }\nreactStream.pipe(res, { end: false });\n+\nreactStream.on('end', () => {\nres.end(html`\n</div>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Restructure websiteResponder into promises About to introduce something that will stream the store JSON to the browser
129,187
11.10.2019 23:19:47
14,400
b34d216089b067c17771b712f3af48494c5a533f
[server] Stream Redux JSON in websiteResponder
[ { "change_type": "ADD", "old_path": null, "new_path": "server/flow-typed/npm/JSONStream_vx.x.x.js", "diff": "+// flow-typed signature: b9558a13550357656cdaa9a6e8a2f744\n+// flow-typed version: <<STUB>>/JSONStream_v1.3.5/flow_v0.98.0\n+\n+/**\n+ * This is an autogenerated libdef stub for:\n+ *\n+ * 'JSONStream'\n+ *\n+ * Fill this stub out by replacing all the `any` types.\n+ *\n+ * Once filled out, we encourage you to share your work with the\n+ * community by sending a pull request to:\n+ * https://github.com/flowtype/flow-typed\n+ */\n+\n+declare module 'JSONStream' {\n+ declare module.exports: any;\n+}\n+\n+/**\n+ * We include stubs for each file inside this npm package in case you need to\n+ * require those files directly. Feel free to delete any files that aren't\n+ * needed.\n+ */\n+declare module 'JSONStream/bin' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/examples/all_docs' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/bool' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/browser' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/destroy_missing' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/doubledot1' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/doubledot2' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/empty' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/error_contents' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/fn' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/gen' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/header_footer' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/issues' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/keys' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/map' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/multiple_objects_error' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/multiple_objects' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/null' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/parsejson' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/run' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/stringify_object' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/stringify' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/test' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/test2' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'JSONStream/test/two-ways' {\n+ declare module.exports: any;\n+}\n+\n+// Filename aliases\n+declare module 'JSONStream/bin.js' {\n+ declare module.exports: $Exports<'JSONStream/bin'>;\n+}\n+declare module 'JSONStream/examples/all_docs.js' {\n+ declare module.exports: $Exports<'JSONStream/examples/all_docs'>;\n+}\n+declare module 'JSONStream/index' {\n+ declare module.exports: $Exports<'JSONStream'>;\n+}\n+declare module 'JSONStream/index.js' {\n+ declare module.exports: $Exports<'JSONStream'>;\n+}\n+declare module 'JSONStream/test/bool.js' {\n+ declare module.exports: $Exports<'JSONStream/test/bool'>;\n+}\n+declare module 'JSONStream/test/browser.js' {\n+ declare module.exports: $Exports<'JSONStream/test/browser'>;\n+}\n+declare module 'JSONStream/test/destroy_missing.js' {\n+ declare module.exports: $Exports<'JSONStream/test/destroy_missing'>;\n+}\n+declare module 'JSONStream/test/doubledot1.js' {\n+ declare module.exports: $Exports<'JSONStream/test/doubledot1'>;\n+}\n+declare module 'JSONStream/test/doubledot2.js' {\n+ declare module.exports: $Exports<'JSONStream/test/doubledot2'>;\n+}\n+declare module 'JSONStream/test/empty.js' {\n+ declare module.exports: $Exports<'JSONStream/test/empty'>;\n+}\n+declare module 'JSONStream/test/error_contents.js' {\n+ declare module.exports: $Exports<'JSONStream/test/error_contents'>;\n+}\n+declare module 'JSONStream/test/fn.js' {\n+ declare module.exports: $Exports<'JSONStream/test/fn'>;\n+}\n+declare module 'JSONStream/test/gen.js' {\n+ declare module.exports: $Exports<'JSONStream/test/gen'>;\n+}\n+declare module 'JSONStream/test/header_footer.js' {\n+ declare module.exports: $Exports<'JSONStream/test/header_footer'>;\n+}\n+declare module 'JSONStream/test/issues.js' {\n+ declare module.exports: $Exports<'JSONStream/test/issues'>;\n+}\n+declare module 'JSONStream/test/keys.js' {\n+ declare module.exports: $Exports<'JSONStream/test/keys'>;\n+}\n+declare module 'JSONStream/test/map.js' {\n+ declare module.exports: $Exports<'JSONStream/test/map'>;\n+}\n+declare module 'JSONStream/test/multiple_objects_error.js' {\n+ declare module.exports: $Exports<'JSONStream/test/multiple_objects_error'>;\n+}\n+declare module 'JSONStream/test/multiple_objects.js' {\n+ declare module.exports: $Exports<'JSONStream/test/multiple_objects'>;\n+}\n+declare module 'JSONStream/test/null.js' {\n+ declare module.exports: $Exports<'JSONStream/test/null'>;\n+}\n+declare module 'JSONStream/test/parsejson.js' {\n+ declare module.exports: $Exports<'JSONStream/test/parsejson'>;\n+}\n+declare module 'JSONStream/test/run.js' {\n+ declare module.exports: $Exports<'JSONStream/test/run'>;\n+}\n+declare module 'JSONStream/test/stringify_object.js' {\n+ declare module.exports: $Exports<'JSONStream/test/stringify_object'>;\n+}\n+declare module 'JSONStream/test/stringify.js' {\n+ declare module.exports: $Exports<'JSONStream/test/stringify'>;\n+}\n+declare module 'JSONStream/test/test.js' {\n+ declare module.exports: $Exports<'JSONStream/test/test'>;\n+}\n+declare module 'JSONStream/test/test2.js' {\n+ declare module.exports: $Exports<'JSONStream/test/test2'>;\n+}\n+declare module 'JSONStream/test/two-ways.js' {\n+ declare module.exports: $Exports<'JSONStream/test/two-ways'>;\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "server/flow-typed/npm/replacestream_vx.x.x.js", "diff": "+// flow-typed signature: d2e1eca711a94cd680600e80889f2ec4\n+// flow-typed version: <<STUB>>/replacestream_v4.0.3/flow_v0.98.0\n+\n+/**\n+ * This is an autogenerated libdef stub for:\n+ *\n+ * 'replacestream'\n+ *\n+ * Fill this stub out by replacing all the `any` types.\n+ *\n+ * Once filled out, we encourage you to share your work with the\n+ * community by sending a pull request to:\n+ * https://github.com/flowtype/flow-typed\n+ */\n+\n+declare module 'replacestream' {\n+ declare module.exports: any;\n+}\n+\n+/**\n+ * We include stubs for each file inside this npm package in case you need to\n+ * require those files directly. Feel free to delete any files that aren't\n+ * needed.\n+ */\n+\n+\n+// Filename aliases\n+declare module 'replacestream/index' {\n+ declare module.exports: $Exports<'replacestream'>;\n+}\n+declare module 'replacestream/index.js' {\n+ declare module.exports: $Exports<'replacestream'>;\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "server/flow-typed/npm/stream-combiner_vx.x.x.js", "diff": "+// flow-typed signature: 08fcf69d11a174e229e53dbed24a4d3c\n+// flow-typed version: <<STUB>>/stream-combiner_v0.2.2/flow_v0.98.0\n+\n+/**\n+ * This is an autogenerated libdef stub for:\n+ *\n+ * 'stream-combiner'\n+ *\n+ * Fill this stub out by replacing all the `any` types.\n+ *\n+ * Once filled out, we encourage you to share your work with the\n+ * community by sending a pull request to:\n+ * https://github.com/flowtype/flow-typed\n+ */\n+\n+declare module 'stream-combiner' {\n+ declare module.exports: any;\n+}\n+\n+/**\n+ * We include stubs for each file inside this npm package in case you need to\n+ * require those files directly. Feel free to delete any files that aren't\n+ * needed.\n+ */\n+declare module 'stream-combiner/test' {\n+ declare module.exports: any;\n+}\n+\n+// Filename aliases\n+declare module 'stream-combiner/index' {\n+ declare module.exports: $Exports<'stream-combiner'>;\n+}\n+declare module 'stream-combiner/index.js' {\n+ declare module.exports: $Exports<'stream-combiner'>;\n+}\n+declare module 'stream-combiner/test/index' {\n+ declare module.exports: $Exports<'stream-combiner/test'>;\n+}\n+declare module 'stream-combiner/test/index.js' {\n+ declare module.exports: $Exports<'stream-combiner/test'>;\n+}\n" }, { "change_type": "MODIFY", "old_path": "server/package.json", "new_path": "server/package.json", "diff": "\"nodemon\": \"^1.19.3\"\n},\n\"dependencies\": {\n+ \"JSONStream\": \"^1.3.5\",\n\"apn\": \"^2.2.0\",\n\"buffer-image-size\": \"^0.6.4\",\n\"common-tags\": \"^1.7.2\",\n\"react-router\": \"^5.1.2\",\n\"redis\": \"^2.8.0\",\n\"redux\": \"^4.0.4\",\n+ \"replacestream\": \"^4.0.3\",\n\"sharp\": \"^0.23.1\",\n\"sql-template-strings\": \"^2.2.2\",\n\"stream-cache\": \"^0.0.2\",\n+ \"stream-combiner\": \"^0.2.2\",\n\"tcomb\": \"^3.2.24\",\n\"twin-bcrypt\": \"^2.1.1\",\n\"uuid\": \"^3.3.3\",\n" }, { "change_type": "MODIFY", "old_path": "server/src/responders/website-responders.js", "new_path": "server/src/responders/website-responders.js", "diff": "@@ -45,6 +45,8 @@ import { fetchCurrentUserInfo } from '../fetchers/user-fetchers';\nimport { setNewSession } from '../session/cookies';\nimport { activityUpdater } from '../updaters/activity-updaters';\nimport urlFacts from '../../facts/url';\n+import { streamJSON, waitForStream } from '../utils/json-stream';\n+import { handleAsyncPromise } from '../responders/handlers';\nconst { basePath, baseDomain } = urlFacts;\nconst { renderToNodeStream } = ReactDOMServer;\n@@ -243,6 +245,8 @@ async function websiteResponder(\n<meta name=\"application-name\" content=\"SquadCal\" />\n<meta name=\"msapplication-TileColor\" content=\"#b91d47\" />\n<meta name=\"theme-color\" content=\"#b91d47\" />\n+ <script>\n+ var preloadedState =\n`);\nconst statePromises = {\n@@ -273,14 +277,16 @@ async function websiteResponder(\ncookie: undefined,\ndeviceToken: undefined,\n};\n- const state = await promiseAll(statePromises);\n- const filteredState = { ...state, timeZone: null, userAgent: null };\n- const stringifiedState =\n- JSON.stringify(filteredState).replace(/</g, '\\\\u003c');\n+ const filteredStatePromises = {\n+ ...statePromises,\n+ timeZone: null,\n+ userAgent: null,\n+ };\n+ const jsonStream = streamJSON(res, filteredStatePromises);\n+ await waitForStream(jsonStream);\nres.write(html`\n- <script>\n- var preloadedState = ${stringifiedState};\n+;\nvar baseURL = \"${baseURL}\";\n</script>\n</head>\n@@ -288,8 +294,7 @@ async function websiteResponder(\n<div id=\"react-root\">\n`);\n- await updateActivityPromise;\n-\n+ const state = await promiseAll(statePromises);\nconst store: Store<AppState, Action> = createStore(reducer, state);\nconst routerContext = {};\nconst reactStream = renderToNodeStream(\n@@ -307,15 +312,16 @@ async function websiteResponder(\nthrow new ServerError(\"URL modified during server render!\");\n}\nreactStream.pipe(res, { end: false });\n+ await waitForStream(reactStream);\n- reactStream.on('end', () => {\nres.end(html`\n</div>\n<script src=\"${jsURL}\"></script>\n</body>\n</html>\n`);\n- });\n+\n+ handleAsyncPromise(updateActivityPromise);\n}\nasync function handleVerificationRequest(\n" }, { "change_type": "ADD", "old_path": null, "new_path": "server/src/utils/json-stream.js", "diff": "+// @flow\n+\n+import JSONStream from 'JSONStream';\n+import replaceStream from 'replacestream';\n+import Combine from 'stream-combiner';\n+\n+type Promisable<T> = Promise<T> | T;\n+function streamJSON<T: {[key: string]: Promisable<*>}>(\n+ res: $Response,\n+ input: T,\n+): stream$Readable {\n+ const jsonStream = Combine(\n+ JSONStream.stringifyObject('{', ',', '}'),\n+ replaceStream(/</g, '\\\\u003c'),\n+ );\n+ jsonStream.pipe(res, { end: false });\n+ resolvePromisesToStream(jsonStream, input);\n+ return jsonStream;\n+}\n+\n+function resolvePromisesToStream<T: {[key: string]: Promisable<*>}>(\n+ stream: JSONStream,\n+ input: T,\n+) {\n+ const blocking = [];\n+ for (let key in input) {\n+ const value = input[key];\n+ if (value instanceof Promise) {\n+ blocking.push((async () => {\n+ const result = await value;\n+ stream.write([ key, result ]);\n+ })());\n+ } else {\n+ stream.write([ key, value ]);\n+ }\n+ }\n+ Promise.all(blocking).then(() => {\n+ stream.end();\n+ });\n+}\n+\n+function waitForStream(\n+ readable: stream$Readable,\n+): Promise<void> {\n+ return new Promise(r => {\n+ readable.on('end', r);\n+ });\n+}\n+\n+export {\n+ streamJSON,\n+ waitForStream,\n+};\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "resolved \"https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31\"\nintegrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==\n+JSONStream@^1.3.5:\n+ version \"1.3.5\"\n+ resolved \"https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0\"\n+ integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==\n+ dependencies:\n+ jsonparse \"^1.2.0\"\n+ through \">=2.2.7 <3\"\n+\nabab@^2.0.0:\nversion \"2.0.2\"\nresolved \"https://registry.yarnpkg.com/abab/-/abab-2.0.2.tgz#a2fba1b122c69a85caa02d10f9270c7219709a9d\"\n@@ -4146,6 +4154,11 @@ duplexer3@^0.1.4:\nresolved \"https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2\"\nintegrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=\n+duplexer@~0.1.1:\n+ version \"0.1.1\"\n+ resolved \"https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1\"\n+ integrity sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=\n+\nduplexify@^3.4.2, duplexify@^3.5.0, duplexify@^3.6.0:\nversion \"3.7.1\"\nresolved \"https://registry.yarnpkg.com/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309\"\n@@ -7096,6 +7109,11 @@ jsonify@~0.0.0:\nresolved \"https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73\"\nintegrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=\n+jsonparse@^1.2.0:\n+ version \"1.3.1\"\n+ resolved \"https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280\"\n+ integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=\n+\njsonwebtoken@8.1.0:\nversion \"8.1.0\"\nresolved \"https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-8.1.0.tgz#c6397cd2e5fd583d65c007a83dc7bb78e6982b83\"\n@@ -10603,6 +10621,15 @@ repeat-string@^1.6.1:\nresolved \"https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637\"\nintegrity sha1-jcrkcOHIirwtYA//Sndihtp15jc=\n+replacestream@^4.0.3:\n+ version \"4.0.3\"\n+ resolved \"https://registry.yarnpkg.com/replacestream/-/replacestream-4.0.3.tgz#3ee5798092be364b1cdb1484308492cb3dff2f36\"\n+ integrity sha512-AC0FiLS352pBBiZhd4VXB1Ab/lh0lEgpP+GGvZqbQh8a5cmXVoTe5EX/YeTFArnp4SRGTHh1qCHu9lGs1qG8sA==\n+ dependencies:\n+ escape-string-regexp \"^1.0.3\"\n+ object-assign \"^4.0.1\"\n+ readable-stream \"^2.0.2\"\n+\nrequest-promise-core@1.1.2:\nversion \"1.1.2\"\nresolved \"https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.2.tgz#339f6aababcafdb31c799ff158700336301d3346\"\n@@ -11458,6 +11485,14 @@ stream-cache@^0.0.2:\nresolved \"https://registry.yarnpkg.com/stream-cache/-/stream-cache-0.0.2.tgz#1ac5ad6832428ca55667dbdee395dad4e6db118f\"\nintegrity sha1-GsWtaDJCjKVWZ9ve45Xa1ObbEY8=\n+stream-combiner@^0.2.2:\n+ version \"0.2.2\"\n+ resolved \"https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.2.2.tgz#aec8cbac177b56b6f4fa479ced8c1912cee52858\"\n+ integrity sha1-rsjLrBd7Vrb0+kec7YwZEs7lKFg=\n+ dependencies:\n+ duplexer \"~0.1.1\"\n+ through \"~2.3.4\"\n+\nstream-each@^1.1.0:\nversion \"1.2.3\"\nresolved \"https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae\"\n@@ -11849,7 +11884,7 @@ through2@^3.0.0, through2@^3.0.1:\ndependencies:\nreadable-stream \"2 || 3\"\n-through@^2.3.6, through@^2.3.8:\n+\"through@>=2.2.7 <3\", through@^2.3.6, through@^2.3.8, through@~2.3.4:\nversion \"2.3.8\"\nresolved \"https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5\"\nintegrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Stream Redux JSON in websiteResponder
129,187
12.10.2019 03:56:01
14,400
597b1c7a3a654c5272b22d98c4a1453ac20ae3d0
[server] Try serving the prerendered HTML first
[ { "change_type": "MODIFY", "old_path": "server/src/responders/website-responders.js", "new_path": "server/src/responders/website-responders.js", "diff": "@@ -245,8 +245,9 @@ async function websiteResponder(\n<meta name=\"application-name\" content=\"SquadCal\" />\n<meta name=\"msapplication-TileColor\" content=\"#b91d47\" />\n<meta name=\"theme-color\" content=\"#b91d47\" />\n- <script>\n- var preloadedState =\n+ </head>\n+ <body>\n+ <div id=\"react-root\">\n`);\nconst statePromises = {\n@@ -278,22 +279,6 @@ async function websiteResponder(\ndeviceToken: undefined,\n};\n- const filteredStatePromises = {\n- ...statePromises,\n- timeZone: null,\n- userAgent: null,\n- };\n- const jsonStream = streamJSON(res, filteredStatePromises);\n- await waitForStream(jsonStream);\n- res.write(html`\n-;\n- var baseURL = \"${baseURL}\";\n- </script>\n- </head>\n- <body>\n- <div id=\"react-root\">\n- `);\n-\nconst state = await promiseAll(statePromises);\nconst store: Store<AppState, Action> = createStore(reducer, state);\nconst routerContext = {};\n@@ -313,9 +298,23 @@ async function websiteResponder(\n}\nreactStream.pipe(res, { end: false });\nawait waitForStream(reactStream);\n+ res.write(html`\n+ </div>\n+ <script>\n+ var preloadedState =\n+ `);\n+ const filteredStatePromises = {\n+ ...statePromises,\n+ timeZone: null,\n+ userAgent: null,\n+ };\n+ const jsonStream = streamJSON(res, filteredStatePromises);\n+ await waitForStream(jsonStream);\nres.end(html`\n- </div>\n+ ;\n+ var baseURL = \"${baseURL}\";\n+ </script>\n<script src=\"${jsURL}\"></script>\n</body>\n</html>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Try serving the prerendered HTML first
129,187
14.10.2019 19:38:33
14,400
58d67d75447d1cf53546b3b6151024a31ab1b861
Clean up package.json and scripts
[ { "change_type": "MODIFY", "old_path": "lib/package.json", "new_path": "lib/package.json", "diff": "\"name\": \"lib\",\n\"version\": \"0.0.1\",\n\"type\": \"module\",\n- \"devDependencies\": {\n- \"flow-bin\": \"^0.98.0\"\n- },\n+ \"private\": true,\n+ \"license\" : \"BSD-3-Clause\",\n\"scripts\": {\n+ \"clean\": \"rm -rf node_modules/\",\n\"flow\": \"flow; test $? -eq 0 -o $? -eq 2\"\n},\n+ \"devDependencies\": {\n+ \"flow-bin\": \"^0.98.0\"\n+ },\n\"dependencies\": {\n\"dateformat\": \"^3.0.3\",\n\"fast-json-stable-stringify\": \"^2.0.0\",\n" }, { "change_type": "DELETE", "old_path": "native/link-workspaces.js", "new_path": null, "diff": "-const findRoot = require('find-root');\n-const fs = require('fs-extra');\n-const path = require('path');\n-\n-const link = (name, fromBase, toBase) => {\n- const from = path.join(fromBase, 'node_modules', name);\n- const to = path.join(toBase, 'node_modules', name);\n-\n- if (fs.existsSync(to)) {\n- fs.removeSync(to);\n- }\n-\n- fs.symlinkSync(from, to, 'dir');\n-};\n-\n-const root = findRoot(__dirname, dir => {\n- const pkg = path.join(dir, 'package.json');\n- return fs.existsSync(pkg) && 'workspaces' in require(pkg);\n-});\n-\n-link('react-native', root, __dirname);\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"version\": \"0.0.1\",\n\"type\": \"module\",\n\"private\": true,\n+ \"license\" : \"BSD-3-Clause\",\n\"scripts\": {\n- \"postinstall\": \"node link-workspaces.js && cd ../ && patch-package && npx flow-mono create-symlinks native/.flowconfig && cd native && npx jetify\",\n+ \"clean\": \"rm -rf ios/Pods/ && rm -rf node_modules/\",\n+ \"postinstall\": \"cd ../ && patch-package && flow-mono create-symlinks native && cd native && jetify && cd ios && (pod install || true)\",\n\"dev\": \"react-native start\",\n\"test\": \"jest\",\n\"lint\": \"eslint .\",\n\"logfirebase\": \"adb shell logcat | grep -E -i 'FIRMessagingModule|firebase'\"\n},\n+ \"devDependencies\": {\n+ \"@babel/core\": \"^7.6.2\",\n+ \"@babel/runtime\": \"^7.6.2\",\n+ \"@react-native-community/eslint-config\": \"^0.0.5\",\n+ \"babel-jest\": \"^24.9.0\",\n+ \"babel-plugin-transform-remove-console\": \"^6.8.5\",\n+ \"babel-plugin-transform-remove-strict-mode\": \"0.0.2\",\n+ \"eslint\": \"^6.4.0\",\n+ \"flow-bin\": \"^0.98.0\",\n+ \"flow-mono-cli\": \"^1.5.0\",\n+ \"fs-extra\": \"^8.1.0\",\n+ \"get-yarn-workspaces\": \"^1.0.2\",\n+ \"jest\": \"^24.9.0\",\n+ \"jetifier\": \"^1.6.4\",\n+ \"metro-react-native-babel-preset\": \"^0.56.0\",\n+ \"patch-package\": \"^6.1.2\",\n+ \"postinstall-postinstall\": \"^2.0.0\",\n+ \"react-test-renderer\": \"16.8.6\"\n+ },\n\"dependencies\": {\n\"@react-native-community/async-storage\": \"^1.6.1\",\n\"@react-native-community/cameraroll\": \"^1.2.1\",\n\"shallowequal\": \"^1.0.2\",\n\"tinycolor2\": \"^1.4.1\"\n},\n- \"devDependencies\": {\n- \"@babel/core\": \"^7.6.2\",\n- \"@babel/runtime\": \"^7.6.2\",\n- \"@react-native-community/eslint-config\": \"^0.0.5\",\n- \"babel-jest\": \"^24.9.0\",\n- \"babel-plugin-transform-remove-console\": \"^6.8.5\",\n- \"babel-plugin-transform-remove-strict-mode\": \"0.0.2\",\n- \"eslint\": \"^6.4.0\",\n- \"flow-bin\": \"^0.98.0\",\n- \"flow-mono-cli\": \"^1.5.0\",\n- \"fs-extra\": \"^8.1.0\",\n- \"get-yarn-workspaces\": \"^1.0.2\",\n- \"jest\": \"^24.9.0\",\n- \"jetifier\": \"^1.6.4\",\n- \"metro-react-native-babel-preset\": \"^0.56.0\",\n- \"postinstall-postinstall\": \"^2.0.0\",\n- \"react-test-renderer\": \"16.8.6\"\n- },\n\"jest\": {\n\"preset\": \"react-native\"\n}\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "{\n\"private\": true,\n+ \"license\" : \"BSD-3-Clause\",\n\"workspaces\": [\n\"lib\",\n\"web\",\n\"native\",\n\"server\"\n],\n- \"devDependencies\": {\n- \"patch-package\": \"^6.1.2\",\n- \"postinstall-postinstall\": \"^2.0.0\"\n- },\n\"scripts\": {\n- \"clean\": \"rm -rf node_modules/ && rm -rf lib/node_modules/ && rm -rf web/node_modules/ && rm -rf native/node_modules/ && rm -rf server/node_modules/ && rm -rf web/dist/ && rm -rf server/dist/ && mkdir server/dist && rm -rf native/ios/Pods\",\n- \"cleaninstall\": \"npm run clean && yarn && cd native/ios && (pod install || true)\",\n- \"postinstall\": \"patch-package\"\n+ \"clean\": \"yarn workspace lib clean && yarn workspace web clean && yarn workspace native clean && yarn workspace server clean && rm -rf node_modules/\",\n+ \"cleaninstall\": \"yarn clean && yarn\"\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "server/package.json", "new_path": "server/package.json", "diff": "\"name\": \"server\",\n\"version\": \"0.0.1\",\n\"type\": \"module\",\n- \"description\": \"\",\n+ \"private\": true,\n+ \"license\" : \"BSD-3-Clause\",\n\"main\": \"dist/server\",\n\"scripts\": {\n+ \"clean\": \"rm -rf dist/ && rm -rf node_modules/ && mkdir dist\",\n\"babel\": \"babel src/ --out-dir dist/ --config-file ./.babelrc --verbose --ignore 'src/lib/flow-typed','src/lib/node_modules','src/lib/package.json','src/web/flow-typed','src/web/node_modules','src/web/package.json','src/web/dist','src/web/webpack.config.js','src/web/account-bar.react.js','src/web/app.react.js','src/web/calendar','src/web/chat','src/web/flow','src/web/loading-indicator.react.js','src/web/modals','src/web/root.js','src/web/router-history.js','src/web/script.js','src/web/selectors/chat-selectors.js','src/web/selectors/entry-selectors.js','src/web/splash','src/web/vector-utils.js','src/web/vectors.react.js'\",\n\"rsync\": \"rsync -rLpmuv --exclude '*/package.json' --exclude '*/node_modules/*' --include '*.json' --include '*.cjs' --exclude '*.*' src/ dist/\",\n- \"prod-build\": \"npm run babel && npm run rsync && npm run update-geoip\",\n- \"update-geoip\": \"cd ../node_modules/geoip-lite && npm run updatedb\",\n+ \"prod-build\": \"yarn babel && yarn rsync && yarn update-geoip\",\n+ \"update-geoip\": \"cd ../node_modules/geoip-lite && yarn updatedb\",\n\"prod\": \"node --experimental-modules --loader ./loader.mjs --es-module-specifier-resolution node dist/server\",\n- \"dev-rsync\": \"chokidar --initial --silent -s 'src/**/*.json' 'src/**/*.cjs' -c 'npm run rsync > /dev/null 2>&1'\",\n- \"dev\": \"NODE_ENV=dev concurrently --names=\\\"BABEL,RSYNC,NODEM\\\" -c \\\"bgBlue.bold,bgMagenta.bold,bgGreen.bold\\\" \\\"npm run babel -- --watch\\\" \\\"npm run dev-rsync\\\" \\\"nodemon -e js,json,cjs --watch dist --experimental-modules --loader ./loader.mjs --es-module-specifier-resolution node dist/server\\\"\",\n+ \"dev-rsync\": \"chokidar --initial --silent -s 'src/**/*.json' 'src/**/*.cjs' -c 'yarn rsync > /dev/null 2>&1'\",\n+ \"dev\": \"NODE_ENV=dev concurrently --names=\\\"BABEL,RSYNC,NODEM\\\" -c \\\"bgBlue.bold,bgMagenta.bold,bgGreen.bold\\\" \\\"yarn babel -- --watch\\\" \\\"yarn dev-rsync\\\" \\\"nodemon -e js,json,cjs --watch dist --experimental-modules --loader ./loader.mjs --es-module-specifier-resolution node dist/server\\\"\",\n\"script\": \"node --experimental-modules --loader ./loader.mjs\"\n},\n- \"author\": \"\",\n- \"license\": \"ISC\",\n\"devDependencies\": {\n\"@babel/cli\": \"^7.6.2\",\n\"@babel/core\": \"^7.6.2\",\n\"uuid\": \"^3.3.3\",\n\"web\": \"0.0.1\"\n},\n- \"nodemonConfig\": {\n- \"delay\": \"200\"\n- },\n\"optionalDependencies\": {\n\"bufferutil\": \"^4.0.1\",\n\"utf-8-validate\": \"^5.0.2\"\n+ },\n+ \"nodemonConfig\": {\n+ \"delay\": \"200\"\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "web/package.json", "new_path": "web/package.json", "diff": "\"name\": \"web\",\n\"version\": \"0.0.1\",\n\"type\": \"module\",\n+ \"private\": true,\n+ \"license\" : \"BSD-3-Clause\",\n+ \"scripts\": {\n+ \"clean\": \"rm -rf dist/ && rm -rf node_modules/\",\n+ \"dev\": \"concurrently --names=\\\"NODESSR,BROWSER\\\" -c \\\"bgBlue.bold,bgMagenta.bold\\\" \\\"webpack --config-name=server --watch\\\" \\\"webpack-dev-server --hot --config-name=browser\\\"\",\n+ \"prod\": \"webpack --env prod --progress\",\n+ \"flow\": \"flow; test $? -eq 0 -o $? -eq 2\"\n+ },\n\"devDependencies\": {\n\"@babel/core\": \"^7.2.2\",\n\"@babel/plugin-proposal-class-properties\": \"^7.2.3\",\n\"webpack-cli\": \"^3.3.9\",\n\"webpack-dev-server\": \"^3.8.2\"\n},\n- \"scripts\": {\n- \"dev\": \"concurrently --names=\\\"NODESSR,BROWSER\\\" -c \\\"bgBlue.bold,bgMagenta.bold\\\" \\\"webpack --config-name=server --watch\\\" \\\"webpack-dev-server --hot --config-name=browser\\\"\",\n- \"prod\": \"webpack --env prod --progress\",\n- \"flow\": \"flow; test $? -eq 0 -o $? -eq 2\"\n- },\n\"dependencies\": {\n\"@babel/polyfill\": \"^7.2.5\",\n\"@fortawesome/fontawesome-svg-core\": \"^1.2.25\",\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Clean up package.json and scripts
129,187
14.10.2019 22:40:11
14,400
27903d9852780164ee74a8b44aaa6481f6f5cf0e
[server] Updated pull script
[ { "change_type": "ADD", "old_path": null, "new_path": "server/bash/pull.sh", "diff": "+#!/bin/bash\n+\n+# run as: ssh user on root wheel\n+# run from: wherever\n+# param: path to link to\n+\n+# The maximum amount of space to spend on checkouts. By default we leave around\n+# old deployments in case we want to roll back. The limit includes the current\n+# prod checkout, but will never delete prod.\n+MAX_DISK_USAGE_KB=3145728 # 3 GiB\n+\n+# The user that spawns the Node server\n+DAEMON_USER=squadcal\n+\n+# Input to git clone\n+GIT_CLONE_PARAMS=https://github.com/Ashoat/squadcal.git\n+\n+set -e\n+[[ `whoami` = root ]] || exec sudo su -c $0\n+\n+# STEP 1: clone source into new directory\n+CHECKOUT_PATH=$1.$(date +%F-%H:%I)\n+rm -rf \"$CHECKOUT_PATH\" # badass. risky\n+mkdir -p \"$CHECKOUT_PATH\"\n+chown $DAEMON_USER:$DAEMON_USER \"$CHECKOUT_PATH\"\n+su $DAEMON_USER -c \"git clone $GIT_CLONE_PARAMS '$CHECKOUT_PATH'\"\n+cd \"$CHECKOUT_PATH\"\n+su $DAEMON_USER -c \"server/bash/setup.sh\"\n+\n+# STEP 2: test if the binary crashes within 60 seconds\n+set +e\n+su $DAEMON_USER -c \"cd server && PORT=3001 timeout 60 bash/run-nvm.sh\"\n+[[ $? -eq 124 ]] || exit 1\n+set -e\n+\n+# STEP 3: flip it over\n+systemctl stop squadcal || true\n+rm \"$1\"\n+ln -s \"$CHECKOUT_PATH\" \"$1\"\n+chown -h $DAEMON_USER:$DAEMON_USER \"$1\"\n+systemctl restart squadcal\n+\n+# STEP 4: clean out old checkouts\n+checkouts=($(ls -dtr \"$1\".*))\n+for checkout in \"${checkouts[@]}\"; do\n+ if [[ \"$checkout\" = \"$CHECKOUT_PATH\" ]]; then\n+ break\n+ fi\n+ TOTAL_USAGE=$(sudo du -cs $1* | grep total | awk '{ print $1 }')\n+ if [[ $TOTAL_USAGE -le $MAX_DISK_USAGE_KB ]]; then\n+ break\n+ fi\n+ rm -rf \"$checkout\"\n+done\n" }, { "change_type": "MODIFY", "old_path": "server/bash/run-nvm.sh", "new_path": "server/bash/run-nvm.sh", "diff": "#!/bin/bash\n+\n+# run as: node user\n+# run from: server dir\n+\n+set -e\n+\n. ~/.nvm/nvm.sh\nnvm exec npm run prod\n" }, { "change_type": "ADD", "old_path": null, "new_path": "server/bash/setup.sh", "diff": "+#!/bin/bash\n+\n+# run as: node user\n+# run from: root of repo\n+\n+set -e\n+\n+. ~/.nvm/nvm.sh\n+\n+chmod -R u=rwX,g=rX,o=rX .\n+chmod -R u=rwX,g=,o= server/secrets\n+\n+pushd server && nvm install && popd\n+yarn cleaninstall\n+yarn workspace web prod\n+yarn workspace server prod-build\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Updated pull script
129,187
15.10.2019 02:58:18
14,400
b215c766158ac71b44620bcba5d71941263d1c19
[server] Fix for deploy script
[ { "change_type": "RENAME", "old_path": "server/bash/pull.sh", "new_path": "server/bash/deploy.sh", "diff": "@@ -16,7 +16,7 @@ DAEMON_USER=squadcal\nGIT_CLONE_PARAMS=https://github.com/Ashoat/squadcal.git\nset -e\n-[[ `whoami` = root ]] || exec sudo su -c $0\n+[[ `whoami` = root ]] || exec sudo su -c \"$0 $1\"\n# STEP 1: clone source into new directory\nCHECKOUT_PATH=$1.$(date +%F-%H:%I)\n@@ -25,6 +25,7 @@ mkdir -p \"$CHECKOUT_PATH\"\nchown $DAEMON_USER:$DAEMON_USER \"$CHECKOUT_PATH\"\nsu $DAEMON_USER -c \"git clone $GIT_CLONE_PARAMS '$CHECKOUT_PATH'\"\ncd \"$CHECKOUT_PATH\"\n+su $DAEMON_USER -c \"cp -r '$1'/server/secrets '$CHECKOUT_PATH'/server/secrets\"\nsu $DAEMON_USER -c \"server/bash/setup.sh\"\n# STEP 2: test if the binary crashes within 60 seconds\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Fix for deploy script
129,187
15.10.2019 02:58:42
14,400
ce2ffe706707b5fa73becd511cd3c9da2c3eceab
Prefix all node_modules/.bin commands with yarn
[ { "change_type": "MODIFY", "old_path": "lib/package.json", "new_path": "lib/package.json", "diff": "\"license\" : \"BSD-3-Clause\",\n\"scripts\": {\n\"clean\": \"rm -rf node_modules/\",\n- \"flow\": \"flow; test $? -eq 0 -o $? -eq 2\"\n+ \"flow\": \"yarn flow; test $? -eq 0 -o $? -eq 2\"\n},\n\"devDependencies\": {\n\"flow-bin\": \"^0.98.0\"\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"license\" : \"BSD-3-Clause\",\n\"scripts\": {\n\"clean\": \"rm -rf ios/Pods/ && rm -rf node_modules/\",\n- \"postinstall\": \"cd ../ && patch-package && flow-mono create-symlinks native && cd native && jetify && cd ios && (pod install || true)\",\n- \"dev\": \"react-native start\",\n- \"test\": \"jest\",\n- \"lint\": \"eslint .\",\n+ \"postinstall\": \"cd ../ && yarn patch-package && yarn flow-mono create-symlinks native && cd native && yarn jetify && cd ios && (pod install || true)\",\n+ \"dev\": \"yarn react-native start\",\n+ \"test\": \"yarn jest\",\n+ \"lint\": \"yarn eslint .\",\n\"logfirebase\": \"adb shell logcat | grep -E -i 'FIRMessagingModule|firebase'\"\n},\n\"devDependencies\": {\n" }, { "change_type": "MODIFY", "old_path": "server/package.json", "new_path": "server/package.json", "diff": "\"main\": \"dist/server\",\n\"scripts\": {\n\"clean\": \"rm -rf dist/ && rm -rf node_modules/ && mkdir dist\",\n- \"babel\": \"babel src/ --out-dir dist/ --config-file ./.babelrc --verbose --ignore 'src/lib/flow-typed','src/lib/node_modules','src/lib/package.json','src/web/flow-typed','src/web/node_modules','src/web/package.json','src/web/dist','src/web/webpack.config.js','src/web/account-bar.react.js','src/web/app.react.js','src/web/calendar','src/web/chat','src/web/flow','src/web/loading-indicator.react.js','src/web/modals','src/web/root.js','src/web/router-history.js','src/web/script.js','src/web/selectors/chat-selectors.js','src/web/selectors/entry-selectors.js','src/web/splash','src/web/vector-utils.js','src/web/vectors.react.js'\",\n+ \"babel-build\": \"yarn --silent babel src/ --out-dir dist/ --config-file ./.babelrc --verbose --ignore 'src/lib/flow-typed','src/lib/node_modules','src/lib/package.json','src/web/flow-typed','src/web/node_modules','src/web/package.json','src/web/dist','src/web/webpack.config.js','src/web/account-bar.react.js','src/web/app.react.js','src/web/calendar','src/web/chat','src/web/flow','src/web/loading-indicator.react.js','src/web/modals','src/web/root.js','src/web/router-history.js','src/web/script.js','src/web/selectors/chat-selectors.js','src/web/selectors/entry-selectors.js','src/web/splash','src/web/vector-utils.js','src/web/vectors.react.js'\",\n\"rsync\": \"rsync -rLpmuv --exclude '*/package.json' --exclude '*/node_modules/*' --include '*.json' --include '*.cjs' --exclude '*.*' src/ dist/\",\n- \"prod-build\": \"yarn babel && yarn rsync && yarn update-geoip\",\n+ \"prod-build\": \"yarn babel-build && yarn rsync && yarn update-geoip\",\n\"update-geoip\": \"cd ../node_modules/geoip-lite && yarn updatedb\",\n\"prod\": \"node --experimental-modules --loader ./loader.mjs --es-module-specifier-resolution node dist/server\",\n- \"dev-rsync\": \"chokidar --initial --silent -s 'src/**/*.json' 'src/**/*.cjs' -c 'yarn rsync > /dev/null 2>&1'\",\n- \"dev\": \"NODE_ENV=dev concurrently --names=\\\"BABEL,RSYNC,NODEM\\\" -c \\\"bgBlue.bold,bgMagenta.bold,bgGreen.bold\\\" \\\"yarn babel -- --watch\\\" \\\"yarn dev-rsync\\\" \\\"nodemon -e js,json,cjs --watch dist --experimental-modules --loader ./loader.mjs --es-module-specifier-resolution node dist/server\\\"\",\n- \"script\": \"node --experimental-modules --loader ./loader.mjs\"\n+ \"dev-rsync\": \"yarn --silent chokidar --initial --silent -s 'src/**/*.json' 'src/**/*.cjs' -c 'yarn rsync > /dev/null 2>&1'\",\n+ \"dev\": \"NODE_ENV=dev yarn concurrently --names=\\\"BABEL,RSYNC,NODEM\\\" -c \\\"bgBlue.bold,bgMagenta.bold,bgGreen.bold\\\" \\\"yarn babel-build -- --watch\\\" \\\"yarn dev-rsync\\\" \\\"nodemon -e js,json,cjs --watch dist --experimental-modules --loader ./loader.mjs --es-module-specifier-resolution node dist/server\\\"\",\n+ \"script\": \"node --experimental-modules --loader ./loader.mjs --es-module-specifier-resolution node\"\n},\n\"devDependencies\": {\n\"@babel/cli\": \"^7.6.2\",\n" }, { "change_type": "MODIFY", "old_path": "web/package.json", "new_path": "web/package.json", "diff": "\"license\" : \"BSD-3-Clause\",\n\"scripts\": {\n\"clean\": \"rm -rf dist/ && rm -rf node_modules/\",\n- \"dev\": \"concurrently --names=\\\"NODESSR,BROWSER\\\" -c \\\"bgBlue.bold,bgMagenta.bold\\\" \\\"webpack --config-name=server --watch\\\" \\\"webpack-dev-server --hot --config-name=browser\\\"\",\n- \"prod\": \"webpack --env prod --progress\",\n- \"flow\": \"flow; test $? -eq 0 -o $? -eq 2\"\n+ \"dev\": \"yarn concurrently --names=\\\"NODESSR,BROWSER\\\" -c \\\"bgBlue.bold,bgMagenta.bold\\\" \\\"yarn webpack --config-name=server --watch\\\" \\\"yarn webpack-dev-server --hot --config-name=browser\\\"\",\n+ \"prod\": \"yarn webpack --env prod --progress\",\n+ \"flow\": \"yarn flow; test $? -eq 0 -o $? -eq 2\"\n},\n\"devDependencies\": {\n\"@babel/core\": \"^7.2.2\",\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Prefix all node_modules/.bin commands with yarn
129,187
15.10.2019 02:59:45
14,400
639453f661a566fc7db4492300145aea88a95df5
[server] Node 12.12
[ { "change_type": "MODIFY", "old_path": "server/.nvmrc", "new_path": "server/.nvmrc", "diff": "-12.11\n+12.12\n" }, { "change_type": "MODIFY", "old_path": "server/package.json", "new_path": "server/package.json", "diff": "\"rsync\": \"rsync -rLpmuv --exclude '*/package.json' --exclude '*/node_modules/*' --include '*.json' --include '*.cjs' --exclude '*.*' src/ dist/\",\n\"prod-build\": \"yarn babel-build && yarn rsync && yarn update-geoip\",\n\"update-geoip\": \"cd ../node_modules/geoip-lite && yarn updatedb\",\n- \"prod\": \"node --experimental-modules --loader ./loader.mjs --es-module-specifier-resolution node dist/server\",\n+ \"prod\": \"node --experimental-modules --experimental-json-modules --loader ./loader.mjs --es-module-specifier-resolution node dist/server\",\n\"dev-rsync\": \"yarn --silent chokidar --initial --silent -s 'src/**/*.json' 'src/**/*.cjs' -c 'yarn rsync > /dev/null 2>&1'\",\n- \"dev\": \"NODE_ENV=dev yarn concurrently --names=\\\"BABEL,RSYNC,NODEM\\\" -c \\\"bgBlue.bold,bgMagenta.bold,bgGreen.bold\\\" \\\"yarn babel-build -- --watch\\\" \\\"yarn dev-rsync\\\" \\\"nodemon -e js,json,cjs --watch dist --experimental-modules --loader ./loader.mjs --es-module-specifier-resolution node dist/server\\\"\",\n- \"script\": \"node --experimental-modules --loader ./loader.mjs --es-module-specifier-resolution node\"\n+ \"dev\": \"NODE_ENV=dev yarn concurrently --names=\\\"BABEL,RSYNC,NODEM\\\" -c \\\"bgBlue.bold,bgMagenta.bold,bgGreen.bold\\\" \\\"yarn babel-build -- --watch\\\" \\\"yarn dev-rsync\\\" \\\"nodemon -e js,json,cjs --watch dist --experimental-modules --experimental-json-modules --loader ./loader.mjs --es-module-specifier-resolution node dist/server\\\"\",\n+ \"script\": \"node --experimental-modules --experimental-json-modules --loader ./loader.mjs --es-module-specifier-resolution node\"\n},\n\"devDependencies\": {\n\"@babel/cli\": \"^7.6.2\",\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Node 12.12
129,187
15.10.2019 03:17:16
14,400
1b765de5241695b94efd41ce8d4d917709f7700f
[server] Copy facts over in deploy script as well
[ { "change_type": "MODIFY", "old_path": "server/bash/deploy.sh", "new_path": "server/bash/deploy.sh", "diff": "@@ -24,8 +24,9 @@ rm -rf \"$CHECKOUT_PATH\" # badass. risky\nmkdir -p \"$CHECKOUT_PATH\"\nchown $DAEMON_USER:$DAEMON_USER \"$CHECKOUT_PATH\"\nsu $DAEMON_USER -c \"git clone $GIT_CLONE_PARAMS '$CHECKOUT_PATH'\"\n-cd \"$CHECKOUT_PATH\"\nsu $DAEMON_USER -c \"cp -r '$1'/server/secrets '$CHECKOUT_PATH'/server/secrets\"\n+su $DAEMON_USER -c \"cp -r '$1'/server/facts '$CHECKOUT_PATH'/server/facts\"\n+cd \"$CHECKOUT_PATH\"\nsu $DAEMON_USER -c \"server/bash/setup.sh\"\n# STEP 2: test if the binary crashes within 60 seconds\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Copy facts over in deploy script as well
129,187
15.10.2019 03:23:58
14,400
37c2853c7ae5d3fcc030b2dac71ff2ebdb61781b
[server] Fix date format in deploy script
[ { "change_type": "MODIFY", "old_path": "server/bash/deploy.sh", "new_path": "server/bash/deploy.sh", "diff": "@@ -19,7 +19,7 @@ set -e\n[[ `whoami` = root ]] || exec sudo su -c \"$0 $1\"\n# STEP 1: clone source into new directory\n-CHECKOUT_PATH=$1.$(date +%F-%H:%I)\n+CHECKOUT_PATH=$1.$(date +%F-%H:%M)\nrm -rf \"$CHECKOUT_PATH\" # badass. risky\nmkdir -p \"$CHECKOUT_PATH\"\nchown $DAEMON_USER:$DAEMON_USER \"$CHECKOUT_PATH\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Fix date format in deploy script
129,187
15.10.2019 16:32:57
14,400
2aeccfb24d17f0fd6ba937419bd8f4b564b2b3ca
[native] Vibrate when showing an in-app notification
[ { "change_type": "MODIFY", "old_path": "native/push/push-handler.react.js", "new_path": "native/push/push-handler.react.js", "diff": "@@ -30,6 +30,7 @@ import {\nPlatform,\nAppState as NativeAppState,\nAlert,\n+ Vibration,\n} from 'react-native';\nimport NotificationsIOS from 'react-native-notifications';\nimport { Notification as InAppNotification } from 'react-native-in-app-message';\n@@ -261,6 +262,7 @@ class PushHandler extends React.PureComponent<Props, State> {\nthis.state.inAppNotifProps &&\nthis.state.inAppNotifProps !== prevState.inAppNotifProps\n) {\n+ Vibration.vibrate(400);\nInAppNotification.show();\n}\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Vibrate when showing an in-app notification
129,187
15.10.2019 17:15:32
14,400
8a8cb1fb0e4f4ac64f0106582c7846686aa5b600
[native] Reload ImageGalleryKeyboard on foreground
[ { "change_type": "MODIFY", "old_path": "native/media/image-gallery-keyboard.react.js", "new_path": "native/media/image-gallery-keyboard.react.js", "diff": "@@ -22,6 +22,7 @@ import invariant from 'invariant';\nimport { Provider } from 'react-redux';\nimport CameraRoll from '@react-native-community/cameraroll';\nimport Icon from 'react-native-vector-icons/FontAwesome';\n+import PropTypes from 'prop-types';\nimport { connect } from 'lib/utils/redux-utils';\nimport { mimeTypesToMediaTypes } from 'lib/utils/file-utils';\n@@ -42,6 +43,7 @@ const animationSpec = {\ntype Props = {|\n// Redux state\nscreenDimensions: Dimensions,\n+ foreground: bool,\n|};\ntype State = {|\nimageInfos: ?$ReadOnlyArray<GalleryImageInfo>,\n@@ -57,6 +59,7 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\nstatic propTypes = {\nscreenDimensions: dimensionsPropType.isRequired,\n+ foreground: PropTypes.bool.isRequired,\n};\nmounted = false;\nfetchingPhotos = false;\n@@ -65,6 +68,7 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\nqueueModeProgress = new Animated.Value(0);\nsendButtonStyle: ViewStyle;\nimagesSelected = false;\n+ androidPermissionsGranted: bool | void;\nconstructor(props: Props) {\nsuper(props);\n@@ -126,6 +130,7 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\nconst { flatList, viewableIndices } = this;\nconst { imageInfos, focusedImageURI } = this.state;\n+ let scrollingSomewhere = false;\nif (flatList && imageInfos) {\nlet newURI;\nif (focusedImageURI && focusedImageURI !== prevState.focusedImageURI) {\n@@ -149,12 +154,30 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\n}\nif (index !== null && index !== undefined) {\nif (index === viewableIndices[0]) {\n+ scrollingSomewhere = true;\nflatList.scrollToIndex({ index });\n} else if (index === viewableIndices[viewableIndices.length - 1]) {\n+ scrollingSomewhere = true;\nflatList.scrollToIndex({ index, viewPosition: 1 });\n}\n}\n}\n+\n+ if (this.props.foreground && !prevProps.foreground) {\n+ this.fetchPhotos();\n+ }\n+\n+ if (\n+ !scrollingSomewhere &&\n+ this.flatList &&\n+ this.state.imageInfos &&\n+ prevState.imageInfos &&\n+ this.state.imageInfos.length > 0 &&\n+ prevState.imageInfos.length > 0 &&\n+ this.state.imageInfos[0].uri !== prevState.imageInfos[0].uri\n+ ) {\n+ this.flatList.scrollToIndex({ index: 0 });\n+ }\n}\nguardedSetState(change) {\n@@ -192,32 +215,54 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\nconst { edges, page_info } = await CameraRoll.getPhotos(\nImageGalleryKeyboard.getPhotosQuery(after),\n);\n+\n+ let firstRemoved = false, lastRemoved = false;\n+\nconst imageURIs = this.state.imageInfos\n? this.state.imageInfos.map(({ uri }) => uri)\n: [];\nconst existingURIs = new Set(imageURIs);\n+ let first = true;\nconst imageInfos = edges.map(\n({ node }) => {\nconst { uri, height, width } = node.image;\nif (existingURIs.has(uri)) {\n+ if (first) {\n+ firstRemoved = true;\n+ }\n+ lastRemoved = true;\n+ first = false;\nreturn null;\n}\n+ first = false;\n+ lastRemoved = false;\nexistingURIs.add(uri);\nreturn { uri, height, width };\n},\n).filter(Boolean);\n- this.guardedSetState((prevState: State) => {\n- const updatedImageInfos = prevState.imageInfos\n- ? [ ...prevState.imageInfos, ...imageInfos ]\n- : imageInfos;\n- const cursor = page_info.has_next_page\n- ? page_info.end_cursor\n- : null;\n- return {\n- imageInfos: updatedImageInfos,\n+\n+ let appendOrPrepend = after ? \"append\" : \"prepend\";\n+ if (firstRemoved && !lastRemoved) {\n+ appendOrPrepend = \"append\";\n+ } else if (!firstRemoved && lastRemoved) {\n+ appendOrPrepend = \"prepend\";\n+ }\n+\n+ let newImageInfos = imageInfos;\n+ if (this.state.imageInfos) {\n+ if (appendOrPrepend === \"prepend\") {\n+ newImageInfos = [ ...newImageInfos, ...this.state.imageInfos ];\n+ } else {\n+ newImageInfos = [ ...this.state.imageInfos, ...newImageInfos ];\n+ }\n+ }\n+\n+ this.guardedSetState({\n+ imageInfos: newImageInfos,\nerror: null,\n- cursor,\n- };\n+ cursor: page_info.has_next_page\n+ ? page_info.end_cursor\n+ : null,\n});\n} catch (e) {\nthis.guardedSetState({\n@@ -228,7 +273,10 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\nthis.fetchingPhotos = false;\n}\n- async getAndroidPermissions() {\n+ async getAndroidPermissions(): Promise<bool> {\n+ if (this.androidPermissionsGranted !== undefined) {\n+ return this.androidPermissionsGranted;\n+ }\ntry {\nconst granted = await PermissionsAndroid.request(\nPermissionsAndroid.PERMISSIONS.READ_EXTERNAL_STORAGE,\n@@ -240,11 +288,12 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\nif (granted !== PermissionsAndroid.RESULTS.GRANTED) {\nthrow new Error('android_permissions');\n}\n- return true;\n+ this.androidPermissionsGranted = true;\n} catch (err) {\nthis.guardedSetState({ error: \"don't have permissions :(\" });\n- return false;\n+ this.androidPermissionsGranted = false;\n}\n+ return this.androidPermissionsGranted;\n}\nget queueModeActive() {\n@@ -500,7 +549,8 @@ const styles = StyleSheet.create({\nconst ReduxConnectedImageGalleryKeyboard = connect(\n(state: AppState) => ({\n- screenDimensions: dimensionsSelector(state)\n+ screenDimensions: dimensionsSelector(state),\n+ foreground: state.foreground,\n}),\n)(ImageGalleryKeyboard);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Reload ImageGalleryKeyboard on foreground
129,187
15.10.2019 18:14:40
14,400
ffeb1c6986c20bd6834e3bbd7e1e661f8dc6b4e1
[native] Pass Message responder props on to View This ensures that the `TouchableWithoutFeedback` in `Message` works properly
[ { "change_type": "MODIFY", "old_path": "native/chat/composed-message.react.js", "new_path": "native/chat/composed-message.react.js", "diff": "@@ -23,6 +23,7 @@ type Props = {|\nchildren: React.Node,\n// Redux state\ncomposedMessageMaxWidth: number,\n+ ...React.ElementProps<typeof View>,\n|};\nclass ComposedMessage extends React.PureComponent<Props> {\n@@ -36,7 +37,7 @@ class ComposedMessage extends React.PureComponent<Props> {\nrender() {\nassertComposableMessageType(this.props.item.messageInfo.type);\n- const { item, focused } = this.props;\n+ const { item, focused, sendFailed, children, ...viewProps } = this.props;\nconst { id, creator } = item.messageInfo;\nconst { isViewer } = creator;\n@@ -58,7 +59,7 @@ class ComposedMessage extends React.PureComponent<Props> {\nlet deliveryIconColor = item.threadInfo.color;\nif (id !== null && id !== undefined) {\ndeliveryIconName = \"check-circle\";\n- } else if (this.props.sendFailed) {\n+ } else if (sendFailed) {\ndeliveryIconName = \"x-circle\";\ndeliveryIconColor = \"FF0000\";\nfailedSendInfo = <FailedSend item={item} />;\n@@ -76,12 +77,12 @@ class ComposedMessage extends React.PureComponent<Props> {\n}\nreturn (\n- <View>\n+ <View {...viewProps}>\n<MessageHeader item={item} focused={focused} color=\"dark\" />\n<View style={containerStyle}>\n<View style={[ styles.content, alignStyle ]}>\n<View style={[ styles.messageBox, messageBoxStyle, alignStyle ]}>\n- {this.props.children}\n+ {children}\n</View>\n{deliveryIcon}\n</View>\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-message.react.js", "new_path": "native/chat/multimedia-message.react.js", "diff": "@@ -156,6 +156,7 @@ type Props = {|\nverticalBounds: ?VerticalBounds,\n// withLightboxPositionContext\nlightboxPosition: ?Animated.Value,\n+ ...React.ElementProps<typeof View>,\n|};\nclass MultimediaMessage extends React.PureComponent<Props> {\n@@ -169,12 +170,22 @@ class MultimediaMessage extends React.PureComponent<Props> {\n};\nrender() {\n- const heightStyle = { height: this.props.item.contentHeight };\n+ const {\n+ item,\n+ navigation,\n+ focused,\n+ toggleFocus,\n+ verticalBounds,\n+ lightboxPosition,\n+ ...viewProps\n+ } = this.props;\n+ const heightStyle = { height: item.contentHeight };\nreturn (\n<ComposedMessage\n- item={this.props.item}\n- sendFailed={sendFailed(this.props.item)}\n- focused={this.props.focused}\n+ item={item}\n+ sendFailed={sendFailed(item)}\n+ focused={focused}\n+ {...viewProps}\n>\n<View style={[heightStyle, styles.container]}>\n{this.renderContent()}\n" }, { "change_type": "MODIFY", "old_path": "native/chat/robotext-message.react.js", "new_path": "native/chat/robotext-message.react.js", "diff": "@@ -53,6 +53,7 @@ type Props = {|\nitem: ChatRobotextMessageInfoItemWithHeight,\nfocused: bool,\ntoggleFocus: (messageKey: string) => void,\n+ ...React.ElementProps<typeof View>,\n|};\nclass RobotextMessage extends React.PureComponent<Props> {\n@@ -63,14 +64,15 @@ class RobotextMessage extends React.PureComponent<Props> {\n};\nrender() {\n+ const { item, focused, toggleFocus, ...viewProps } = this.props;\nlet timestamp = null;\n- if (this.props.focused || this.props.item.startsConversation) {\n+ if (focused || item.startsConversation) {\ntimestamp = (\n- <Timestamp time={this.props.item.messageInfo.time} color=\"dark\" />\n+ <Timestamp time={item.messageInfo.time} color=\"dark\" />\n);\n}\nreturn (\n- <View>\n+ <View {...viewProps}>\n{timestamp}\n<TouchableWithoutFeedback onPress={this.onPress}>\n{this.linkedRobotext()}\n" }, { "change_type": "MODIFY", "old_path": "native/chat/text-message.react.js", "new_path": "native/chat/text-message.react.js", "diff": "@@ -83,6 +83,7 @@ type Props = {|\noverlayableScrollViewState: ?OverlayableScrollViewState,\n// withKeyboardState\nkeyboardState: ?KeyboardState,\n+ ...React.ElementProps<typeof View>,\n|};\nclass TextMessage extends React.PureComponent<Props> {\n@@ -98,7 +99,16 @@ class TextMessage extends React.PureComponent<Props> {\nmessage: ?View;\nrender() {\n- const { item } = this.props;\n+ const {\n+ item,\n+ navigation,\n+ focused,\n+ toggleFocus,\n+ verticalBounds,\n+ overlayableScrollViewState,\n+ keyboardState,\n+ ...viewProps\n+ } = this.props;\nconst { id, creator } = item.messageInfo;\nconst { isViewer } = creator;\nconst sendFailed =\n@@ -109,12 +119,13 @@ class TextMessage extends React.PureComponent<Props> {\nreturn (\n<ComposedMessage\n- item={this.props.item}\n+ item={item}\nsendFailed={!!sendFailed}\n- focused={this.props.focused}\n+ focused={focused}\n+ {...viewProps}\n>\n<InnerTextMessage\n- item={this.props.item}\n+ item={item}\nonPress={this.onPress}\nmessageRef={this.messageRef}\n/>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Pass Message responder props on to View This ensures that the `TouchableWithoutFeedback` in `Message` works properly
129,187
15.10.2019 18:21:19
14,400
b9f006035dcd370ccdf551c64e15e250b5d9c8b2
[native] Hide ImageGalleryKeyboard on RobotextMessage press
[ { "change_type": "MODIFY", "old_path": "native/chat/robotext-message.react.js", "new_path": "native/chat/robotext-message.react.js", "diff": "@@ -8,6 +8,11 @@ import {\nmessageTypeIsRobotext,\ntype RobotextMessageInfo,\n} from 'lib/types/message-types';\n+import {\n+ type KeyboardState,\n+ keyboardStatePropType,\n+ withKeyboardState,\n+} from '../navigation/keyboard-state';\nimport * as React from 'react';\nimport {\n@@ -53,6 +58,8 @@ type Props = {|\nitem: ChatRobotextMessageInfoItemWithHeight,\nfocused: bool,\ntoggleFocus: (messageKey: string) => void,\n+ // withKeyboardState\n+ keyboardState: ?KeyboardState,\n...React.ElementProps<typeof View>,\n|};\nclass RobotextMessage extends React.PureComponent<Props> {\n@@ -61,10 +68,17 @@ class RobotextMessage extends React.PureComponent<Props> {\nitem: chatMessageItemPropType.isRequired,\nfocused: PropTypes.bool.isRequired,\ntoggleFocus: PropTypes.func.isRequired,\n+ keyboardState: keyboardStatePropType,\n};\nrender() {\n- const { item, focused, toggleFocus, ...viewProps } = this.props;\n+ const {\n+ item,\n+ focused,\n+ toggleFocus,\n+ keyboardState,\n+ ...viewProps\n+ } = this.props;\nlet timestamp = null;\nif (focused || item.startsConversation) {\ntimestamp = (\n@@ -113,11 +127,18 @@ class RobotextMessage extends React.PureComponent<Props> {\n}\nonPress = () => {\n+ const { keyboardState } = this.props;\n+ const didDismiss = keyboardState &&\n+ keyboardState.dismissKeyboardIfShowing();\n+ if (!didDismiss) {\nthis.props.toggleFocus(messageKey(this.props.item.messageInfo));\n}\n+ }\n}\n+const WrappedRobotextMessage = withKeyboardState(RobotextMessage);\n+\ntype InnerThreadEntityProps = {\nid: string,\nname: string,\n@@ -183,6 +204,6 @@ const styles = StyleSheet.create({\n});\nexport {\n- RobotextMessage,\n+ WrappedRobotextMessage as RobotextMessage,\nrobotextMessageItemHeight,\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Hide ImageGalleryKeyboard on RobotextMessage press
129,187
16.10.2019 14:05:42
14,400
14f4cdc8c0f28e177a57224085bbfd1c9c31262d
[native] Add GlobalThemeInfo to Redux
[ { "change_type": "MODIFY", "old_path": "native/app.react.js", "new_path": "native/app.react.js", "diff": "@@ -40,6 +40,7 @@ import DisconnectedBarVisibilityHandler\nimport DimensionsUpdater from './redux/dimensions-updater.react';\nimport ConnectivityUpdater from './redux/connectivity-updater.react';\nimport PushHandler from './push/push-handler.react';\n+import ThemeHandler from './themes/theme-handler.react';\nimport Socket from './socket.react';\nif (Platform.OS === \"android\") {\n@@ -143,6 +144,7 @@ class AppWithNavigationState extends React.PureComponent<Props, State> {\n<PushHandler\ndetectUnsupervisedBackground={detectUnsupervisedBackground}\n/>\n+ <ThemeHandler />\n</View>\n);\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/flow-typed/npm/react-native-appearance_vx.x.x.js", "diff": "+// flow-typed signature: 62cdc8af700fc7c2359b39b1e134054c\n+// flow-typed version: <<STUB>>/react-native-appearance_v0.1.0/flow_v0.98.0\n+\n+/**\n+ * This is an autogenerated libdef stub for:\n+ *\n+ * 'react-native-appearance'\n+ *\n+ * Fill this stub out by replacing all the `any` types.\n+ *\n+ * Once filled out, we encourage you to share your work with the\n+ * community by sending a pull request to:\n+ * https://github.com/flowtype/flow-typed\n+ */\n+\n+declare module 'react-native-appearance' {\n+ declare module.exports: any;\n+}\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -72,6 +72,8 @@ PODS:\n- React-cxxreact (= 0.60.6)\n- React-jsi (= 0.60.6)\n- React-jsinspector (0.60.6)\n+ - react-native-appearance (0.1.0):\n+ - React\n- react-native-cameraroll (1.2.1):\n- React\n- react-native-image-resizer (1.0.1):\n@@ -159,6 +161,7 @@ DEPENDENCIES:\n- React-jsi (from `../../node_modules/react-native/ReactCommon/jsi`)\n- React-jsiexecutor (from `../../node_modules/react-native/ReactCommon/jsiexecutor`)\n- React-jsinspector (from `../../node_modules/react-native/ReactCommon/jsinspector`)\n+ - react-native-appearance (from `../../node_modules/react-native-appearance`)\n- \"react-native-cameraroll (from `../../node_modules/@react-native-community/cameraroll`)\"\n- react-native-image-resizer (from `../../node_modules/react-native-image-resizer`)\n- react-native-in-app-message (from `../../node_modules/react-native-in-app-message`)\n@@ -225,6 +228,8 @@ EXTERNAL SOURCES:\n:path: \"../../node_modules/react-native/ReactCommon/jsiexecutor\"\nReact-jsinspector:\n:path: \"../../node_modules/react-native/ReactCommon/jsinspector\"\n+ react-native-appearance:\n+ :path: \"../../node_modules/react-native-appearance\"\nreact-native-cameraroll:\n:path: \"../../node_modules/@react-native-community/cameraroll\"\nreact-native-image-resizer:\n@@ -303,6 +308,7 @@ SPEC CHECKSUMS:\nReact-jsi: 1a4248256b96fa453536a8dafe11b784e24e789d\nReact-jsiexecutor: 2279e559b921d02dfc6253ebef3dcb3a9dc6c07e\nReact-jsinspector: a58b86545a0185f69768e78ac96ca9fe43fa3694\n+ react-native-appearance: 309901290a0aab9ec4bc60ff2c3f94e6aae0267a\nreact-native-cameraroll: 3e5e34d36d93548ae7770ee8ab7b2ae9e778f571\nreact-native-image-resizer: 48eb06a18a6d0a632ffa162a51ca61a68fb5322f\nreact-native-in-app-message: f91de5009620af01456531118264c93e249b83ec\n" }, { "change_type": "MODIFY", "old_path": "native/media/image-gallery-image.react.js", "new_path": "native/media/image-gallery-image.react.js", "diff": "@@ -11,7 +11,6 @@ import {\nView,\nText,\nPlatform,\n- TouchableWithoutFeedback,\nAnimated,\nEasing,\n} from 'react-native';\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"lottie-react-native\": \"^3.2.1\",\n\"react\": \"16.8.6\",\n\"react-native\": \"0.60.6\",\n+ \"react-native-appearance\": \"^0.1.0\",\n\"react-native-exit-app\": \"^1.1.0\",\n\"react-native-fast-image\": \"^7.0.2\",\n\"react-native-firebase\": \"^5.5.6\",\n" }, { "change_type": "MODIFY", "old_path": "native/redux/action-types.js", "new_path": "native/redux/action-types.js", "diff": "@@ -13,3 +13,4 @@ export const rescindAndroidNotificationActionType =\n\"RESCIND_ANDROID_NOTIFICATION\";\nexport const updateDimensionsActiveType = \"UPDATE_DIMENSIONS\";\nexport const updateConnectivityActiveType = \"UPDATE_CONNECTIVITY\";\n+export const updateThemeInfoActionType = \"UPDATE_THEME_INFO\";\n" }, { "change_type": "MODIFY", "old_path": "native/redux/persist.js", "new_path": "native/redux/persist.js", "diff": "@@ -4,6 +4,7 @@ import type { AppState } from './redux-setup';\nimport { defaultCalendarFilters } from 'lib/types/filter-types';\nimport { defaultConnectionInfo } from 'lib/types/socket-types';\nimport { messageTypes } from 'lib/types/message-types';\n+import { defaultGlobalThemeInfo } from '../types/themes';\nimport { createMigrate } from 'redux-persist';\nimport invariant from 'invariant';\n@@ -131,6 +132,10 @@ const migrations = {\n[ messageTypes.MULTIMEDIA ],\n),\n}),\n+ [12]: (state: AppState) => ({\n+ ...state,\n+ globalThemeInfo: defaultGlobalThemeInfo,\n+ }),\n};\nconst persistConfig = {\n@@ -138,7 +143,7 @@ const persistConfig = {\nstorage: AsyncStorage,\nblacklist,\ndebug: __DEV__,\n- version: 11,\n+ version: 12,\nmigrate: createMigrate(migrations, { debug: __DEV__ }),\ntimeout: __DEV__ ? 0 : undefined,\n};\n" }, { "change_type": "MODIFY", "old_path": "native/redux/redux-setup.js", "new_path": "native/redux/redux-setup.js", "diff": "@@ -30,6 +30,10 @@ import {\ndefaultConnectivityInfo,\n} from '../types/connectivity';\nimport type { Dispatch } from 'lib/types/redux-types';\n+import {\n+ type GlobalThemeInfo,\n+ defaultGlobalThemeInfo,\n+} from '../types/themes';\nimport React from 'react';\nimport invariant from 'invariant';\n@@ -68,6 +72,7 @@ import {\nrescindAndroidNotificationActionType,\nupdateDimensionsActiveType,\nupdateConnectivityActiveType,\n+ updateThemeInfoActionType,\n} from './action-types';\nimport {\ndefaultNavInfo,\n@@ -118,6 +123,7 @@ export type AppState = {|\nsessionID?: void,\ndimensions: Dimensions,\nconnectivity: ConnectivityInfo,\n+ globalThemeInfo: GlobalThemeInfo,\n|};\nconst { height, width } = NativeDimensions.get('window');\n@@ -159,6 +165,7 @@ const defaultState = ({\n_persist: null,\ndimensions: { height, width },\nconnectivity: defaultConnectivityInfo,\n+ globalThemeInfo: defaultGlobalThemeInfo,\n}: AppState);\nfunction chatRouteFromNavInfo(navInfo: NavInfo): NavigationStateRoute {\n@@ -217,6 +224,14 @@ function reducer(state: AppState = defaultState, action: *) {\n...state,\nconnectivity: action.payload,\n};\n+ } else if (action.type === updateThemeInfoActionType) {\n+ return {\n+ ...state,\n+ globalThemeInfo: {\n+ ...state.globalThemeInfo,\n+ ...action.payload,\n+ },\n+ };\n}\nconst oldState = state;\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/themes/theme-handler.react.js", "diff": "+// @flow\n+\n+import type { DispatchActionPayload } from 'lib/utils/action-utils';\n+import type { AppState } from '../redux/redux-setup';\n+import {\n+ type GlobalTheme,\n+ type GlobalThemeInfo,\n+ globalThemeInfoPropType,\n+ osCanTheme,\n+} from '../types/themes';\n+import { updateThemeInfoActionType } from '../redux/action-types';\n+\n+import * as React from 'react';\n+import PropTypes from 'prop-types';\n+import { Appearance } from 'react-native-appearance';\n+\n+import { connect } from 'lib/utils/redux-utils';\n+\n+type Props = {|\n+ // Redux state\n+ globalThemeInfo: GlobalThemeInfo,\n+ rehydrateConcluded: bool,\n+ // Redux dispatch functions\n+ dispatchActionPayload: DispatchActionPayload,\n+|};\n+class ThemeHandler extends React.PureComponent<Props> {\n+\n+ static propTypes = {\n+ globalThemeInfo: globalThemeInfoPropType.isRequired,\n+ rehydrateConcluded: PropTypes.bool.isRequired,\n+ dispatchActionPayload: PropTypes.func.isRequired,\n+ };\n+ appearanceListener: ?{ +remove: () => void, ... };\n+\n+ componentDidMount() {\n+ if (this.props.rehydrateConcluded) {\n+ this.startListening();\n+ }\n+ }\n+\n+ componentDidUpdate(prevProps: Props) {\n+ if (this.props.rehydrateConcluded && !prevProps.rehydrateConcluded) {\n+ this.startListening();\n+ }\n+ }\n+\n+ componentWillUnmount() {\n+ if (this.appearanceListener) {\n+ this.appearanceListener.remove();\n+ }\n+ }\n+\n+ startListening() {\n+ if (osCanTheme) {\n+ this.appearanceListener =\n+ Appearance.addChangeListener(this.systemThemeChanged);\n+ this.updateSystemTheme(Appearance.getColorScheme());\n+ }\n+ }\n+\n+ systemThemeChanged = ({ colorScheme }: { colorScheme: GlobalTheme, ... }) => {\n+ this.updateSystemTheme(colorScheme);\n+ }\n+\n+ updateSystemTheme(colorScheme: GlobalTheme) {\n+ if (this.props.globalThemeInfo.systemTheme === colorScheme) {\n+ return;\n+ }\n+\n+ const updateObject: $Shape<GlobalThemeInfo> = { systemTheme: colorScheme };\n+ if (this.props.globalThemeInfo.preference === 'system') {\n+ updateObject.activeTheme = colorScheme;\n+ }\n+\n+ this.props.dispatchActionPayload(updateThemeInfoActionType, updateObject);\n+ }\n+\n+ render() {\n+ return null;\n+ }\n+\n+}\n+\n+export default connect(\n+ (state: AppState) => ({\n+ globalThemeInfo: state.globalThemeInfo,\n+ rehydrateConcluded: state._persist && state._persist.rehydrated,\n+ }),\n+ null,\n+ true,\n+)(ThemeHandler);\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/types/themes.js", "diff": "+// @flow\n+\n+import PropTypes from 'prop-types';\n+import { Platform } from 'react-native';\n+\n+export type GlobalTheme = 'light' | 'dark';\n+export type GlobalThemePreference = GlobalTheme | 'system';\n+\n+export type GlobalThemeInfo = {|\n+ activeTheme: ?GlobalTheme,\n+ systemTheme: ?GlobalTheme,\n+ preference: GlobalThemePreference,\n+|};\n+\n+export const globalThemeInfoPropType = PropTypes.shape({\n+ activeTheme: PropTypes.oneOf([ 'light', 'dark' ]),\n+ systemTheme: PropTypes.oneOf([ 'light', 'dark' ]),\n+ preference: PropTypes.oneOf([ 'light', 'dark', 'system' ]).isRequired,\n+});\n+\n+export const osCanTheme = Platform.OS === \"ios\" &&\n+ parseInt(Platform.Version, 10) >= 13;\n+\n+export const defaultGlobalThemeInfo = {\n+ activeTheme: osCanTheme ? null : 'light',\n+ systemTheme: null,\n+ preference: osCanTheme ? 'system' : 'light',\n+};\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -4812,6 +4812,13 @@ fb-watchman@^2.0.0:\ndependencies:\nbser \"^2.0.0\"\n+fbemitter@^2.1.1:\n+ version \"2.1.1\"\n+ resolved \"https://registry.yarnpkg.com/fbemitter/-/fbemitter-2.1.1.tgz#523e14fdaf5248805bb02f62efc33be703f51865\"\n+ integrity sha1-Uj4U/a9SSIBbsC9i78M75wP1GGU=\n+ dependencies:\n+ fbjs \"^0.8.4\"\n+\nfbjs-css-vars@^1.0.0:\nversion \"1.0.2\"\nresolved \"https://registry.yarnpkg.com/fbjs-css-vars/-/fbjs-css-vars-1.0.2.tgz#216551136ae02fe255932c3ec8775f18e2c078b8\"\n@@ -4833,7 +4840,7 @@ fbjs-scripts@^1.1.0:\nsemver \"^5.1.0\"\nthrough2 \"^2.0.0\"\n-fbjs@^0.8.9:\n+fbjs@^0.8.4, fbjs@^0.8.9:\nversion \"0.8.17\"\nresolved \"https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd\"\nintegrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90=\n@@ -10022,6 +10029,15 @@ react-linkify@^1.0.0-alpha:\nlinkify-it \"^2.0.3\"\ntlds \"^1.199.0\"\n+react-native-appearance@^0.1.0:\n+ version \"0.1.0\"\n+ resolved \"https://registry.yarnpkg.com/react-native-appearance/-/react-native-appearance-0.1.0.tgz#a195d9a71c03dc4de246b86a18e95c8ecd08d505\"\n+ integrity sha512-WitRX+1bYCwTOxh0dV+/3Pv/O0jzKl/Y+O4kMiPhiJFe/tibAE8l5wYw6l3X1gkPMn52khdxBDV0Ndkp3Pjvdw==\n+ dependencies:\n+ fbemitter \"^2.1.1\"\n+ invariant \"^2.2.4\"\n+ use-subscription \"^1.0.0\"\n+\nreact-native-exit-app@^1.1.0:\nversion \"1.1.0\"\nresolved \"https://registry.yarnpkg.com/react-native-exit-app/-/react-native-exit-app-1.1.0.tgz#5ec082152974240e2d6a93f1608efb49a4385f21\"\n@@ -12364,6 +12380,11 @@ url@^0.11.0:\npunycode \"1.3.2\"\nquerystring \"0.2.0\"\n+use-subscription@^1.0.0:\n+ version \"1.1.1\"\n+ resolved \"https://registry.yarnpkg.com/use-subscription/-/use-subscription-1.1.1.tgz#5509363e9bb152c4fb334151d4dceb943beaa7bb\"\n+ integrity sha512-gk4fPTYvNhs6Ia7u8/+K7bM7sZ7O7AMfWtS+zPO8luH+zWuiGgGcrW0hL4MRWZSzXo+4ofNorf87wZwBKz2YdQ==\n+\nuse@^3.1.0:\nversion \"3.1.1\"\nresolved \"https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Add GlobalThemeInfo to Redux
129,187
16.10.2019 14:56:28
14,400
3e60fa31164514558cc6eeb0bf90dc56ef3b1d41
[native] AppearancePreferences screen to set globalThemePreference
[ { "change_type": "ADD", "old_path": null, "new_path": "native/more/appearance-preferences.react.js", "diff": "+// @flow\n+\n+import type { DispatchActionPayload } from 'lib/utils/action-utils';\n+import type { AppState } from '../redux/redux-setup';\n+import {\n+ type GlobalThemePreference,\n+ type GlobalThemeInfo,\n+ globalThemeInfoPropType,\n+ osCanTheme,\n+} from '../types/themes';\n+import { updateThemeInfoActionType } from '../redux/action-types';\n+\n+import * as React from 'react';\n+import { StyleSheet, View, Text, ScrollView, Platform } from 'react-native';\n+import PropTypes from 'prop-types';\n+import Icon from 'react-native-vector-icons/Ionicons';\n+\n+import { connect } from 'lib/utils/redux-utils';\n+\n+import Button from '../components/button.react';\n+\n+const CheckIcon = (props: {||}) => (\n+ <Icon\n+ name=\"md-checkmark\"\n+ size={20}\n+ color=\"#008800\"\n+ style={styles.icon}\n+ />\n+);\n+\n+type OptionText = {|\n+ themePreference: GlobalThemePreference,\n+ text: string,\n+|};\n+const optionTexts: OptionText[] = [\n+ { themePreference: 'light', text: 'Light' },\n+ { themePreference: 'dark', text: 'Dark' },\n+];\n+if (osCanTheme) {\n+ optionTexts.push({\n+ themePreference: 'system',\n+ text: 'Follow system preferences',\n+ });\n+}\n+\n+type Props = {|\n+ // Redux state\n+ globalThemeInfo: GlobalThemeInfo,\n+ // Redux dispatch functions\n+ dispatchActionPayload: DispatchActionPayload,\n+|};\n+class AppearancePreferences extends React.PureComponent<Props> {\n+\n+ static propTypes = {\n+ globalThemeInfo: globalThemeInfoPropType.isRequired,\n+ dispatchActionPayload: PropTypes.func.isRequired,\n+ };\n+ static navigationOptions = {\n+ headerTitle: \"Appearance\",\n+ };\n+\n+ render() {\n+ const options = [];\n+ for (let i = 0; i < optionTexts.length; i++) {\n+ const { themePreference, text } = optionTexts[i];\n+ const icon = themePreference === this.props.globalThemeInfo.preference\n+ ? <CheckIcon />\n+ : null;\n+ options.push(\n+ <Button\n+ onPress={() => this.onSelectThemePreference(themePreference)}\n+ style={styles.row}\n+ iosFormat=\"highlight\"\n+ iosHighlightUnderlayColor=\"#EEEEEEDD\"\n+ key={`button_${themePreference}`}\n+ >\n+ <Text style={styles.option}>{text}</Text>\n+ {icon}\n+ </Button>\n+ );\n+ if (i + 1 < optionTexts.length) {\n+ options.push(<View style={styles.hr} key={`hr_${themePreference}`} />);\n+ }\n+ }\n+ return (\n+ <ScrollView contentContainerStyle={styles.scrollView}>\n+ <Text style={styles.header}>APP THEME</Text>\n+ <View style={styles.slightlyPaddedSection}>\n+ {options}\n+ </View>\n+ </ScrollView>\n+ );\n+ }\n+\n+ onSelectThemePreference = (themePreference: GlobalThemePreference) => {\n+ if (themePreference === this.props.globalThemeInfo.preference) {\n+ return;\n+ }\n+ const theme = themePreference === 'system'\n+ ? this.props.globalThemeInfo.systemTheme\n+ : themePreference;\n+ this.props.dispatchActionPayload(\n+ updateThemeInfoActionType,\n+ { preference: themePreference, activeTheme: theme },\n+ );\n+ }\n+\n+}\n+\n+const styles = StyleSheet.create({\n+ scrollView: {\n+ paddingTop: 24,\n+ },\n+ header: {\n+ paddingHorizontal: 24,\n+ paddingBottom: 3,\n+ fontSize: 12,\n+ fontWeight: \"400\",\n+ color: \"#888888\",\n+ },\n+ slightlyPaddedSection: {\n+ backgroundColor: 'white',\n+ borderTopWidth: 1,\n+ borderBottomWidth: 1,\n+ borderColor: \"#CCCCCC\",\n+ marginBottom: 24,\n+ paddingVertical: 2,\n+ },\n+ row: {\n+ flexDirection: 'row',\n+ justifyContent: 'space-between',\n+ paddingHorizontal: 24,\n+ paddingVertical: 10,\n+ },\n+ option: {\n+ color: 'black',\n+ fontSize: 16,\n+ },\n+ icon: {\n+ lineHeight: Platform.OS === \"ios\" ? 18 : 20,\n+ },\n+ hr: {\n+ height: 1,\n+ backgroundColor: \"#CCCCCC\",\n+ marginHorizontal: 15,\n+ },\n+});\n+\n+export default connect(\n+ (state: AppState) => ({\n+ globalThemeInfo: state.globalThemeInfo,\n+ }),\n+ null,\n+ true,\n+)(AppearancePreferences);\n" }, { "change_type": "MODIFY", "old_path": "native/more/more-screen.react.js", "new_path": "native/more/more-screen.react.js", "diff": "@@ -45,6 +45,7 @@ import {\nDeleteAccountRouteName,\nBuildInfoRouteName,\nDevToolsRouteName,\n+ AppearancePreferencesRouteName,\n} from '../navigation/route-names';\ntype Props = {\n@@ -163,6 +164,22 @@ class InnerMoreScreen extends React.PureComponent<Props> {\n/>\n</View>\n</View>\n+ <Text style={styles.header}>PREFERENCES</Text>\n+ <View style={styles.slightlyPaddedSection}>\n+ <Button\n+ onPress={this.onPressAppearance}\n+ style={styles.submenuButton}\n+ iosFormat=\"highlight\"\n+ iosHighlightUnderlayColor=\"#EEEEEEDD\"\n+ >\n+ <Text style={styles.submenuText}>Appearance</Text>\n+ <Icon\n+ name=\"ios-arrow-forward\"\n+ size={20}\n+ color=\"#036AFF\"\n+ />\n+ </Button>\n+ </View>\n<View style={styles.slightlyPaddedSection}>\n<Button\nonPress={this.onPressBuildInfo}\n@@ -292,6 +309,10 @@ class InnerMoreScreen extends React.PureComponent<Props> {\nthis.navigateIfActive(DevToolsRouteName);\n}\n+ onPressAppearance = () => {\n+ this.navigateIfActive(AppearancePreferencesRouteName);\n+ }\n+\n}\nconst styles = StyleSheet.create({\n" }, { "change_type": "MODIFY", "old_path": "native/more/more.react.js", "new_path": "native/more/more.react.js", "diff": "@@ -11,6 +11,7 @@ import EditPassword from './edit-password.react';\nimport DeleteAccount from './delete-account.react';\nimport BuildInfo from './build-info.react';\nimport DevTools from './dev-tools.react';\n+import AppearancePreferences from './appearance-preferences.react';\nimport {\nMoreScreenRouteName,\nEditEmailRouteName,\n@@ -18,6 +19,7 @@ import {\nDeleteAccountRouteName,\nBuildInfoRouteName,\nDevToolsRouteName,\n+ AppearancePreferencesRouteName,\n} from '../navigation/route-names';\nimport Header from '../navigation/header.react';\n@@ -29,6 +31,7 @@ const More = createStackNavigator(\n[DeleteAccountRouteName]: DeleteAccount,\n[BuildInfoRouteName]: BuildInfo,\n[DevToolsRouteName]: DevTools,\n+ [AppearancePreferencesRouteName]: AppearancePreferences,\n},\n{\ndefaultNavigationOptions: {\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/route-names.js", "new_path": "native/navigation/route-names.js", "diff": "@@ -30,6 +30,7 @@ export const DeleteAccountRouteName = 'DeleteAccount';\nexport const DevToolsRouteName = 'DevTools';\nexport const EditEmailRouteName = 'EditEmail';\nexport const EditPasswordRouteName = 'EditPassword';\n+export const AppearancePreferencesRouteName = 'AppearancePreferences';\nexport const ThreadPickerModalRouteName = 'ThreadPickerModal';\nexport const AddUsersModalRouteName = 'AddUsersModal';\nexport const CustomServerModalRouteName = 'CustomServerModal';\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] AppearancePreferences screen to set globalThemePreference
129,187
16.10.2019 15:05:07
14,400
16c828ddc6cd60276eef118a895b2bdf9ba9bcef
[native] Pass Redux activeTheme to React Navigation
[ { "change_type": "MODIFY", "old_path": "native/app.react.js", "new_path": "native/app.react.js", "diff": "@@ -4,6 +4,7 @@ import type {\nNavigationState,\nNavigationAction,\n} from 'react-navigation';\n+import { type GlobalTheme, globalThemePropType } from './types/themes';\nimport type { Dispatch } from 'lib/types/redux-types';\nimport type { AppState } from './redux/redux-setup';\nimport type { DispatchActionPayload } from 'lib/utils/action-utils';\n@@ -58,6 +59,7 @@ type NativeDispatch = Dispatch & ((action: NavigationAction) => boolean);\ntype Props = {\n// Redux state\nnavigationState: NavigationState,\n+ activeTheme: ?GlobalTheme,\n// Redux dispatch functions\ndispatch: NativeDispatch,\ndispatchActionPayload: DispatchActionPayload,\n@@ -69,6 +71,7 @@ class AppWithNavigationState extends React.PureComponent<Props, State> {\nstatic propTypes = {\nnavigationState: PropTypes.object.isRequired,\n+ activeTheme: globalThemePropType,\ndispatch: PropTypes.func.isRequired,\ndispatchActionPayload: PropTypes.func.isRequired,\n};\n@@ -128,6 +131,9 @@ class AppWithNavigationState extends React.PureComponent<Props, State> {\nrender() {\nconst { detectUnsupervisedBackground } = this.state;\n+ const reactNavigationTheme = this.props.activeTheme\n+ ? this.props.activeTheme\n+ : 'no-preference';\nreturn (\n<View style={styles.app}>\n<Socket\n@@ -136,6 +142,7 @@ class AppWithNavigationState extends React.PureComponent<Props, State> {\n<ReduxifiedRootNavigator\nstate={this.props.navigationState}\ndispatch={this.props.dispatch}\n+ theme={reactNavigationTheme}\n/>\n<ConnectedStatusBar barStyle={defaultStatusBarStyle} />\n<DisconnectedBarVisibilityHandler />\n@@ -166,6 +173,7 @@ const styles = StyleSheet.create({\nconst ConnectedAppWithNavigationState = connect(\n(state: AppState) => ({\nnavigationState: state.navInfo.navigationState,\n+ activeTheme: state.globalThemeInfo.activeTheme,\n}),\nnull,\ntrue,\n" }, { "change_type": "MODIFY", "old_path": "native/types/themes.js", "new_path": "native/types/themes.js", "diff": "@@ -12,9 +12,11 @@ export type GlobalThemeInfo = {|\npreference: GlobalThemePreference,\n|};\n+export const globalThemePropType = PropTypes.oneOf([ 'light', 'dark' ]);\n+\nexport const globalThemeInfoPropType = PropTypes.shape({\n- activeTheme: PropTypes.oneOf([ 'light', 'dark' ]),\n- systemTheme: PropTypes.oneOf([ 'light', 'dark' ]),\n+ activeTheme: globalThemePropType,\n+ systemTheme: globalThemePropType,\npreference: PropTypes.oneOf([ 'light', 'dark', 'system' ]).isRequired,\n});\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Pass Redux activeTheme to React Navigation
129,187
16.10.2019 15:31:13
14,400
0b73a0896b72f9cb828ed12b2b2efb0ce5e3cf67
[native] Pass Redux activeTheme to StatusBar
[ { "change_type": "MODIFY", "old_path": "native/app.react.js", "new_path": "native/app.react.js", "diff": "@@ -50,9 +50,6 @@ if (Platform.OS === \"android\") {\n}\nconst ReduxifiedRootNavigator = createReduxContainer(RootNavigator);\n-const defaultStatusBarStyle = Platform.OS === \"ios\"\n- ? \"dark-content\"\n- : \"default\";\ntype NativeDispatch = Dispatch & ((action: NavigationAction) => boolean);\n@@ -144,7 +141,7 @@ class AppWithNavigationState extends React.PureComponent<Props, State> {\ndispatch={this.props.dispatch}\ntheme={reactNavigationTheme}\n/>\n- <ConnectedStatusBar barStyle={defaultStatusBarStyle} />\n+ <ConnectedStatusBar />\n<DisconnectedBarVisibilityHandler />\n<DimensionsUpdater />\n<ConnectivityUpdater />\n" }, { "change_type": "MODIFY", "old_path": "native/connected-status-bar.react.js", "new_path": "native/connected-status-bar.react.js", "diff": "import type { AppState } from './redux/redux-setup';\nimport type { LoadingStatus } from 'lib/types/loading-types';\n+import { type GlobalTheme, globalThemePropType } from './types/themes';\nimport React from 'react';\n-import { StatusBar } from 'react-native';\n+import { StatusBar, Platform } from 'react-native';\nimport PropTypes from 'prop-types';\nimport { globalLoadingStatusSelector } from 'lib/selectors/loading-selectors';\nimport { connect } from 'lib/utils/redux-utils';\n-type InjectedProps = {\n- globalLoadingStatus: LoadingStatus,\n-};\n-type OwnProps = {\n+type Props = {|\nbarStyle?: \"default\" | \"light-content\" | \"dark-content\",\nanimated?: bool,\n-};\n-class ConnectedStatusBar extends React.PureComponent<InjectedProps & OwnProps> {\n+ // Redux state\n+ globalLoadingStatus: LoadingStatus,\n+ activeTheme: ?GlobalTheme,\n+|};\n+class ConnectedStatusBar extends React.PureComponent<Props> {\nstatic propTypes = {\n+ barStyle: PropTypes.oneOf([ \"default\", \"light-content\", \"dark-content\" ]),\n+ animated: PropTypes.bool,\nglobalLoadingStatus: PropTypes.string.isRequired,\n+ activeTheme: globalThemePropType,\n};\nrender() {\nconst fetchingSomething = this.props.globalLoadingStatus === \"loading\";\n+ let { barStyle } = this.props;\n+ if (!barStyle && this.props.activeTheme === \"light\") {\n+ barStyle = Platform.OS === \"android\" ? \"light-content\" : \"dark-content\";\n+ } else if (!barStyle && this.props.activeTheme === \"dark\") {\n+ barStyle = \"light-content\";\n+ }\nreturn (\n<StatusBar\n{...this.props}\n+ barStyle={barStyle}\nnetworkActivityIndicatorVisible={fetchingSomething}\n/>\n);\n@@ -35,6 +46,7 @@ class ConnectedStatusBar extends React.PureComponent<InjectedProps & OwnProps> {\n}\n-export default connect((state: AppState): InjectedProps => ({\n+export default connect((state: AppState) => ({\nglobalLoadingStatus: globalLoadingStatusSelector(state),\n+ activeTheme: state.globalThemeInfo.activeTheme,\n}))(ConnectedStatusBar);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Pass Redux activeTheme to StatusBar
129,187
16.10.2019 16:16:14
14,400
750bbcf2e83852978596392dd370debc84ed012b
[native] Use bottom tab navigator for Android
[ { "change_type": "DELETE", "old_path": "native/chat/chat-label.react.js", "new_path": null, "diff": "-// @flow\n-\n-import type { AppState } from '../redux/redux-setup';\n-\n-import React from 'react';\n-import { View, Text, StyleSheet } from 'react-native';\n-import PropTypes from 'prop-types';\n-\n-import { connect } from 'lib/utils/redux-utils';\n-import { unreadCount } from 'lib/selectors/thread-selectors';\n-\n-type Props = {\n- color: string,\n- // Redux state\n- unreadCount: number,\n-};\n-class ChatLabel extends React.PureComponent<Props> {\n-\n- static propTypes = {\n- color: PropTypes.string.isRequired,\n- unreadCount: PropTypes.number.isRequired,\n- };\n-\n- render() {\n- const text = (\n- <Text\n- style={[styles.text, { color: this.props.color }]}\n- allowFontScaling={true}\n- >\n- CHAT\n- </Text>\n- );\n- if (!this.props.unreadCount) {\n- return text;\n- }\n- return (\n- <View>\n- {text}\n- <View style={styles.badge}>\n- <Text style={styles.badgeText}>\n- {this.props.unreadCount}\n- </Text>\n- </View>\n- </View>\n- );\n- }\n-\n-}\n-\n-const styles = StyleSheet.create({\n- text: {\n- textAlign: 'center',\n- fontSize: 13,\n- margin: 8,\n- backgroundColor: 'transparent',\n- },\n- badge: {\n- position: 'absolute',\n- right: -13,\n- top: 8,\n- backgroundColor: 'red',\n- borderRadius: 9,\n- width: 18,\n- height: 18,\n- justifyContent: 'center',\n- alignItems: 'center',\n- },\n- badgeText: {\n- color: 'white',\n- paddingBottom: 1,\n- },\n-});\n-\n-export default connect((state: AppState) => ({\n- unreadCount: unreadCount(state),\n-}))(ChatLabel);\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat-navigator.react.js", "new_path": "native/chat/chat-navigator.react.js", "diff": "@@ -6,7 +6,6 @@ import type {\n} from 'react-navigation';\nimport * as React from 'react';\n-import { Platform } from 'react-native';\nimport { createStackNavigator } from 'react-navigation-stack';\nimport ChatThreadList from './chat-thread-list.react';\n@@ -16,7 +15,6 @@ import ThreadSettings from './settings/thread-settings.react';\nimport { getChatScreen } from './chat-screen-registry';\nimport DeleteThread from './settings/delete-thread.react';\nimport ChatIcon from './chat-icon.react';\n-import ChatLabel from './chat-label.react';\nimport {\nComposeThreadRouteName,\nDeleteThreadRouteName,\n@@ -44,9 +42,6 @@ const ChatNavigator = createStackNavigator(\n},\n);\nChatNavigator.navigationOptions = ({ navigation }) => ({\n- tabBarLabel: Platform.OS === \"android\"\n- ? ({ tintColor }) => <ChatLabel color={tintColor} />\n- : \"Chat\",\ntabBarIcon: ({ tintColor }) => <ChatIcon color={tintColor} />,\ntabBarOnPress: ({ navigation, defaultHandler }: {\nnavigation: NavigationScreenProp<NavigationStateRoute>,\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/navigation-setup.js", "new_path": "native/navigation/navigation-setup.js", "diff": "@@ -24,10 +24,7 @@ import type { AndroidNotificationActions } from '../push/reducer';\nimport type { UserInfo } from 'lib/types/user-types';\nimport { NavigationActions } from 'react-navigation';\n-import {\n- createBottomTabNavigator,\n- createMaterialTopTabNavigator,\n-} from 'react-navigation-tabs';\n+import { createBottomTabNavigator } from 'react-navigation-tabs';\nimport { createStackNavigator } from 'react-navigation-stack';\nimport invariant from 'invariant';\nimport _findIndex from 'lodash/fp/findIndex';\n@@ -147,32 +144,12 @@ export type Action =\n| {| type: \"BACKGROUND\" |}\n| {| type: \"FOREGROUND\" |};\n-let TabNavigator;\n-const routeConfig = {\n+const TabNavigator = createBottomTabNavigator(\n+ {\n[CalendarRouteName]: { screen: Calendar },\n[ChatRouteName]: { screen: Chat },\n[MoreRouteName]: { screen: More },\n-};\n-if (Platform.OS === \"android\") {\n- const tabBarOptions = {\n- style: {\n- backgroundColor: '#445588',\n- },\n- indicatorStyle: {\n- backgroundColor: '#AAFFCC',\n- },\n- };\n- TabNavigator = createMaterialTopTabNavigator(\n- routeConfig,\n- {\n- initialRouteName: CalendarRouteName,\n- lazy: false,\n- tabBarOptions,\n},\n- );\n-} else {\n- TabNavigator = createBottomTabNavigator(\n- routeConfig,\n{\ninitialRouteName: CalendarRouteName,\nlazy: false,\n@@ -181,7 +158,6 @@ if (Platform.OS === \"android\") {\n},\n},\n);\n-}\nconst AppNavigator = createLightboxNavigator(\n{\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use bottom tab navigator for Android
129,187
16.10.2019 16:22:22
14,400
0852f2c17ca8555d8cec06b0c89c064f00f1ea5d
[native] Hide react-native-firebase require cycle warnings
[ { "change_type": "MODIFY", "old_path": "native/push/push-handler.react.js", "new_path": "native/push/push-handler.react.js", "diff": "@@ -31,6 +31,7 @@ import {\nAppState as NativeAppState,\nAlert,\nVibration,\n+ YellowBox,\n} from 'react-native';\nimport NotificationsIOS from 'react-native-notifications';\nimport { Notification as InAppNotification } from 'react-native-in-app-message';\n@@ -67,6 +68,10 @@ import { getFirebase } from './firebase';\nimport { saveMessageInfos } from './utils';\nimport InAppNotif from './in-app-notif.react';\n+YellowBox.ignoreWarnings([\n+ \"Require cycle: ../node_modules/react-native-firebase\",\n+]);\n+\nconst msInDay = 24 * 60 * 60 * 1000;\ntype Props = {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Hide react-native-firebase require cycle warnings
129,187
16.10.2019 16:27:59
14,400
f69982ea2bc9746fe23bcea93f842db09f6c71fc
[native] Style in-app notifs based on Redux activeTheme
[ { "change_type": "MODIFY", "old_path": "native/push/in-app-notif.react.js", "new_path": "native/push/in-app-notif.react.js", "diff": "// @flow\n+import type { GlobalTheme } from '../types/themes';\n+\nimport * as React from 'react';\nimport { View, Text, StyleSheet, Platform } from 'react-native';\ntype Props = {|\ntitle: ?string,\nmessage: string,\n+ activeTheme: ?GlobalTheme,\n|};\nfunction InAppNotif(props: Props) {\n- const title = props.title\n- ? <Text style={styles.title}>{props.title}{\"\\n\"}</Text>\n- : null;\n+ const useLightStyle = Platform.OS === \"ios\" && props.activeTheme !== 'dark';\n+\n+ let title = null;\n+ if (props.title) {\n+ const titleStyles = [\n+ styles.title,\n+ useLightStyle ? styles.lightTitle : null,\n+ ];\n+ title = (\n+ <Text style={titleStyles} numberOfLines={1}>\n+ {props.title}\n+ {\"\\n\"}\n+ </Text>\n+ );\n+ }\n+\n+ const textStyles = [\n+ styles.text,\n+ useLightStyle ? styles.lightText : null,\n+ ];\nreturn (\n<View style={styles.notif}>\n- <Text style={styles.text}>\n+ <Text style={textStyles}>\n{title}\n{props.message}\n</Text>\n@@ -44,10 +64,16 @@ const styles = StyleSheet.create({\n}),\nmarginHorizontal: 10,\n},\n+ lightText: {\n+ color: 'white',\n+ },\ntitle: {\ncolor: 'black',\nfontWeight: 'bold',\n},\n+ lightTitle: {\n+ color: 'white',\n+ },\n});\nexport default InAppNotif;\n" }, { "change_type": "MODIFY", "old_path": "native/push/push-handler.react.js", "new_path": "native/push/push-handler.react.js", "diff": "@@ -22,6 +22,7 @@ import type {\nRemoteMessage,\nNotificationOpen,\n} from 'react-native-firebase';\n+import { type GlobalTheme, globalThemePropType } from '../types/themes';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n@@ -86,6 +87,7 @@ type Props = {\nnotifPermissionAlertInfo: NotifPermissionAlertInfo,\nconnection: ConnectionInfo,\nupdatesCurrentAsOf: number,\n+ activeTheme: ?GlobalTheme,\n// Redux dispatch functions\ndispatchActionPayload: DispatchActionPayload,\ndispatchActionPromise: DispatchActionPromise,\n@@ -98,6 +100,7 @@ type Props = {\ntype State = {|\ninAppNotifProps: ?{|\ncustomComponent: React.Node,\n+ blurType: ?('xlight' | 'dark'),\nonPress: () => void,\n|};\n|};\n@@ -114,6 +117,7 @@ class PushHandler extends React.PureComponent<Props, State> {\nnotifPermissionAlertInfo: notifPermissionAlertInfoPropType.isRequired,\nconnection: connectionInfoPropType.isRequired,\nupdatesCurrentAsOf: PropTypes.number.isRequired,\n+ activeTheme: globalThemePropType,\ndispatchActionPayload: PropTypes.func.isRequired,\ndispatchActionPromise: PropTypes.func.isRequired,\nsetDeviceToken: PropTypes.func.isRequired,\n@@ -522,7 +526,14 @@ class PushHandler extends React.PureComponent<Props, State> {\n}\nthis.setState({\ninAppNotifProps: {\n- customComponent: <InAppNotif title={title} message={message} />,\n+ customComponent: (\n+ <InAppNotif\n+ title={title}\n+ message={message}\n+ activeTheme={this.props.activeTheme}\n+ />\n+ ),\n+ blurType: this.props.activeTheme === 'dark' ? 'xlight' : 'dark',\nonPress: () => {\nInAppNotification.hide();\nthis.onPressNotificationForThread(threadID, false);\n@@ -583,6 +594,7 @@ export default connect(\nnotifPermissionAlertInfo: state.notifPermissionAlertInfo,\nconnection: state.connection,\nupdatesCurrentAsOf: state.updatesCurrentAsOf,\n+ activeTheme: state.globalThemeInfo.activeTheme,\n}),\n{ setDeviceToken },\n)(PushHandler);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Style in-app notifs based on Redux activeTheme
129,187
16.10.2019 16:51:46
14,400
d19c97102d92637339ba106c04cba62e7586d7bf
[native] Use taptic feedback for in-app notifs on iOS 10 and higher
[ { "change_type": "MODIFY", "old_path": "native/ios/SquadCal.xcodeproj/xcshareddata/xcschemes/SquadCal.xcscheme", "new_path": "native/ios/SquadCal.xcodeproj/xcshareddata/xcschemes/SquadCal.xcscheme", "diff": "selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\nselectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\nshouldUseLaunchSchemeArgsEnv = \"YES\">\n+ <MacroExpansion>\n+ <BuildableReference\n+ BuildableIdentifier = \"primary\"\n+ BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n+ BuildableName = \"SquadCal.app\"\n+ BlueprintName = \"SquadCal\"\n+ ReferencedContainer = \"container:SquadCal.xcodeproj\">\n+ </BuildableReference>\n+ </MacroExpansion>\n<Testables>\n<TestableReference\nskipped = \"NO\">\n</BuildableReference>\n</TestableReference>\n</Testables>\n- <MacroExpansion>\n- <BuildableReference\n- BuildableIdentifier = \"primary\"\n- BlueprintIdentifier = \"13B07F861A680F5B00A75B9A\"\n- BuildableName = \"SquadCal.app\"\n- BlueprintName = \"SquadCal\"\n- ReferencedContainer = \"container:SquadCal.xcodeproj\">\n- </BuildableReference>\n- </MacroExpansion>\n- <AdditionalOptions>\n- </AdditionalOptions>\n</TestAction>\n<LaunchAction\nbuildConfiguration = \"Debug\"\nReferencedContainer = \"container:SquadCal.xcodeproj\">\n</BuildableReference>\n</BuildableProductRunnable>\n- <AdditionalOptions>\n- </AdditionalOptions>\n</LaunchAction>\n<ProfileAction\nbuildConfiguration = \"Release\"\n" }, { "change_type": "MODIFY", "old_path": "native/push/push-handler.react.js", "new_path": "native/push/push-handler.react.js", "diff": "@@ -35,7 +35,10 @@ import {\nYellowBox,\n} from 'react-native';\nimport NotificationsIOS from 'react-native-notifications';\n-import { Notification as InAppNotification } from 'react-native-in-app-message';\n+import {\n+ Notification as InAppNotification,\n+ TapticFeedback,\n+} from 'react-native-in-app-message';\nimport { connect } from 'lib/utils/redux-utils';\nimport { unreadCount } from 'lib/selectors/thread-selectors';\n@@ -74,6 +77,8 @@ YellowBox.ignoreWarnings([\n]);\nconst msInDay = 24 * 60 * 60 * 1000;\n+const supportsTapticFeedback = Platform.OS === \"ios\" &&\n+ parseInt(Platform.Version, 10) >= 10;\ntype Props = {\ndetectUnsupervisedBackground: ?((alreadyClosed: bool) => bool),\n@@ -271,7 +276,11 @@ class PushHandler extends React.PureComponent<Props, State> {\nthis.state.inAppNotifProps &&\nthis.state.inAppNotifProps !== prevState.inAppNotifProps\n) {\n+ if (supportsTapticFeedback) {\n+ TapticFeedback.impact();\n+ } else {\nVibration.vibrate(400);\n+ }\nInAppNotification.show();\n}\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use taptic feedback for in-app notifs on iOS 10 and higher
129,187
16.10.2019 16:52:23
14,400
4374ace6b23294de35500cc9b69b2eff1a06644e
[web] Show server-rendered current day Okay now that server has timezone info based on IP address
[ { "change_type": "MODIFY", "old_path": "web/calendar/day.react.js", "new_path": "web/calendar/day.react.js", "diff": "@@ -51,7 +51,6 @@ type Props = {\ntype State = {\npickerOpen: bool,\nhovered: bool,\n- mounted: bool,\n};\nclass Day extends React.PureComponent<Props, State> {\n@@ -67,26 +66,14 @@ class Day extends React.PureComponent<Props, State> {\ntimeZone: PropTypes.string,\ndispatchActionPayload: PropTypes.func.isRequired,\n};\n- entryContainer: ?HTMLDivElement;\n- entryContainerSpacer: ?HTMLDivElement;\n- actionLinks: ?HTMLDivElement;\n- entries: Map<string, InnerEntry>;\n-\n- constructor(props: Props) {\n- super(props);\n- this.state = {\n+ state = {\npickerOpen: false,\nhovered: false,\n- mounted: false,\n};\n- this.entries = new Map();\n- }\n-\n- componentDidMount() {\n- // We do this to force a re-render since the render depends on the\n- // client's timezone, and the server will always render in Pacific Time\n- this.setState({ mounted: true });\n- }\n+ entryContainer: ?HTMLDivElement;\n+ entryContainerSpacer: ?HTMLDivElement;\n+ actionLinks: ?HTMLDivElement;\n+ entries: Map<string, InnerEntry> = new Map();\nstatic getDerivedStateFromProps(props: Props) {\nif (props.onScreenThreadInfos.length === 0) {\n@@ -104,8 +91,7 @@ class Day extends React.PureComponent<Props, State> {\nrender() {\nconst now = currentDateInTimeZone(this.props.timeZone);\n- const isToday = this.state.mounted &&\n- dateString(now) === this.props.dayString;\n+ const isToday = dateString(now) === this.props.dayString;\nconst tdClasses = classNames(css.day, { [css.currentDay]: isToday });\nlet actionLinks = null;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[web] Show server-rendered current day Okay now that server has timezone info based on IP address
129,187
16.10.2019 16:56:51
14,400
c4983c7b61a5dc0c6472160d2c58e883dd6f01a1
Always specify radix to parseInt
[ { "change_type": "MODIFY", "old_path": "lib/selectors/local-id-selectors.js", "new_path": "lib/selectors/local-id-selectors.js", "diff": "@@ -9,7 +9,7 @@ const localIDExtractionRegex = /^local([0-9]+)$/;\nfunction numberFromLocalID(localID: string) {\nconst matches = localIDExtractionRegex.exec(localID);\ninvariant(matches && matches[1], `${localID} doesn't look like a localID`);\n- return parseInt(matches[1]);\n+ return parseInt(matches[1], 10);\n}\nfunction highestLocalIDSelector(state: ?BaseAppState<*>): number {\n" }, { "change_type": "MODIFY", "old_path": "lib/utils/date-utils.js", "new_path": "lib/utils/date-utils.js", "diff": "@@ -71,9 +71,9 @@ function dateFromString(dayString: string): Date {\nconst matches = dayString.match(/^([0-9]+)-([0-1][0-9])-([0-3][0-9])$/);\ninvariant(matches && matches.length === 4, `invalid dayString ${dayString}`);\nreturn getDate(\n- parseInt(matches[1]),\n- parseInt(matches[2]),\n- parseInt(matches[3]),\n+ parseInt(matches[1], 10),\n+ parseInt(matches[2], 10),\n+ parseInt(matches[3], 10),\n);\n}\n" }, { "change_type": "MODIFY", "old_path": "lib/utils/url-utils.js", "new_path": "lib/utils/url-utils.js", "diff": "@@ -25,10 +25,10 @@ function infoFromURL(url: string): URLInfo {\nconst chatTest = chatRegex.test(url);\nconst returnObj = {};\nif (yearMatches) {\n- returnObj.year = parseInt(yearMatches[2]);\n+ returnObj.year = parseInt(yearMatches[2], 10);\n}\nif (monthMatches) {\n- const month = parseInt(monthMatches[2]);\n+ const month = parseInt(monthMatches[2], 10);\nif (month < 1 || month > 12) {\nthrow new Error(\"invalid_month\");\n}\n" }, { "change_type": "MODIFY", "old_path": "native/push/android.js", "new_path": "native/push/android.js", "diff": "@@ -30,7 +30,7 @@ function handleAndroidMessage(\nconst { data } = message;\nconst { badge } = data;\nif (badge !== undefined && badge !== null) {\n- firebase.notifications().setBadge(parseInt(badge));\n+ firebase.notifications().setBadge(parseInt(badge, 10));\n}\nconst customNotification = data.custom_notification\n" }, { "change_type": "MODIFY", "old_path": "server/src/creators/message-creator.js", "new_path": "server/src/creators/message-creator.js", "diff": "@@ -123,7 +123,9 @@ async function createMessages(\ntext: messageData.text,\n});\n} else if (messageData.type === messageTypes.MULTIMEDIA) {\n- content = JSON.stringify(messageData.media.map(({ id }) => parseInt(id)));\n+ content = JSON.stringify(messageData.media.map(\n+ ({ id }) => parseInt(id, 10),\n+ ));\n}\nconst creation = messageData.localID && viewer.hasSessionInfo\n" }, { "change_type": "MODIFY", "old_path": "server/src/models/verification.js", "new_path": "server/src/models/verification.js", "diff": "@@ -38,7 +38,7 @@ async function createVerificationCode(\nVALUES ${[row]}\n`;\nawait dbQuery(query);\n- return `${code}${parseInt(id).toString(16)}`;\n+ return `${code}${parseInt(id, 10).toString(16)}`;\n}\ntype CodeVerification = {|\n" }, { "change_type": "MODIFY", "old_path": "server/src/push/send.js", "new_path": "server/src/push/send.js", "diff": "@@ -148,7 +148,7 @@ async function sendPushNotifs(pushInfo: PushInfo) {\nconst iosVersionsToTokens = byDeviceType.get(\"ios\");\nif (iosVersionsToTokens) {\nfor (let [ codeVer, deviceTokens ] of iosVersionsToTokens) {\n- const codeVersion = parseInt(codeVer); // only for Flow\n+ const codeVersion = parseInt(codeVer, 10); // only for Flow\nconst shimmedNewRawMessageInfos = shimUnsupportedRawMessageInfos(\nnewRawMessageInfos,\n{ platform: \"ios\", codeVersion },\n@@ -171,7 +171,7 @@ async function sendPushNotifs(pushInfo: PushInfo) {\nconst androidVersionsToTokens = byDeviceType.get(\"android\");\nif (androidVersionsToTokens) {\nfor (let [ codeVer, deviceTokens ] of androidVersionsToTokens) {\n- const codeVersion = parseInt(codeVer); // only for Flow\n+ const codeVersion = parseInt(codeVer, 10); // only for Flow\nconst shimmedNewRawMessageInfos = shimUnsupportedRawMessageInfos(\nnewRawMessageInfos,\n{ platform: \"android\", codeVersion },\n" }, { "change_type": "MODIFY", "old_path": "server/src/responders/thread-responders.js", "new_path": "server/src/responders/thread-responders.js", "diff": "@@ -61,7 +61,7 @@ const roleChangeRequestInputValidator = tShape({\nrole: t.refinement(\nt.String,\nstr => {\n- const int = parseInt(str);\n+ const int = parseInt(str, 10);\nreturn int == str && int > 0;\n},\n),\n" }, { "change_type": "MODIFY", "old_path": "server/src/server.js", "new_path": "server/src/server.js", "diff": "@@ -81,5 +81,5 @@ if (cluster.isMaster) {\n);\nserver.use(baseRoutePath, router);\n- server.listen(parseInt(process.env.PORT) || 3000, 'localhost');\n+ server.listen(parseInt(process.env.PORT, 10) || 3000, 'localhost');\n}\n" }, { "change_type": "MODIFY", "old_path": "web/modals/threads/new-thread-modal.react.js", "new_path": "web/modals/threads/new-thread-modal.react.js", "diff": "@@ -228,7 +228,7 @@ class NewThreadModal extends React.PureComponent<Props, State> {\nconst target = event.target;\ninvariant(target instanceof HTMLInputElement, \"target not input\");\nthis.setState({\n- threadType: assertThreadType(parseInt(target.value)),\n+ threadType: assertThreadType(parseInt(target.value, 10)),\n});\n}\n" }, { "change_type": "MODIFY", "old_path": "web/modals/threads/thread-settings-modal.react.js", "new_path": "web/modals/threads/thread-settings-modal.react.js", "diff": "@@ -405,7 +405,7 @@ class ThreadSettingsModal extends React.PureComponent<Props, State> {\n}\nonChangeThreadType = (event: SyntheticEvent<HTMLInputElement>) => {\n- const uiValue = assertThreadType(parseInt(event.currentTarget.value));\n+ const uiValue = assertThreadType(parseInt(event.currentTarget.value, 10));\nconst newValue = uiValue !== this.props.threadInfo.type\n? uiValue\n: null;\n" }, { "change_type": "MODIFY", "old_path": "web/selectors/nav-selectors.js", "new_path": "web/selectors/nav-selectors.js", "diff": "@@ -24,7 +24,7 @@ function yearExtractor(startDate: string, endDate: string): ?number {\n) {\nreturn null;\n}\n- return parseInt(startDateResults[1]);\n+ return parseInt(startDateResults[1], 10);\n}\nfunction yearAssertingExtractor(startDate: string, endDate: string): number {\n@@ -54,7 +54,7 @@ function monthExtractor(startDate: string, endDate: string): ?number {\n) {\nreturn null;\n}\n- return parseInt(startDateResults[2]);\n+ return parseInt(startDateResults[2], 10);\n}\n// 1-indexed\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Always specify radix to parseInt
129,187
16.10.2019 19:35:40
14,400
ca3a0460268fe424095f7624a230d546b17652c4
[native] Change to react-native-dark-mode for Android support
[ { "change_type": "DELETE", "old_path": "native/flow-typed/npm/react-native-appearance_vx.x.x.js", "new_path": null, "diff": "-// flow-typed signature: 62cdc8af700fc7c2359b39b1e134054c\n-// flow-typed version: <<STUB>>/react-native-appearance_v0.1.0/flow_v0.98.0\n-\n-/**\n- * This is an autogenerated libdef stub for:\n- *\n- * 'react-native-appearance'\n- *\n- * Fill this stub out by replacing all the `any` types.\n- *\n- * Once filled out, we encourage you to share your work with the\n- * community by sending a pull request to:\n- * https://github.com/flowtype/flow-typed\n- */\n-\n-declare module 'react-native-appearance' {\n- declare module.exports: any;\n-}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/flow-typed/npm/react-native-dark-mode_vx.x.x.js", "diff": "+// flow-typed signature: eb048bbff603b866d187d468c6a9e257\n+// flow-typed version: <<STUB>>/react-native-dark-mode_v0.1.3/flow_v0.98.0\n+\n+/**\n+ * This is an autogenerated libdef stub for:\n+ *\n+ * 'react-native-dark-mode'\n+ *\n+ * Fill this stub out by replacing all the `any` types.\n+ *\n+ * Once filled out, we encourage you to share your work with the\n+ * community by sending a pull request to:\n+ * https://github.com/flowtype/flow-typed\n+ */\n+\n+declare module 'react-native-dark-mode' {\n+ declare module.exports: any;\n+}\n+\n+/**\n+ * We include stubs for each file inside this npm package in case you need to\n+ * require those files directly. Feel free to delete any files that aren't\n+ * needed.\n+ */\n+declare module 'react-native-dark-mode/dist/context' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-dark-mode/dist/dark-mode-event-emitter' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-dark-mode/dist/dynamic-style-sheet' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-dark-mode/dist/dynamic-value' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-dark-mode/dist/event-emitter' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-dark-mode/dist' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-dark-mode/dist/initial-mode' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-dark-mode/dist/native-module' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-dark-mode/dist/types' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-dark-mode/dist/use-dark-mode' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-dark-mode/dist/use-dynamic-style-sheet' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-dark-mode/dist/use-dynamic-value' {\n+ declare module.exports: any;\n+}\n+\n+// Filename aliases\n+declare module 'react-native-dark-mode/dist/context.js' {\n+ declare module.exports: $Exports<'react-native-dark-mode/dist/context'>;\n+}\n+declare module 'react-native-dark-mode/dist/dark-mode-event-emitter.js' {\n+ declare module.exports: $Exports<'react-native-dark-mode/dist/dark-mode-event-emitter'>;\n+}\n+declare module 'react-native-dark-mode/dist/dynamic-style-sheet.js' {\n+ declare module.exports: $Exports<'react-native-dark-mode/dist/dynamic-style-sheet'>;\n+}\n+declare module 'react-native-dark-mode/dist/dynamic-value.js' {\n+ declare module.exports: $Exports<'react-native-dark-mode/dist/dynamic-value'>;\n+}\n+declare module 'react-native-dark-mode/dist/event-emitter.js' {\n+ declare module.exports: $Exports<'react-native-dark-mode/dist/event-emitter'>;\n+}\n+declare module 'react-native-dark-mode/dist/index' {\n+ declare module.exports: $Exports<'react-native-dark-mode/dist'>;\n+}\n+declare module 'react-native-dark-mode/dist/index.js' {\n+ declare module.exports: $Exports<'react-native-dark-mode/dist'>;\n+}\n+declare module 'react-native-dark-mode/dist/initial-mode.js' {\n+ declare module.exports: $Exports<'react-native-dark-mode/dist/initial-mode'>;\n+}\n+declare module 'react-native-dark-mode/dist/native-module.js' {\n+ declare module.exports: $Exports<'react-native-dark-mode/dist/native-module'>;\n+}\n+declare module 'react-native-dark-mode/dist/types.js' {\n+ declare module.exports: $Exports<'react-native-dark-mode/dist/types'>;\n+}\n+declare module 'react-native-dark-mode/dist/use-dark-mode.js' {\n+ declare module.exports: $Exports<'react-native-dark-mode/dist/use-dark-mode'>;\n+}\n+declare module 'react-native-dark-mode/dist/use-dynamic-style-sheet.js' {\n+ declare module.exports: $Exports<'react-native-dark-mode/dist/use-dynamic-style-sheet'>;\n+}\n+declare module 'react-native-dark-mode/dist/use-dynamic-value.js' {\n+ declare module.exports: $Exports<'react-native-dark-mode/dist/use-dynamic-value'>;\n+}\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -72,8 +72,6 @@ PODS:\n- React-cxxreact (= 0.60.6)\n- React-jsi (= 0.60.6)\n- React-jsinspector (0.60.6)\n- - react-native-appearance (0.1.0):\n- - React\n- react-native-cameraroll (1.2.1):\n- React\n- react-native-image-resizer (1.0.1):\n@@ -119,6 +117,8 @@ PODS:\n- React-Core (= 0.60.6)\n- React-RCTWebSocket (0.60.6):\n- React-Core (= 0.60.6)\n+ - ReactNativeDarkMode (0.1.3):\n+ - React\n- RNCAsyncStorage (1.6.2):\n- React\n- RNExitApp (1.1.0):\n@@ -161,7 +161,6 @@ DEPENDENCIES:\n- React-jsi (from `../../node_modules/react-native/ReactCommon/jsi`)\n- React-jsiexecutor (from `../../node_modules/react-native/ReactCommon/jsiexecutor`)\n- React-jsinspector (from `../../node_modules/react-native/ReactCommon/jsinspector`)\n- - react-native-appearance (from `../../node_modules/react-native-appearance`)\n- \"react-native-cameraroll (from `../../node_modules/@react-native-community/cameraroll`)\"\n- react-native-image-resizer (from `../../node_modules/react-native-image-resizer`)\n- react-native-in-app-message (from `../../node_modules/react-native-in-app-message`)\n@@ -182,6 +181,7 @@ DEPENDENCIES:\n- React-RCTText (from `../../node_modules/react-native/Libraries/Text`)\n- React-RCTVibration (from `../../node_modules/react-native/Libraries/Vibration`)\n- React-RCTWebSocket (from `../../node_modules/react-native/Libraries/WebSocket`)\n+ - ReactNativeDarkMode (from `../../node_modules/react-native-dark-mode`)\n- \"RNCAsyncStorage (from `../../node_modules/@react-native-community/async-storage`)\"\n- RNExitApp (from `../../node_modules/react-native-exit-app`)\n- RNFastImage (from `../../node_modules/react-native-fast-image`)\n@@ -228,8 +228,6 @@ EXTERNAL SOURCES:\n:path: \"../../node_modules/react-native/ReactCommon/jsiexecutor\"\nReact-jsinspector:\n:path: \"../../node_modules/react-native/ReactCommon/jsinspector\"\n- react-native-appearance:\n- :path: \"../../node_modules/react-native-appearance\"\nreact-native-cameraroll:\n:path: \"../../node_modules/@react-native-community/cameraroll\"\nreact-native-image-resizer:\n@@ -270,6 +268,8 @@ EXTERNAL SOURCES:\n:path: \"../../node_modules/react-native/Libraries/Vibration\"\nReact-RCTWebSocket:\n:path: \"../../node_modules/react-native/Libraries/WebSocket\"\n+ ReactNativeDarkMode:\n+ :path: \"../../node_modules/react-native-dark-mode\"\nRNCAsyncStorage:\n:path: \"../../node_modules/@react-native-community/async-storage\"\nRNExitApp:\n@@ -308,7 +308,6 @@ SPEC CHECKSUMS:\nReact-jsi: 1a4248256b96fa453536a8dafe11b784e24e789d\nReact-jsiexecutor: 2279e559b921d02dfc6253ebef3dcb3a9dc6c07e\nReact-jsinspector: a58b86545a0185f69768e78ac96ca9fe43fa3694\n- react-native-appearance: 309901290a0aab9ec4bc60ff2c3f94e6aae0267a\nreact-native-cameraroll: 3e5e34d36d93548ae7770ee8ab7b2ae9e778f571\nreact-native-image-resizer: 48eb06a18a6d0a632ffa162a51ca61a68fb5322f\nreact-native-in-app-message: f91de5009620af01456531118264c93e249b83ec\n@@ -329,6 +328,7 @@ SPEC CHECKSUMS:\nReact-RCTText: d91537e29e38dc69cf09cbca0875cf5dc7402da6\nReact-RCTVibration: 7655d72dfb919dd6d8e135ca108a5a2bd9fcd7b4\nReact-RCTWebSocket: 7cd2c8d0f8ddd680dc76404defba7ab1f56b83af\n+ ReactNativeDarkMode: bac355fdddfc07de71ceef6a324b99481eb3f1f4\nRNCAsyncStorage: 60a80e72d95bf02a01cace55d3697d9724f0d77f\nRNExitApp: c4e052df2568b43bec8a37c7cd61194d4cfee2c3\nRNFastImage: 9b0c22643872bb7494c8d87bbbb66cc4c0d9e7a2\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"lottie-react-native\": \"^3.2.1\",\n\"react\": \"16.8.6\",\n\"react-native\": \"0.60.6\",\n- \"react-native-appearance\": \"^0.1.0\",\n+ \"react-native-dark-mode\": \"^0.1.3\",\n\"react-native-exit-app\": \"^1.1.0\",\n\"react-native-fast-image\": \"^7.0.2\",\n\"react-native-firebase\": \"^5.5.6\",\n" }, { "change_type": "MODIFY", "old_path": "native/themes/theme-handler.react.js", "new_path": "native/themes/theme-handler.react.js", "diff": "@@ -12,7 +12,10 @@ import { updateThemeInfoActionType } from '../redux/action-types';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n-import { Appearance } from 'react-native-appearance';\n+import {\n+ initialMode as initialSystemTheme,\n+ eventEmitter as systemThemeEventEmitter,\n+} from 'react-native-dark-mode';\nimport { connect } from 'lib/utils/redux-utils';\n@@ -30,7 +33,6 @@ class ThemeHandler extends React.PureComponent<Props> {\nrehydrateConcluded: PropTypes.bool.isRequired,\ndispatchActionPayload: PropTypes.func.isRequired,\n};\n- appearanceListener: ?{ +remove: () => void, ... };\ncomponentDidMount() {\nif (this.props.rehydrateConcluded) {\n@@ -45,24 +47,23 @@ class ThemeHandler extends React.PureComponent<Props> {\n}\ncomponentWillUnmount() {\n- if (this.appearanceListener) {\n- this.appearanceListener.remove();\n- }\n+ systemThemeEventEmitter.removeListener(\n+ 'currentModeChanged',\n+ this.updateSystemTheme,\n+ );\n}\nstartListening() {\nif (osCanTheme) {\n- this.appearanceListener =\n- Appearance.addChangeListener(this.systemThemeChanged);\n- this.updateSystemTheme(Appearance.getColorScheme());\n+ systemThemeEventEmitter.addListener(\n+ 'currentModeChanged',\n+ this.updateSystemTheme,\n+ );\n+ this.updateSystemTheme(initialSystemTheme);\n}\n}\n- systemThemeChanged = ({ colorScheme }: { colorScheme: GlobalTheme, ... }) => {\n- this.updateSystemTheme(colorScheme);\n- }\n-\n- updateSystemTheme(colorScheme: GlobalTheme) {\n+ updateSystemTheme = (colorScheme: GlobalTheme) => {\nif (this.props.globalThemeInfo.systemTheme === colorScheme) {\nreturn;\n}\n" }, { "change_type": "MODIFY", "old_path": "native/types/themes.js", "new_path": "native/types/themes.js", "diff": "@@ -20,8 +20,9 @@ export const globalThemeInfoPropType = PropTypes.shape({\npreference: PropTypes.oneOf([ 'light', 'dark', 'system' ]).isRequired,\n});\n-export const osCanTheme = Platform.OS === \"ios\" &&\n- parseInt(Platform.Version, 10) >= 13;\n+export const osCanTheme =\n+ (Platform.OS === \"ios\" && parseInt(Platform.Version, 10) >= 13) ||\n+ (Platform.OS === \"android\" && Platform.Version >= 29);\nexport const defaultGlobalThemeInfo = {\nactiveTheme: osCanTheme ? null : 'light',\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "resolved \"https://registry.yarnpkg.com/@types/q/-/q-1.5.2.tgz#690a1475b84f2a884fd07cd797c00f5f31356ea8\"\nintegrity sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw==\n+\"@types/react-native@*\":\n+ version \"0.60.21\"\n+ resolved \"https://registry.yarnpkg.com/@types/react-native/-/react-native-0.60.21.tgz#81a41cae7b232f52ab3983d854f4a0b0df79531e\"\n+ integrity sha512-E7F+P/UG4Utu+kh8Hy544i0m4CzpHw1awNX6hVfkhlu4mXSlAn6KLZzKEkPBbHm7g1kspmZTiuP23HAKZpASPw==\n+ dependencies:\n+ \"@types/prop-types\" \"*\"\n+ \"@types/react\" \"*\"\n+\n\"@types/react@*\":\nversion \"16.9.5\"\nresolved \"https://registry.yarnpkg.com/@types/react/-/react-16.9.5.tgz#079dabd918b19b32118c25fd00a786bb6d0d5e51\"\n@@ -4812,13 +4820,6 @@ fb-watchman@^2.0.0:\ndependencies:\nbser \"^2.0.0\"\n-fbemitter@^2.1.1:\n- version \"2.1.1\"\n- resolved \"https://registry.yarnpkg.com/fbemitter/-/fbemitter-2.1.1.tgz#523e14fdaf5248805bb02f62efc33be703f51865\"\n- integrity sha1-Uj4U/a9SSIBbsC9i78M75wP1GGU=\n- dependencies:\n- fbjs \"^0.8.4\"\n-\nfbjs-css-vars@^1.0.0:\nversion \"1.0.2\"\nresolved \"https://registry.yarnpkg.com/fbjs-css-vars/-/fbjs-css-vars-1.0.2.tgz#216551136ae02fe255932c3ec8775f18e2c078b8\"\n@@ -4840,7 +4841,7 @@ fbjs-scripts@^1.1.0:\nsemver \"^5.1.0\"\nthrough2 \"^2.0.0\"\n-fbjs@^0.8.4, fbjs@^0.8.9:\n+fbjs@^0.8.9:\nversion \"0.8.17\"\nresolved \"https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd\"\nintegrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90=\n@@ -10029,14 +10030,16 @@ react-linkify@^1.0.0-alpha:\nlinkify-it \"^2.0.3\"\ntlds \"^1.199.0\"\n-react-native-appearance@^0.1.0:\n- version \"0.1.0\"\n- resolved \"https://registry.yarnpkg.com/react-native-appearance/-/react-native-appearance-0.1.0.tgz#a195d9a71c03dc4de246b86a18e95c8ecd08d505\"\n- integrity sha512-WitRX+1bYCwTOxh0dV+/3Pv/O0jzKl/Y+O4kMiPhiJFe/tibAE8l5wYw6l3X1gkPMn52khdxBDV0Ndkp3Pjvdw==\n+react-native-dark-mode@^0.1.3:\n+ version \"0.1.3\"\n+ resolved \"https://registry.yarnpkg.com/react-native-dark-mode/-/react-native-dark-mode-0.1.3.tgz#fab664ec4b989f03ce0dc7b77ef58eb3fa4a5753\"\n+ integrity sha512-fRKOVBWwikLpLwaIikx3A+ifi6aBLKcEo+0sH/4ag02w6MkbsyUPYtSbWKJJoB95frkCL7HiXnd/QZTG9wLgGw==\ndependencies:\n- fbemitter \"^2.1.1\"\n- invariant \"^2.2.4\"\n- use-subscription \"^1.0.0\"\n+ \"@types/events\" \"*\"\n+ \"@types/react\" \"*\"\n+ \"@types/react-native\" \"*\"\n+ events \"^3.0.0\"\n+ toolkit.ts \"^0.0.2\"\nreact-native-exit-app@^1.1.0:\nversion \"1.1.0\"\n@@ -12018,6 +12021,11 @@ tokenize-text@^1.1.3:\ndependencies:\nlodash \"^3.2.0\"\n+toolkit.ts@^0.0.2:\n+ version \"0.0.2\"\n+ resolved \"https://registry.yarnpkg.com/toolkit.ts/-/toolkit.ts-0.0.2.tgz#91bde730e5e6ad1a22146cdaf83f4a52721cf3b2\"\n+ integrity sha512-yJJTVbCwiD6AfFgReewJCGJuODmyZUeL1sDjnxp33t0UBxnezgQrLbz/F9++RC28CTlk5u5pVji4TbeondYEkw==\n+\ntouch@^3.1.0:\nversion \"3.1.0\"\nresolved \"https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b\"\n@@ -12380,11 +12388,6 @@ url@^0.11.0:\npunycode \"1.3.2\"\nquerystring \"0.2.0\"\n-use-subscription@^1.0.0:\n- version \"1.1.1\"\n- resolved \"https://registry.yarnpkg.com/use-subscription/-/use-subscription-1.1.1.tgz#5509363e9bb152c4fb334151d4dceb943beaa7bb\"\n- integrity sha512-gk4fPTYvNhs6Ia7u8/+K7bM7sZ7O7AMfWtS+zPO8luH+zWuiGgGcrW0hL4MRWZSzXo+4ofNorf87wZwBKz2YdQ==\n-\nuse@^3.1.0:\nversion \"3.1.1\"\nresolved \"https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Change to react-native-dark-mode for Android support
129,187
17.10.2019 10:09:19
14,400
613dd60f91acc99ad8d7a2466b35b2565234ecb6
[native] Has some fixes for Android
[ { "change_type": "MODIFY", "old_path": "native/android/app/src/main/AndroidManifest.xml", "new_path": "native/android/app/src/main/AndroidManifest.xml", "diff": "android:name=\".MainActivity\"\nandroid:launchMode=\"singleTask\"\nandroid:label=\"@string/app_name\"\n- android:configChanges=\"keyboard|keyboardHidden|orientation|screenSize\"\n+ android:configChanges=\"keyboard|keyboardHidden|orientation|screenSize|uiMode\"\nandroid:windowSoftInputMode=\"adjustResize\"\nandroid:exported=\"true\"\n>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -117,7 +117,7 @@ PODS:\n- React-Core (= 0.60.6)\n- React-RCTWebSocket (0.60.6):\n- React-Core (= 0.60.6)\n- - ReactNativeDarkMode (0.1.3):\n+ - ReactNativeDarkMode (0.2.0-rc.1):\n- React\n- RNCAsyncStorage (1.6.2):\n- React\n@@ -328,7 +328,7 @@ SPEC CHECKSUMS:\nReact-RCTText: d91537e29e38dc69cf09cbca0875cf5dc7402da6\nReact-RCTVibration: 7655d72dfb919dd6d8e135ca108a5a2bd9fcd7b4\nReact-RCTWebSocket: 7cd2c8d0f8ddd680dc76404defba7ab1f56b83af\n- ReactNativeDarkMode: bac355fdddfc07de71ceef6a324b99481eb3f1f4\n+ ReactNativeDarkMode: 88317ff05ba95fd063dd347ad32f8c4cefd3166c\nRNCAsyncStorage: 60a80e72d95bf02a01cace55d3697d9724f0d77f\nRNExitApp: c4e052df2568b43bec8a37c7cd61194d4cfee2c3\nRNFastImage: 9b0c22643872bb7494c8d87bbbb66cc4c0d9e7a2\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"lottie-react-native\": \"^3.2.1\",\n\"react\": \"16.8.6\",\n\"react-native\": \"0.60.6\",\n- \"react-native-dark-mode\": \"^0.1.3\",\n+ \"react-native-dark-mode\": \"^0.2.0-rc.1\",\n\"react-native-exit-app\": \"^1.1.0\",\n\"react-native-fast-image\": \"^7.0.2\",\n\"react-native-firebase\": \"^5.5.6\",\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -10030,10 +10030,10 @@ react-linkify@^1.0.0-alpha:\nlinkify-it \"^2.0.3\"\ntlds \"^1.199.0\"\n-react-native-dark-mode@^0.1.3:\n- version \"0.1.3\"\n- resolved \"https://registry.yarnpkg.com/react-native-dark-mode/-/react-native-dark-mode-0.1.3.tgz#fab664ec4b989f03ce0dc7b77ef58eb3fa4a5753\"\n- integrity sha512-fRKOVBWwikLpLwaIikx3A+ifi6aBLKcEo+0sH/4ag02w6MkbsyUPYtSbWKJJoB95frkCL7HiXnd/QZTG9wLgGw==\n+react-native-dark-mode@^0.2.0-rc.1:\n+ version \"0.2.0-rc.1\"\n+ resolved \"https://registry.yarnpkg.com/react-native-dark-mode/-/react-native-dark-mode-0.2.0-rc.1.tgz#fc83f4a6d897613f49b49bde10f9c3d0f8e4ae69\"\n+ integrity sha512-pxdr+vdL9KF0pRqlls9A31ie3DdlJ3/2soMTBAWGmqASEhYkvdduH2QvJStrjby0EDSxzV4lTLuw7FdIrkoldw==\ndependencies:\n\"@types/events\" \"*\"\n\"@types/react\" \"*\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] react-native-dark-mode@0.2.0-rc.1 Has some fixes for Android
129,187
17.10.2019 14:45:01
14,400
f581b0af86a8ba491d5a9c16094adccf96b580f2
[native] DisconnectedBar should show below Header on Android
[ { "change_type": "MODIFY", "old_path": "native/navigation/header.react.js", "new_path": "native/navigation/header.react.js", "diff": "import * as React from 'react';\nimport { Header } from 'react-navigation-stack';\n+import { View } from 'react-native';\nimport DisconnectedBar from './disconnected-bar.react';\nexport default function CustomHeader(props: React.ElementProps<typeof Header>) {\nreturn (\n- <>\n+ <View>\n<Header {...props} />\n<DisconnectedBar />\n- </>\n+ </View>\n);\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] DisconnectedBar should show below Header on Android
129,187
18.10.2019 13:32:15
14,400
f32fbbcf3e5978da4db5d8bbee27a0be9be05589
[native] Fix Calendar height calculations for bottom tab bar on Android
[ { "change_type": "MODIFY", "old_path": "native/calendar/calendar.react.js", "new_path": "native/calendar/calendar.react.js", "diff": "@@ -931,12 +931,9 @@ class Calendar extends React.PureComponent<Props, State> {\nconst itemHeight = Calendar.itemHeight(data[index]);\nconst entryAdditionalActiveHeight = Platform.OS === \"android\" ? 21 : 20;\nconst itemEnd = itemStart + itemHeight + entryAdditionalActiveHeight;\n- let visibleHeight = this.flatListHeight() - keyboardHeight;\n- // flatListHeight() factors in the size of the iOS tab bar, but it is hidden\n- // by the keyboard since it is at the bottom\n- if (Platform.OS === \"ios\") {\n- visibleHeight += tabBarSize;\n- }\n+ // flatListHeight() factors in the size of the tab bar,\n+ // but it is hidden by the keyboard since it is at the bottom\n+ const visibleHeight = this.flatListHeight() - keyboardHeight + tabBarSize;\nif (\nthis.currentScrollPosition !== undefined &&\nthis.currentScrollPosition !== null &&\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Fix Calendar height calculations for bottom tab bar on Android
129,187
18.10.2019 15:01:56
14,400
e0e2fb843f06e2f96b0fd0ec2cc60d234c602f38
[native] Style AppearancePreferences for dark mode
[ { "change_type": "MODIFY", "old_path": "native/more/appearance-preferences.react.js", "new_path": "native/more/appearance-preferences.react.js", "diff": "@@ -18,6 +18,7 @@ import Icon from 'react-native-vector-icons/Ionicons';\nimport { connect } from 'lib/utils/redux-utils';\nimport Button from '../components/button.react';\n+import colors from '../themes/colors';\nconst CheckIcon = (props: {||}) => (\n<Icon\n@@ -60,6 +61,24 @@ class AppearancePreferences extends React.PureComponent<Props> {\n};\nrender() {\n+ const isDark = this.props.globalThemeInfo.activeTheme === 'dark';\n+ const scrollViewStyle = isDark\n+ ? styles.scrollViewDark\n+ : styles.scrollViewLight;\n+ const headerStyle = isDark\n+ ? [ styles.header, styles.headerDark ]\n+ : [ styles.header, styles.headerLight ];\n+ const sectionStyle = isDark\n+ ? [ styles.section, styles.sectionDark ]\n+ : [ styles.section, styles.sectionLight ];\n+ const hrStyle = isDark\n+ ? [ styles.hr, styles.hrDark ]\n+ : [ styles.hr, styles.hrLight ];\n+ const optionStyle = isDark\n+ ? [ styles.option, styles.optionDark ]\n+ : [ styles.option, styles.optionLight ];\n+ const { iosHighlightUnderlay } = isDark ? colors.dark : colors.light;\n+\nconst options = [];\nfor (let i = 0; i < optionTexts.length; i++) {\nconst { themePreference, text } = optionTexts[i];\n@@ -71,23 +90,25 @@ class AppearancePreferences extends React.PureComponent<Props> {\nonPress={() => this.onSelectThemePreference(themePreference)}\nstyle={styles.row}\niosFormat=\"highlight\"\n- iosHighlightUnderlayColor=\"#EEEEEEDD\"\n+ iosHighlightUnderlayColor={iosHighlightUnderlay}\nkey={`button_${themePreference}`}\n>\n- <Text style={styles.option}>{text}</Text>\n+ <Text style={optionStyle}>{text}</Text>\n{icon}\n</Button>\n);\nif (i + 1 < optionTexts.length) {\n- options.push(<View style={styles.hr} key={`hr_${themePreference}`} />);\n+ options.push(<View style={hrStyle} key={`hr_${themePreference}`} />);\n}\n}\n+\nreturn (\n- <ScrollView contentContainerStyle={styles.scrollView}>\n- <Text style={styles.header}>APP THEME</Text>\n- <View style={styles.slightlyPaddedSection}>\n- {options}\n- </View>\n+ <ScrollView\n+ contentContainerStyle={styles.scrollViewContentContainer}\n+ style={scrollViewStyle}\n+ >\n+ <Text style={headerStyle}>APP THEME</Text>\n+ <View style={sectionStyle}>{options}</View>\n</ScrollView>\n);\n}\n@@ -108,24 +129,41 @@ class AppearancePreferences extends React.PureComponent<Props> {\n}\nconst styles = StyleSheet.create({\n- scrollView: {\n+ scrollViewContentContainer: {\npaddingTop: 24,\n},\n+ scrollViewLight: {\n+ backgroundColor: colors.light.background,\n+ },\n+ scrollViewDark: {\n+ backgroundColor: colors.dark.background,\n+ },\nheader: {\npaddingHorizontal: 24,\npaddingBottom: 3,\nfontSize: 12,\nfontWeight: \"400\",\n- color: \"#888888\",\n},\n- slightlyPaddedSection: {\n- backgroundColor: 'white',\n+ headerLight: {\n+ color: colors.light.backgroundLabel,\n+ },\n+ headerDark: {\n+ color: colors.dark.backgroundLabel,\n+ },\n+ section: {\nborderTopWidth: 1,\nborderBottomWidth: 1,\n- borderColor: \"#CCCCCC\",\nmarginBottom: 24,\npaddingVertical: 2,\n},\n+ sectionLight: {\n+ backgroundColor: colors.light.foreground,\n+ borderColor: colors.light.foregroundBorder,\n+ },\n+ sectionDark: {\n+ backgroundColor: colors.dark.foreground,\n+ borderColor: colors.dark.foregroundBorder,\n+ },\nrow: {\nflexDirection: 'row',\njustifyContent: 'space-between',\n@@ -133,17 +171,27 @@ const styles = StyleSheet.create({\npaddingVertical: 10,\n},\noption: {\n- color: 'black',\nfontSize: 16,\n},\n+ optionLight: {\n+ color: colors.light.foregroundLabel,\n+ },\n+ optionDark: {\n+ color: colors.dark.foregroundLabel,\n+ },\nicon: {\nlineHeight: Platform.OS === \"ios\" ? 18 : 20,\n},\nhr: {\nheight: 1,\n- backgroundColor: \"#CCCCCC\",\nmarginHorizontal: 15,\n},\n+ hrLight: {\n+ backgroundColor: colors.light.foregroundBorder,\n+ },\n+ hrDark: {\n+ backgroundColor: colors.dark.foregroundBorder,\n+ },\n});\nexport default connect(\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Style AppearancePreferences for dark mode
129,187
18.10.2019 15:13:22
14,400
657b1f91c6c61604fee3f59474b37613e7937dd3
[native] fillInColors
[ { "change_type": "MODIFY", "old_path": "native/.flowconfig", "new_path": "native/.flowconfig", "diff": "[untyped]\n.*/node_modules/@react-native-community/cli/.*/.*\n+; Added this here to avoid Flow errors when importing from react-native/Libraries/StyleSheet/StyleSheetTypes\n+.*/node_modules/react-native/Libraries/Renderer\n+.*/node_modules/react-native/Libraries/Core/Devtools\n+\n[include]\n../lib\n" }, { "change_type": "MODIFY", "old_path": "native/more/appearance-preferences.react.js", "new_path": "native/more/appearance-preferences.react.js", "diff": "@@ -9,16 +9,17 @@ import {\nosCanTheme,\n} from '../types/themes';\nimport { updateThemeInfoActionType } from '../redux/action-types';\n+import type { Styles } from '../types/styles';\nimport * as React from 'react';\n-import { StyleSheet, View, Text, ScrollView, Platform } from 'react-native';\n+import { View, Text, ScrollView, Platform } from 'react-native';\nimport PropTypes from 'prop-types';\nimport Icon from 'react-native-vector-icons/Ionicons';\nimport { connect } from 'lib/utils/redux-utils';\nimport Button from '../components/button.react';\n-import colors from '../themes/colors';\n+import { colors, styleSelector } from '../themes/colors';\nconst CheckIcon = (props: {||}) => (\n<Icon\n@@ -47,6 +48,7 @@ if (osCanTheme) {\ntype Props = {|\n// Redux state\nglobalThemeInfo: GlobalThemeInfo,\n+ styles: Styles,\n// Redux dispatch functions\ndispatchActionPayload: DispatchActionPayload,\n|};\n@@ -54,6 +56,7 @@ class AppearancePreferences extends React.PureComponent<Props> {\nstatic propTypes = {\nglobalThemeInfo: globalThemeInfoPropType.isRequired,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\ndispatchActionPayload: PropTypes.func.isRequired,\n};\nstatic navigationOptions = {\n@@ -62,21 +65,6 @@ class AppearancePreferences extends React.PureComponent<Props> {\nrender() {\nconst isDark = this.props.globalThemeInfo.activeTheme === 'dark';\n- const scrollViewStyle = isDark\n- ? styles.scrollViewDark\n- : styles.scrollViewLight;\n- const headerStyle = isDark\n- ? [ styles.header, styles.headerDark ]\n- : [ styles.header, styles.headerLight ];\n- const sectionStyle = isDark\n- ? [ styles.section, styles.sectionDark ]\n- : [ styles.section, styles.sectionLight ];\n- const hrStyle = isDark\n- ? [ styles.hr, styles.hrDark ]\n- : [ styles.hr, styles.hrLight ];\n- const optionStyle = isDark\n- ? [ styles.option, styles.optionDark ]\n- : [ styles.option, styles.optionLight ];\nconst { iosHighlightUnderlay } = isDark ? colors.dark : colors.light;\nconst options = [];\n@@ -88,27 +76,32 @@ class AppearancePreferences extends React.PureComponent<Props> {\noptions.push(\n<Button\nonPress={() => this.onSelectThemePreference(themePreference)}\n- style={styles.row}\n+ style={this.props.styles.row}\niosFormat=\"highlight\"\niosHighlightUnderlayColor={iosHighlightUnderlay}\nkey={`button_${themePreference}`}\n>\n- <Text style={optionStyle}>{text}</Text>\n+ <Text style={this.props.styles.option}>{text}</Text>\n{icon}\n</Button>\n);\nif (i + 1 < optionTexts.length) {\n- options.push(<View style={hrStyle} key={`hr_${themePreference}`} />);\n+ options.push(\n+ <View\n+ style={this.props.styles.hr}\n+ key={`hr_${themePreference}`}\n+ />\n+ );\n}\n}\nreturn (\n<ScrollView\n- contentContainerStyle={styles.scrollViewContentContainer}\n- style={scrollViewStyle}\n+ contentContainerStyle={this.props.styles.scrollViewContentContainer}\n+ style={this.props.styles.scrollView}\n>\n- <Text style={headerStyle}>APP THEME</Text>\n- <View style={sectionStyle}>{options}</View>\n+ <Text style={this.props.styles.header}>APP THEME</Text>\n+ <View style={this.props.styles.section}>{options}</View>\n</ScrollView>\n);\n}\n@@ -128,41 +121,27 @@ class AppearancePreferences extends React.PureComponent<Props> {\n}\n-const styles = StyleSheet.create({\n+const styles = {\nscrollViewContentContainer: {\npaddingTop: 24,\n},\n- scrollViewLight: {\n- backgroundColor: colors.light.background,\n- },\n- scrollViewDark: {\n- backgroundColor: colors.dark.background,\n+ scrollView: {\n+ backgroundColor: 'background',\n},\nheader: {\npaddingHorizontal: 24,\npaddingBottom: 3,\nfontSize: 12,\nfontWeight: \"400\",\n- },\n- headerLight: {\n- color: colors.light.backgroundLabel,\n- },\n- headerDark: {\n- color: colors.dark.backgroundLabel,\n+ color: 'backgroundLabel',\n},\nsection: {\nborderTopWidth: 1,\nborderBottomWidth: 1,\nmarginBottom: 24,\npaddingVertical: 2,\n- },\n- sectionLight: {\n- backgroundColor: colors.light.foreground,\n- borderColor: colors.light.foregroundBorder,\n- },\n- sectionDark: {\n- backgroundColor: colors.dark.foreground,\n- borderColor: colors.dark.foregroundBorder,\n+ backgroundColor: 'foreground',\n+ borderColor: 'foregroundBorder',\n},\nrow: {\nflexDirection: 'row',\n@@ -172,12 +151,7 @@ const styles = StyleSheet.create({\n},\noption: {\nfontSize: 16,\n- },\n- optionLight: {\n- color: colors.light.foregroundLabel,\n- },\n- optionDark: {\n- color: colors.dark.foregroundLabel,\n+ color: 'foregroundLabel',\n},\nicon: {\nlineHeight: Platform.OS === \"ios\" ? 18 : 20,\n@@ -185,18 +159,15 @@ const styles = StyleSheet.create({\nhr: {\nheight: 1,\nmarginHorizontal: 15,\n+ backgroundColor: 'foregroundBorder',\n},\n- hrLight: {\n- backgroundColor: colors.light.foregroundBorder,\n- },\n- hrDark: {\n- backgroundColor: colors.dark.foregroundBorder,\n- },\n-});\n+};\n+const stylesSelector = styleSelector(styles);\nexport default connect(\n(state: AppState) => ({\nglobalThemeInfo: state.globalThemeInfo,\n+ styles: stylesSelector(state),\n}),\nnull,\ntrue,\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/themes/colors.js", "diff": "+// @flow\n+\n+import type { GlobalTheme } from '../types/themes';\n+import type { Styles } from '../types/styles';\n+import type { AppState } from '../redux/redux-setup';\n+\n+import { StyleSheet } from 'react-native';\n+import { createSelector } from 'reselect';\n+\n+const colors = {\n+ light: {\n+ background: '#E9E9EE',\n+ backgroundLabel: '#8E8E93',\n+ foreground: '#F2F2F7',\n+ foregroundBorder: '#D1D1D6',\n+ foregroundLabel: 'black',\n+ foregroundSecondaryLabel: '#888888',\n+ iosHighlightUnderlay: '#EEEEEEDD',\n+ modalBackground: '#E5E5EA',\n+ modalBackgroundLabel: '#333333',\n+ redButton: '#BB8888',\n+ greenButton: '#88BB88',\n+ redText: '#AA0000',\n+ greenText: 'green',\n+ link: '#036AFF',\n+ },\n+ dark: {\n+ background: '#1C1C1E',\n+ backgroundLabel: '#8E8E93',\n+ foreground: '#3A3A3C',\n+ foregroundBorder: '#2C2C2E',\n+ foregroundLabel: 'white',\n+ foregroundSecondaryLabel: '#AAAAAA',\n+ iosHighlightUnderlay: '#444444DD',\n+ modalBackground: '#2C2C2E',\n+ modalBackgroundLabel: '#CCCCCC',\n+ redButton: '#FF4444',\n+ greenButton: '#44BB44',\n+ redText: '#FF4444',\n+ greenText: '#44FF44',\n+ link: '#428FFF',\n+ },\n+};\n+\n+const magicStrings = new Set();\n+for (let theme in colors) {\n+ for (let magicString in colors[theme]) {\n+ magicStrings.add(magicString);\n+ }\n+}\n+\n+function styleSelector<+S: Styles>(obj: S): (state: AppState) => S {\n+ return createSelector(\n+ (state: AppState) => state.globalThemeInfo.activeTheme,\n+ (theme: ?GlobalTheme) => {\n+ const explicitTheme = theme ? theme : 'light';\n+\n+ const result = {};\n+ for (let key in obj) {\n+ const style = obj[key];\n+ const filledInStyle = { ...style };\n+ for (let styleKey in style) {\n+ const styleValue = style[styleKey];\n+ if (magicStrings.has(styleValue)) {\n+ const mapped = colors[explicitTheme][styleValue];\n+ if (mapped) {\n+ filledInStyle[styleKey] = mapped;\n+ }\n+ }\n+ }\n+ result[key] = filledInStyle;\n+ }\n+\n+ return StyleSheet.create(result);\n+ },\n+ );\n+}\n+\n+export {\n+ colors,\n+ styleSelector,\n+};\n" }, { "change_type": "MODIFY", "old_path": "native/types/styles.js", "new_path": "native/types/styles.js", "diff": "// @flow\n+import type {\n+ ____Styles_Internal,\n+} from 'react-native/Libraries/StyleSheet/StyleSheetTypes';\n+\nimport * as React from 'react';\nimport { View, Text, Image } from 'react-native';\n@@ -12,8 +16,11 @@ type TextStyle = $PropertyType<TextProps, 'style'>;\ntype ImageProps = React.ElementProps<typeof Image>;\ntype ImageStyle = $PropertyType<ImageProps, 'style'>;\n+type Styles = ____Styles_Internal;\n+\nexport type {\nViewStyle,\nTextStyle,\nImageStyle,\n+ Styles,\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] fillInColors
129,187
22.10.2019 12:33:22
14,400
e949bb3af85a387f52becf4c4096ce81cbcc6294
[native] Improve contrast on some colors
[ { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -9,7 +9,7 @@ import { createSelector } from 'reselect';\nconst colors = {\nlight: {\n- background: '#E9E9EE',\n+ background: '#E0E0E5',\nbackgroundLabel: '#8E8E93',\nforeground: '#F2F2F7',\nforegroundBorder: '#D1D1D6',\n@@ -38,7 +38,7 @@ const colors = {\ngreenButton: '#44BB44',\nredText: '#FF4444',\ngreenText: '#44FF44',\n- link: '#428FFF',\n+ link: '#129AFF',\n},\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Improve contrast on some colors
129,187
22.10.2019 18:12:40
14,400
bfadbfbc3253aeaa2d369f7d3f683fb0f749be98
[native] Prefix "panel" to some theme colors
[ { "change_type": "MODIFY", "old_path": "native/more/appearance-preferences.react.js", "new_path": "native/more/appearance-preferences.react.js", "diff": "@@ -65,7 +65,9 @@ class AppearancePreferences extends React.PureComponent<Props> {\nrender() {\nconst isDark = this.props.globalThemeInfo.activeTheme === 'dark';\n- const { iosHighlightUnderlay } = isDark ? colors.dark : colors.light;\n+ const { panelIosHighlightUnderlay: underlay } = isDark\n+ ? colors.dark\n+ : colors.light;\nconst options = [];\nfor (let i = 0; i < optionTexts.length; i++) {\n@@ -78,7 +80,7 @@ class AppearancePreferences extends React.PureComponent<Props> {\nonPress={() => this.onSelectThemePreference(themePreference)}\nstyle={this.props.styles.row}\niosFormat=\"highlight\"\n- iosHighlightUnderlayColor={iosHighlightUnderlay}\n+ iosHighlightUnderlayColor={underlay}\nkey={`button_${themePreference}`}\n>\n<Text style={this.props.styles.option}>{text}</Text>\n@@ -126,22 +128,22 @@ const styles = {\npaddingTop: 24,\n},\nscrollView: {\n- backgroundColor: 'background',\n+ backgroundColor: 'panelBackground',\n},\nheader: {\npaddingHorizontal: 24,\npaddingBottom: 3,\nfontSize: 12,\nfontWeight: \"400\",\n- color: 'backgroundLabel',\n+ color: 'panelBackgroundLabel',\n},\nsection: {\nborderTopWidth: 1,\nborderBottomWidth: 1,\nmarginBottom: 24,\npaddingVertical: 2,\n- backgroundColor: 'foreground',\n- borderColor: 'foregroundBorder',\n+ backgroundColor: 'panelForeground',\n+ borderColor: 'panelForegroundBorder',\n},\nrow: {\nflexDirection: 'row',\n@@ -151,7 +153,7 @@ const styles = {\n},\noption: {\nfontSize: 16,\n- color: 'foregroundLabel',\n+ color: 'panelForegroundLabel',\n},\nicon: {\nlineHeight: Platform.OS === \"ios\" ? 18 : 20,\n@@ -159,7 +161,7 @@ const styles = {\nhr: {\nheight: 1,\nmarginHorizontal: 15,\n- backgroundColor: 'foregroundBorder',\n+ backgroundColor: 'panelForegroundBorder',\n},\n};\nconst stylesSelector = styleSelector(styles);\n" }, { "change_type": "MODIFY", "old_path": "native/more/build-info.react.js", "new_path": "native/more/build-info.react.js", "diff": "@@ -63,7 +63,7 @@ const styles = {\npaddingTop: 24,\n},\nscrollView: {\n- backgroundColor: 'background',\n+ backgroundColor: 'panelBackground',\n},\nsection: {\nborderTopWidth: 1,\n@@ -71,8 +71,8 @@ const styles = {\npaddingVertical: 6,\npaddingHorizontal: 24,\nmarginBottom: 24,\n- backgroundColor: 'foreground',\n- borderColor: 'foregroundBorder',\n+ backgroundColor: 'panelForeground',\n+ borderColor: 'panelForegroundBorder',\n},\nrow: {\nflexDirection: 'row',\n@@ -81,7 +81,7 @@ const styles = {\n},\nlabel: {\nfontSize: 16,\n- color: 'foregroundSecondaryLabel',\n+ color: 'panelForegroundSecondaryLabel',\npaddingRight: 12,\n},\nreleaseText: {\n@@ -90,12 +90,12 @@ const styles = {\n},\ntext: {\nfontSize: 16,\n- color: 'foregroundLabel',\n+ color: 'panelForegroundLabel',\n},\nthanksText: {\nflex: 1,\nfontSize: 16,\n- color: 'foregroundLabel',\n+ color: 'panelForegroundLabel',\ntextAlign: 'center',\n},\n};\n" }, { "change_type": "MODIFY", "old_path": "native/more/delete-account.react.js", "new_path": "native/more/delete-account.react.js", "diff": "@@ -223,14 +223,14 @@ const styles = {\npaddingTop: 24,\n},\nscrollView: {\n- backgroundColor: 'background',\n+ backgroundColor: 'panelBackground',\n},\nheader: {\npaddingHorizontal: 24,\npaddingBottom: 3,\nfontSize: 12,\nfontWeight: \"400\",\n- color: 'backgroundLabel',\n+ color: 'panelBackgroundLabel',\n},\nsection: {\nflexDirection: 'row',\n@@ -243,13 +243,13 @@ const styles = {\n}),\npaddingHorizontal: 24,\nmarginBottom: 24,\n- backgroundColor: 'foreground',\n- borderColor: 'foregroundBorder',\n+ backgroundColor: 'panelForeground',\n+ borderColor: 'panelForegroundBorder',\n},\ninput: {\nflex: 1,\nfontSize: 16,\n- color: 'modalBackgroundLabel',\n+ color: 'panelModalBackgroundLabel',\nfontFamily: 'Arial',\npaddingVertical: 0,\n},\n@@ -264,7 +264,7 @@ const styles = {\nsaveText: {\nfontSize: 18,\ntextAlign: 'center',\n- color: 'foregroundLabel',\n+ color: 'panelForegroundLabel',\n},\nonePasswordButton: {\nmarginLeft: 6,\n" }, { "change_type": "MODIFY", "old_path": "native/more/dev-tools.react.js", "new_path": "native/more/dev-tools.react.js", "diff": "@@ -62,7 +62,9 @@ class DevTools extends React.PureComponent<Props> {\nrender() {\nconst isDark = this.props.activeTheme === 'dark';\n- const { iosHighlightUnderlay } = isDark ? colors.dark : colors.light;\n+ const { panelIosHighlightUnderlay: underlay } = isDark\n+ ? colors.dark\n+ : colors.light;\nconst serverButtons = [];\nfor (let server of serverOptions) {\n@@ -74,7 +76,7 @@ class DevTools extends React.PureComponent<Props> {\nonPress={() => this.onSelectServer(server)}\nstyle={this.props.styles.row}\niosFormat=\"highlight\"\n- iosHighlightUnderlayColor={iosHighlightUnderlay}\n+ iosHighlightUnderlayColor={underlay}\nkey={`server${server}`}\n>\n<Text style={this.props.styles.serverText}>{server}</Text>\n@@ -110,7 +112,7 @@ class DevTools extends React.PureComponent<Props> {\nonPress={this.onSelectCustomServer}\nstyle={this.props.styles.row}\niosFormat=\"highlight\"\n- iosHighlightUnderlayColor={iosHighlightUnderlay}\n+ iosHighlightUnderlayColor={underlay}\nkey=\"customServer\"\n>\n{customServerLabel}\n@@ -129,7 +131,7 @@ class DevTools extends React.PureComponent<Props> {\nonPress={this.onPressCrash}\nstyle={this.props.styles.row}\niosFormat=\"highlight\"\n- iosHighlightUnderlayColor={iosHighlightUnderlay}\n+ iosHighlightUnderlayColor={underlay}\n>\n<Text style={this.props.styles.redText}>Trigger a crash</Text>\n</Button>\n@@ -138,7 +140,7 @@ class DevTools extends React.PureComponent<Props> {\nonPress={this.onPressKill}\nstyle={this.props.styles.row}\niosFormat=\"highlight\"\n- iosHighlightUnderlayColor={iosHighlightUnderlay}\n+ iosHighlightUnderlayColor={underlay}\n>\n<Text style={this.props.styles.redText}>Kill the app</Text>\n</Button>\n@@ -147,7 +149,7 @@ class DevTools extends React.PureComponent<Props> {\nonPress={this.onPressWipe}\nstyle={this.props.styles.row}\niosFormat=\"highlight\"\n- iosHighlightUnderlayColor={iosHighlightUnderlay}\n+ iosHighlightUnderlayColor={underlay}\n>\n<Text style={this.props.styles.redText}>\nWipe state and kill app\n@@ -197,15 +199,15 @@ const styles = {\npaddingTop: 24,\n},\nscrollView: {\n- backgroundColor: 'background',\n+ backgroundColor: 'panelBackground',\n},\nslightlyPaddedSection: {\nborderTopWidth: 1,\nborderBottomWidth: 1,\nmarginBottom: 24,\npaddingVertical: 2,\n- backgroundColor: 'foreground',\n- borderColor: 'foregroundBorder',\n+ backgroundColor: 'panelForeground',\n+ borderColor: 'panelForegroundBorder',\n},\nrow: {\nflexDirection: 'row',\n@@ -220,7 +222,7 @@ const styles = {\n},\nhr: {\nheight: 1,\n- backgroundColor: 'foregroundBorder',\n+ backgroundColor: 'panelForegroundBorder',\nmarginHorizontal: 15,\n},\nheader: {\n@@ -228,14 +230,14 @@ const styles = {\npaddingBottom: 3,\nfontSize: 12,\nfontWeight: \"400\",\n- color: 'backgroundLabel',\n+ color: 'panelBackgroundLabel',\n},\ncustomServerLabel: {\n- color: 'foregroundSecondaryLabel',\n+ color: 'panelForegroundSecondaryLabel',\nfontSize: 16,\n},\nserverText: {\n- color: 'foregroundLabel',\n+ color: 'panelForegroundLabel',\nfontSize: 16,\n},\nserverContainer: {\n" }, { "change_type": "MODIFY", "old_path": "native/more/edit-email.react.js", "new_path": "native/more/edit-email.react.js", "diff": "@@ -297,14 +297,14 @@ const styles = {\npaddingTop: 24,\n},\nscrollView: {\n- backgroundColor: 'background',\n+ backgroundColor: 'panelBackground',\n},\nheader: {\npaddingHorizontal: 24,\npaddingBottom: 3,\nfontSize: 12,\nfontWeight: \"400\",\n- color: 'backgroundLabel',\n+ color: 'panelBackgroundLabel',\n},\nsection: {\nflexDirection: 'row',\n@@ -317,8 +317,8 @@ const styles = {\n}),\npaddingHorizontal: 24,\nmarginBottom: 24,\n- backgroundColor: 'foreground',\n- borderColor: 'foregroundBorder',\n+ backgroundColor: 'panelForeground',\n+ borderColor: 'panelForegroundBorder',\n},\ninput: {\nflex: 1,\n@@ -338,7 +338,7 @@ const styles = {\nsaveText: {\nfontSize: 18,\ntextAlign: 'center',\n- color: 'foregroundLabel',\n+ color: 'panelForegroundLabel',\n},\nonePasswordButton: {\nmarginLeft: 6,\n" }, { "change_type": "MODIFY", "old_path": "native/more/edit-password.react.js", "new_path": "native/more/edit-password.react.js", "diff": "@@ -353,14 +353,14 @@ const styles = {\npaddingTop: 24,\n},\nscrollView: {\n- backgroundColor: 'background',\n+ backgroundColor: 'panelBackground',\n},\nheader: {\npaddingHorizontal: 24,\npaddingBottom: 3,\nfontSize: 12,\nfontWeight: \"400\",\n- color: 'backgroundLabel',\n+ color: 'panelBackgroundLabel',\n},\nsection: {\nborderTopWidth: 1,\n@@ -370,8 +370,8 @@ const styles = {\ndefault: 2,\n}),\nmarginBottom: 24,\n- backgroundColor: 'foreground',\n- borderColor: 'foregroundBorder',\n+ backgroundColor: 'panelForeground',\n+ borderColor: 'panelForegroundBorder',\n},\nrow: {\nflexDirection: 'row',\n@@ -384,7 +384,7 @@ const styles = {\n},\nhr: {\nheight: 1,\n- backgroundColor: 'foregroundBorder',\n+ backgroundColor: 'panelForegroundBorder',\nmarginHorizontal: 15,\n},\ninput: {\n@@ -405,7 +405,7 @@ const styles = {\nsaveText: {\nfontSize: 18,\ntextAlign: 'center',\n- color: 'foregroundLabel',\n+ color: 'panelForegroundLabel',\n},\nonePasswordButton: {\nmarginLeft: 6,\n" }, { "change_type": "MODIFY", "old_path": "native/more/more-screen.react.js", "new_path": "native/more/more-screen.react.js", "diff": "@@ -133,7 +133,7 @@ class MoreScreen extends React.PureComponent<Props> {\n}\nconst isDark = this.props.activeTheme === 'dark';\n- const { iosHighlightUnderlay, link: linkColor } = isDark\n+ const { panelIosHighlightUnderlay: underlay, link: linkColor } = isDark\n? colors.dark\n: colors.light;\nreturn (\n@@ -192,7 +192,7 @@ class MoreScreen extends React.PureComponent<Props> {\nonPress={this.onPressAppearance}\nstyle={this.props.styles.submenuButton}\niosFormat=\"highlight\"\n- iosHighlightUnderlayColor={iosHighlightUnderlay}\n+ iosHighlightUnderlayColor={underlay}\n>\n<Text style={this.props.styles.submenuText}>Appearance</Text>\n<Icon\n@@ -207,7 +207,7 @@ class MoreScreen extends React.PureComponent<Props> {\nonPress={this.onPressBuildInfo}\nstyle={this.props.styles.submenuButton}\niosFormat=\"highlight\"\n- iosHighlightUnderlayColor={iosHighlightUnderlay}\n+ iosHighlightUnderlayColor={underlay}\n>\n<Text style={this.props.styles.submenuText}>Build info</Text>\n<Icon\n@@ -220,7 +220,7 @@ class MoreScreen extends React.PureComponent<Props> {\nonPress={this.onPressDevTools}\nstyle={this.props.styles.submenuButton}\niosFormat=\"highlight\"\n- iosHighlightUnderlayColor={iosHighlightUnderlay}\n+ iosHighlightUnderlayColor={underlay}\n>\n<Text style={this.props.styles.submenuText}>Developer tools</Text>\n<Icon\n@@ -235,7 +235,7 @@ class MoreScreen extends React.PureComponent<Props> {\nonPress={this.onPressDeleteAccount}\nstyle={this.props.styles.deleteAccountButton}\niosFormat=\"highlight\"\n- iosHighlightUnderlayColor={iosHighlightUnderlay}\n+ iosHighlightUnderlayColor={underlay}\n>\n<Text style={this.props.styles.deleteAccountText}>\nDelete account...\n@@ -347,7 +347,7 @@ const styles = {\npaddingTop: 24,\n},\nscrollView: {\n- backgroundColor: 'background',\n+ backgroundColor: 'panelBackground',\n},\nsection: {\nborderTopWidth: 1,\n@@ -355,23 +355,23 @@ const styles = {\npaddingVertical: 12,\npaddingHorizontal: 24,\nmarginBottom: 24,\n- backgroundColor: 'foreground',\n- borderColor: 'foregroundBorder',\n+ backgroundColor: 'panelForeground',\n+ borderColor: 'panelForegroundBorder',\n},\nunpaddedSection: {\nborderTopWidth: 1,\nborderBottomWidth: 1,\nmarginBottom: 24,\n- backgroundColor: 'foreground',\n- borderColor: 'foregroundBorder',\n+ backgroundColor: 'panelForeground',\n+ borderColor: 'panelForegroundBorder',\n},\nslightlyPaddedSection: {\nborderTopWidth: 1,\nborderBottomWidth: 1,\nmarginBottom: 24,\npaddingVertical: 2,\n- backgroundColor: 'foreground',\n- borderColor: 'foregroundBorder',\n+ backgroundColor: 'panelForeground',\n+ borderColor: 'panelForegroundBorder',\n},\nrow: {\nflex: 1,\n@@ -380,14 +380,14 @@ const styles = {\n},\nlabel: {\nfontSize: 16,\n- color: 'foregroundSecondaryLabel',\n+ color: 'panelForegroundSecondaryLabel',\npaddingRight: 12,\n},\nusername: {\n- color: 'foregroundLabel',\n+ color: 'panelForegroundLabel',\n},\nvalue: {\n- color: 'foregroundLabel',\n+ color: 'panelForegroundLabel',\nfontSize: 16,\ntextAlign: 'right',\n},\n@@ -404,7 +404,7 @@ const styles = {\npaddingBottom: 3,\nfontSize: 12,\nfontWeight: \"400\",\n- color: 'backgroundLabel',\n+ color: 'panelBackgroundLabel',\n},\nverification: {\nflexDirection: 'row',\n@@ -454,7 +454,7 @@ const styles = {\npaddingVertical: 10,\n},\nsubmenuText: {\n- color: 'foregroundLabel',\n+ color: 'panelForegroundLabel',\nfontSize: 16,\nflex: 1,\n},\n" }, { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -9,36 +9,36 @@ import { createSelector } from 'reselect';\nconst colors = {\nlight: {\n- background: '#E0E0E5',\n- backgroundLabel: '#8E8E93',\n- foreground: '#F2F2F7',\n- foregroundBorder: '#D1D1D6',\n- foregroundLabel: 'black',\n- foregroundSecondaryLabel: '#888888',\n- iosHighlightUnderlay: '#EEEEEEDD',\n- modalBackground: '#E5E5EA',\n- modalBackgroundLabel: '#333333',\nredButton: '#BB8888',\ngreenButton: '#88BB88',\nredText: '#AA0000',\ngreenText: 'green',\nlink: '#036AFF',\n+ panelBackground: '#E0E0E5',\n+ panelBackgroundLabel: '#8E8E93',\n+ panelForeground: '#F2F2F7',\n+ panelForegroundBorder: '#D1D1D6',\n+ panelForegroundLabel: 'black',\n+ panelForegroundSecondaryLabel: '#888888',\n+ panelIosHighlightUnderlay: '#EEEEEEDD',\n+ modalBackground: '#E5E5EA',\n+ modalBackgroundLabel: '#333333',\n},\ndark: {\n- background: '#1C1C1E',\n- backgroundLabel: '#8E8E93',\n- foreground: '#3A3A3C',\n- foregroundBorder: '#2C2C2E',\n- foregroundLabel: 'white',\n- foregroundSecondaryLabel: '#AAAAAA',\n- iosHighlightUnderlay: '#444444DD',\n- modalBackground: '#2C2C2E',\n- modalBackgroundLabel: '#CCCCCC',\nredButton: '#FF4444',\ngreenButton: '#44BB44',\nredText: '#FF4444',\ngreenText: '#44FF44',\nlink: '#129AFF',\n+ panelBackground: '#1C1C1E',\n+ panelBackgroundLabel: '#8E8E93',\n+ panelForeground: '#3A3A3C',\n+ panelForegroundBorder: '#2C2C2E',\n+ panelForegroundLabel: 'white',\n+ panelForegroundSecondaryLabel: '#AAAAAA',\n+ panelIosHighlightUnderlay: '#444444DD',\n+ modalBackground: '#2C2C2E',\n+ modalBackgroundLabel: '#CCCCCC',\n},\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Prefix "panel" to some theme colors
129,187
22.10.2019 19:21:13
14,400
6d7a983c4431d7b5af8b4f02d2b081d721cd86eb
[native] Require iosHighlightUnderlayColor in Button Since it will now be theme-dependent
[ { "change_type": "MODIFY", "old_path": "native/calendar/entry.react.js", "new_path": "native/calendar/entry.react.js", "diff": "@@ -23,13 +23,13 @@ import type {\nNavigationScreenProp,\nNavigationRoute,\n} from 'react-navigation';\n+import type { Styles } from '../types/styles';\nimport * as React from 'react';\nimport {\nView,\nText,\nTextInput,\n- StyleSheet,\nPlatform,\nTouchableWithoutFeedback,\nAlert,\n@@ -75,6 +75,7 @@ import {\nnonThreadCalendarQuery,\n} from '../selectors/nav-selectors';\nimport LoadingIndicator from './loading-indicator.react';\n+import { colors, styleSelector } from '../themes/colors';\ntype Props = {|\nnavigation: NavigationScreenProp<NavigationRoute>,\n@@ -91,6 +92,7 @@ type Props = {|\nthreadPickerActive: bool,\nforegroundKey: string,\nonline: bool,\n+ styles: Styles,\n// Redux dispatch functions\ndispatchActionPayload: DispatchActionPayload,\ndispatchActionPromise: DispatchActionPromise,\n@@ -125,6 +127,7 @@ class InternalEntry extends React.Component<Props, State> {\nthreadPickerActive: PropTypes.bool.isRequired,\nforegroundKey: PropTypes.string.isRequired,\nonline: PropTypes.bool.isRequired,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\ndispatchActionPayload: PropTypes.func.isRequired,\ndispatchActionPromise: PropTypes.func.isRequired,\ncreateEntry: PropTypes.func.isRequired,\n@@ -248,7 +251,9 @@ class InternalEntry extends React.Component<Props, State> {\nif (active) {\nconst actionLinksColor = darkColor ? '#D3D3D3' : '#404040';\nconst actionLinksTextStyle = { color: actionLinksColor };\n- const actionLinksUnderlayColor = darkColor ? \"#AAAAAA88\" : \"#CCCCCCDD\";\n+ const { modalIosHighlightUnderlay: actionLinksUnderlayColor } = darkColor\n+ ? colors.dark\n+ : colors.light;\nlet editButtonContent = null;\nif (editing && this.state.text.trim() === \"\") {\n} else if (editing) {\n@@ -259,7 +264,10 @@ class InternalEntry extends React.Component<Props, State> {\nsize={14}\ncolor={actionLinksColor}\n/>\n- <Text style={[styles.leftLinksText, actionLinksTextStyle]}>\n+ <Text style={[\n+ this.props.styles.leftLinksText,\n+ actionLinksTextStyle,\n+ ]}>\nSAVE\n</Text>\n</React.Fragment>\n@@ -271,31 +279,37 @@ class InternalEntry extends React.Component<Props, State> {\nname=\"pencil\"\nsize={12}\ncolor={actionLinksColor}\n- style={styles.pencilIcon}\n+ style={this.props.styles.pencilIcon}\n/>\n- <Text style={[styles.leftLinksText, actionLinksTextStyle]}>\n+ <Text style={[\n+ this.props.styles.leftLinksText,\n+ actionLinksTextStyle,\n+ ]}>\nEDIT\n</Text>\n</React.Fragment>\n);\n}\nactionLinks = (\n- <View style={styles.actionLinks}>\n- <View style={styles.leftLinks}>\n+ <View style={this.props.styles.actionLinks}>\n+ <View style={this.props.styles.leftLinks}>\n<Button\nonPress={this.delete}\niosFormat=\"highlight\"\niosHighlightUnderlayColor={actionLinksUnderlayColor}\niosActiveOpacity={0.85}\n- style={styles.button}\n+ style={this.props.styles.button}\n>\n- <View style={styles.buttonContents}>\n+ <View style={this.props.styles.buttonContents}>\n<Icon\nname=\"close\"\nsize={14}\ncolor={actionLinksColor}\n/>\n- <Text style={[styles.leftLinksText, actionLinksTextStyle]}>\n+ <Text style={[\n+ this.props.styles.leftLinksText,\n+ actionLinksTextStyle,\n+ ]}>\nDELETE\n</Text>\n</View>\n@@ -305,14 +319,14 @@ class InternalEntry extends React.Component<Props, State> {\niosFormat=\"highlight\"\niosHighlightUnderlayColor={actionLinksUnderlayColor}\niosActiveOpacity={0.85}\n- style={styles.button}\n+ style={this.props.styles.button}\n>\n- <View style={styles.buttonContents}>\n+ <View style={this.props.styles.buttonContents}>\n{editButtonContent}\n</View>\n</Button>\n</View>\n- <View style={styles.rightLinks}>\n+ <View style={this.props.styles.rightLinks}>\n<LoadingIndicator\nloadingStatus={this.state.loadingStatus}\ncolor={actionLinksColor}\n@@ -322,10 +336,13 @@ class InternalEntry extends React.Component<Props, State> {\niosFormat=\"highlight\"\niosHighlightUnderlayColor={actionLinksUnderlayColor}\niosActiveOpacity={0.85}\n- style={styles.button}\n+ style={this.props.styles.button}\n>\n<Text\n- style={[styles.rightLinksText, actionLinksTextStyle]}\n+ style={[\n+ this.props.styles.rightLinksText,\n+ actionLinksTextStyle,\n+ ]}\nnumberOfLines={1}\n>\n{this.state.threadInfo.uiName}\n@@ -346,7 +363,7 @@ class InternalEntry extends React.Component<Props, State> {\nconst selectionColor = darkColor ? '#129AFF' : '#036AFF';\ntextInput = (\n<TextInput\n- style={[styles.textInput, textInputStyle]}\n+ style={[ this.props.styles.textInput, textInputStyle ]}\nunderlineColorAndroid=\"transparent\"\nvalue={this.state.text}\nonChangeText={this.onChangeText}\n@@ -363,7 +380,9 @@ class InternalEntry extends React.Component<Props, State> {\nrawText += \" \";\n}\nconst textStyle = { color: textColor };\n- const linkStyle = darkColor ? styles.lightLinkText : styles.darkLinkText;\n+ const linkStyle = darkColor\n+ ? this.props.styles.lightLinkText\n+ : this.props.styles.darkLinkText;\n// We use an empty View to set the height of the entry, and then position\n// the Text and TextInput absolutely. This allows to measure height changes\n// to the Text while controlling the actual height of the entry.\n@@ -372,10 +391,10 @@ class InternalEntry extends React.Component<Props, State> {\nconst opacity = editing ? 1.0 : 0.6;\nreturn (\n<TouchableWithoutFeedback onPress={this.props.onPressWhitespace}>\n- <View style={styles.container}>\n+ <View style={this.props.styles.container}>\n<Button\nonPress={this.setActive}\n- style={[styles.entry, entryStyle]}\n+ style={[ this.props.styles.entry, entryStyle ]}\nandroidFormat=\"opacity\"\niosActiveOpacity={opacity}\n>\n@@ -384,10 +403,10 @@ class InternalEntry extends React.Component<Props, State> {\n<Hyperlink\nlinkDefault={true}\nlinkStyle={linkStyle}\n- style={styles.textContainer}\n+ style={this.props.styles.textContainer}\n>\n<Text\n- style={[styles.text, textStyle]}\n+ style={[ this.props.styles.text, textStyle ]}\nonLayout={this.onTextLayout}\n>\n{rawText}\n@@ -651,7 +670,7 @@ class InternalEntry extends React.Component<Props, State> {\n}\n-const styles = StyleSheet.create({\n+const styles = {\ncontainer: {\nbackgroundColor: '#FFFFFF',\n},\n@@ -666,7 +685,6 @@ const styles = StyleSheet.create({\npaddingBottom: 6,\npaddingLeft: 10,\npaddingRight: 10,\n- color: '#333333',\nfontFamily: 'Arial',\n},\ntextContainer: {\n@@ -731,7 +749,8 @@ const styles = StyleSheet.create({\npaddingTop: 1,\nlineHeight: 13,\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\nregisterFetchKey(saveEntryActionTypes);\nregisterFetchKey(deleteEntryActionTypes);\n@@ -745,6 +764,7 @@ const Entry = connect(\nthreadPickerActive: activeThreadPickerSelector(state),\nforegroundKey: foregroundKeySelector(state),\nonline: state.connection.status === \"connected\",\n+ styles: stylesSelector(state),\n}),\n{ createEntry, saveEntry, deleteEntry },\n)(InternalEntry);\n" }, { "change_type": "MODIFY", "old_path": "native/calendar/section-footer.react.js", "new_path": "native/calendar/section-footer.react.js", "diff": "// @flow\n-import React from 'react';\n-import {\n- View,\n- Text,\n- StyleSheet,\n- TouchableWithoutFeedback,\n-} from 'react-native';\n+import type { AppState } from '../redux/redux-setup';\n+import type { Styles } from '../types/styles';\n+import { type GlobalTheme, globalThemePropType } from '../types/themes';\n+\n+import * as React from 'react';\n+import { View, Text, TouchableWithoutFeedback } from 'react-native';\nimport Icon from 'react-native-vector-icons/FontAwesome';\nimport PropTypes from 'prop-types';\n+import { connect } from 'lib/utils/redux-utils';\n+\nimport Button from '../components/button.react';\n+import { colors, styleSelector } from '../themes/colors';\n-type Props = {\n+type Props = {|\ndateString: string,\nonAdd: (dateString: string) => void,\nonPressWhitespace: () => void,\n-};\n+ // Redux state\n+ activeTheme: ?GlobalTheme,\n+ styles: Styles,\n+|};\nclass SectionFooter extends React.PureComponent<Props> {\nstatic propTypes = {\ndateString: PropTypes.string.isRequired,\nonAdd: PropTypes.func.isRequired,\nonPressWhitespace: PropTypes.func.isRequired,\n+ activeTheme: globalThemePropType,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\n};\nrender() {\n+ const { modalIosHighlightUnderlay: underlayColor } =\n+ this.props.activeTheme === 'dark'\n+ ? colors.dark\n+ : colors.light;\nreturn (\n<TouchableWithoutFeedback onPress={this.props.onPressWhitespace}>\n- <View style={styles.sectionFooter}>\n+ <View style={this.props.styles.sectionFooter}>\n<Button\nonPress={this.onSubmit}\niosFormat=\"highlight\"\n+ iosHighlightUnderlayColor={underlayColor}\niosActiveOpacity={0.85}\n- style={styles.addButton}\n+ style={this.props.styles.addButton}\n>\n- <View style={styles.addButtonContents}>\n- <Icon name=\"plus\" style={styles.addIcon} />\n- <Text style={styles.actionLinksText}>Add</Text>\n+ <View style={this.props.styles.addButtonContents}>\n+ <Icon name=\"plus\" style={this.props.styles.addIcon} />\n+ <Text style={this.props.styles.actionLinksText}>Add</Text>\n</View>\n</Button>\n</View>\n@@ -51,7 +63,7 @@ class SectionFooter extends React.PureComponent<Props> {\n}\n-const styles = StyleSheet.create({\n+const styles = {\nsectionFooter: {\nbackgroundColor: 'white',\nheight: 40,\n@@ -79,6 +91,10 @@ const styles = StyleSheet.create({\nfontWeight: 'bold',\ncolor: '#555555',\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\n-export default SectionFooter;\n+export default connect((state: AppState) => ({\n+ activeTheme: state.globalThemeInfo.activeTheme,\n+ styles: stylesSelector(state),\n+}))(SectionFooter);\n" }, { "change_type": "MODIFY", "old_path": "native/components/button.react.js", "new_path": "native/components/button.react.js", "diff": "@@ -12,6 +12,7 @@ import {\nTouchableOpacity,\n} from 'react-native';\nimport PropTypes from 'prop-types';\n+import invariant from 'invariant';\nconst ANDROID_VERSION_LOLLIPOP = 21;\n@@ -28,7 +29,7 @@ type Props = {\nandroidBorderlessRipple: bool,\niosFormat: \"highlight\" | \"opacity\",\nandroidFormat: \"ripple\" | \"highlight\" | \"opacity\",\n- iosHighlightUnderlayColor: string,\n+ iosHighlightUnderlayColor?: string,\niosActiveOpacity: number,\n};\nclass Button extends React.PureComponent<Props> {\n@@ -56,7 +57,6 @@ class Button extends React.PureComponent<Props> {\nandroidBorderlessRipple: false,\niosFormat: \"opacity\",\nandroidFormat: \"ripple\",\n- iosHighlightUnderlayColor: \"#CCCCCCDD\",\niosActiveOpacity: 0.2,\n};\n@@ -89,6 +89,11 @@ class Button extends React.PureComponent<Props> {\n}\nif (format === \"highlight\") {\nconst underlayColor = this.props.iosHighlightUnderlayColor;\n+ invariant(\n+ underlayColor,\n+ \"iosHighlightUnderlayColor should be specified to Button in \" +\n+ \"format='higlight'\",\n+ );\nconst child = this.props.children ? this.props.children : <View />;\nreturn (\n<TouchableHighlight\n" }, { "change_type": "MODIFY", "old_path": "native/components/color-picker.react.js", "new_path": "native/components/color-picker.react.js", "diff": "// @flow\n+import type { AppState } from '../redux/redux-setup';\n+import { type GlobalTheme, globalThemePropType } from '../types/themes';\n+\nimport type { ViewStyle } from '../types/styles';\nimport type {\nNativeMethodsMixinType,\n@@ -22,7 +25,10 @@ import {\nimport tinycolor from 'tinycolor2';\nimport invariant from 'invariant';\n+import { connect } from 'lib/utils/redux-utils';\n+\nimport Button from './button.react';\n+import { colors } from '../themes/colors';\ntype PanEvent = {\nnativeEvent: {\n@@ -42,6 +48,8 @@ type Props = {|\nstyle?: ViewStyle,\nbuttonText: string,\noldButtonText: string,\n+ // Redux state\n+ activeTheme: ?GlobalTheme,\n|};\ntype State = {|\ncolor: HSVColor,\n@@ -66,6 +74,7 @@ class ColorPicker extends React.PureComponent<Props, State> {\nstyle: ViewPropTypes.style,\nbuttonText: PropTypes.string,\noldButtonText: PropTypes.string,\n+ activeTheme: globalThemePropType,\n};\nstatic defaultProps = {\nbuttonText: \"Select\",\n@@ -318,6 +327,10 @@ class ColorPicker extends React.PureComponent<Props, State> {\nconst tc = tinycolor(color);\nconst selectedColor: string = tc.toHexString();\nconst isDark: bool = tc.isDark();\n+ const { modalIosHighlightUnderlay: underlayColor } =\n+ this.props.activeTheme === 'dark'\n+ ? colors.dark\n+ : colors.light;\nlet picker = null;\nif (pickerSize) {\n@@ -384,6 +397,7 @@ class ColorPicker extends React.PureComponent<Props, State> {\n]}\nonPress={this._onOldColorSelected}\niosFormat=\"highlight\"\n+ iosHighlightUnderlayColor={underlayColor}\niosActiveOpacity={0.6}\n>\n<Text style={[styles.buttonText, oldButtonTextStyle]}>\n@@ -420,6 +434,7 @@ class ColorPicker extends React.PureComponent<Props, State> {\ntopStyle={styles.colorPreview}\nonPress={this._onColorSelected}\niosFormat=\"highlight\"\n+ iosHighlightUnderlayColor={underlayColor}\niosActiveOpacity={0.6}\n>\n<Text style={[styles.buttonText, buttonTextStyle]}>\n@@ -640,4 +655,6 @@ const styles = StyleSheet.create({\n},\n});\n-export default ColorPicker;\n+export default connect((state: AppState) => ({\n+ activeTheme: state.globalThemeInfo.activeTheme,\n+}))(ColorPicker);\n" }, { "change_type": "MODIFY", "old_path": "native/components/thread-list-thread.react.js", "new_path": "native/components/thread-list-thread.react.js", "diff": "// @flow\n-import type { ViewStyle, TextStyle } from '../types/styles';\n+import type { ViewStyle, TextStyle, Styles } from '../types/styles';\n+import type { AppState } from '../redux/redux-setup';\n+import { type GlobalTheme, globalThemePropType } from '../types/themes';\nimport { type ThreadInfo, threadInfoPropType } from 'lib/types/thread-types';\n-import React from 'react';\n+import * as React from 'react';\nimport PropTypes from 'prop-types';\n-import {\n- StyleSheet,\n- Text,\n- ViewPropTypes,\n-} from 'react-native';\n+import { Text, ViewPropTypes } from 'react-native';\n+\n+import { connect } from 'lib/utils/redux-utils';\nimport Button from './button.react';\nimport ColorSplotch from './color-splotch.react';\n+import { colors, styleSelector } from '../themes/colors';\n-type Props = {\n+type Props = {|\nthreadInfo: ThreadInfo,\nonSelect: (threadID: string) => void,\nstyle?: ViewStyle,\ntextStyle?: TextStyle,\n-};\n+ // Redux state\n+ activeTheme: ?GlobalTheme,\n+ styles: Styles,\n+|};\nclass ThreadListThread extends React.PureComponent<Props> {\nstatic propTypes = {\n@@ -28,18 +32,28 @@ class ThreadListThread extends React.PureComponent<Props> {\nonSelect: PropTypes.func.isRequired,\nstyle: ViewPropTypes.style,\ntextStyle: Text.propTypes.style,\n+ activeTheme: globalThemePropType,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\n};\nrender() {\n+ const { modalIosHighlightUnderlay: underlayColor } =\n+ this.props.activeTheme === 'dark'\n+ ? colors.dark\n+ : colors.light;\nreturn (\n<Button\nonPress={this.onSelect}\niosFormat=\"highlight\"\n+ iosHighlightUnderlayColor={underlayColor}\niosActiveOpacity={0.85}\n- style={[styles.button, this.props.style]}\n+ style={[ this.props.styles.button, this.props.style ]}\n>\n<ColorSplotch color={this.props.threadInfo.color} />\n- <Text style={[styles.text, this.props.textStyle]} numberOfLines={1}>\n+ <Text style={[\n+ this.props.styles.text,\n+ this.props.textStyle,\n+ ]} numberOfLines={1}>\n{this.props.threadInfo.uiName}\n</Text>\n</Button>\n@@ -52,7 +66,7 @@ class ThreadListThread extends React.PureComponent<Props> {\n}\n-const styles = StyleSheet.create({\n+const styles = {\nbutton: {\nflexDirection: 'row',\nalignItems: 'center',\n@@ -63,9 +77,12 @@ const styles = StyleSheet.create({\npaddingRight: 12,\npaddingVertical: 6,\nfontSize: 16,\n- color: 'black',\n+ color: 'modalForegroundLabel',\n},\n-});\n-\n+};\n+const stylesSelector = styleSelector(styles);\n-export default ThreadListThread;\n+export default connect((state: AppState) => ({\n+ activeTheme: state.globalThemeInfo.activeTheme,\n+ styles: stylesSelector(state),\n+}))(ThreadListThread);\n" }, { "change_type": "MODIFY", "old_path": "native/components/thread-list.react.js", "new_path": "native/components/thread-list.react.js", "diff": "@@ -49,7 +49,14 @@ class ThreadList extends React.PureComponent<Props, State> {\nsearchResults: new Set(),\n};\n- listDataSelector = createSelector(\n+ listDataSelector = createSelector<\n+ PropsAndState,\n+ void,\n+ $ReadOnlyArray<ThreadInfo>,\n+ $ReadOnlyArray<ThreadInfo>,\n+ string,\n+ Set<string>,\n+ >(\n(propsAndState: PropsAndState) => propsAndState.threadInfos,\n(propsAndState: PropsAndState) => propsAndState.searchText,\n(propsAndState: PropsAndState) => propsAndState.searchResults,\n@@ -57,7 +64,7 @@ class ThreadList extends React.PureComponent<Props, State> {\nthreadInfos: $ReadOnlyArray<ThreadInfo>,\ntext: string,\nsearchResults: Set<string>,\n- ) => text\n+ ): $ReadOnlyArray<ThreadInfo> => text\n? threadInfos.filter(threadInfo => searchResults.has(threadInfo.id))\n: threadInfos,\n);\n" }, { "change_type": "MODIFY", "old_path": "native/components/user-list-user.react.js", "new_path": "native/components/user-list-user.react.js", "diff": "// @flow\n-import type { TextStyle } from '../types/styles';\n+import type { TextStyle, Styles } from '../types/styles';\nimport { type UserListItem, userListItemPropType } from 'lib/types/user-types';\n+import type { AppState } from '../redux/redux-setup';\n+import { type GlobalTheme, globalThemePropType } from '../types/themes';\n-import React from 'react';\n+import * as React from 'react';\nimport PropTypes from 'prop-types';\n-import { StyleSheet, Text, Platform } from 'react-native';\n+import { Text, Platform } from 'react-native';\n+\n+import { connect } from 'lib/utils/redux-utils';\nimport Button from './button.react';\n+import { colors, styleSelector } from '../themes/colors';\nconst getUserListItemHeight = (item: UserListItem) => {\nreturn Platform.OS === \"ios\" ? 31.5 : 33.5;\n};\n-type Props = {\n+type Props = {|\nuserInfo: UserListItem,\nonSelect: (userID: string) => void,\ntextStyle?: TextStyle,\n-};\n+ // Redux state\n+ activeTheme: ?GlobalTheme,\n+ styles: Styles,\n+|};\nclass UserListUser extends React.PureComponent<Props> {\nstatic propTypes = {\nuserInfo: userListItemPropType.isRequired,\nonSelect: PropTypes.func.isRequired,\ntextStyle: Text.propTypes.style,\n+ activeTheme: globalThemePropType,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\n};\nrender() {\nlet parentThreadNotice = null;\nif (!this.props.userInfo.memberOfParentThread) {\nparentThreadNotice = (\n- <Text style={styles.parentThreadNotice}>not in parent thread</Text>\n+ <Text style={this.props.styles.parentThreadNotice}>\n+ not in parent thread\n+ </Text>\n);\n}\n+ const { modalIosHighlightUnderlay: underlayColor } =\n+ this.props.activeTheme === 'dark'\n+ ? colors.dark\n+ : colors.light;\nreturn (\n<Button\nonPress={this.onSelect}\niosFormat=\"highlight\"\n+ iosHighlightUnderlayColor={underlayColor}\niosActiveOpacity={0.85}\n- style={styles.button}\n+ style={this.props.styles.button}\n>\n- <Text style={[styles.text, this.props.textStyle]} numberOfLines={1}>\n+ <Text style={[\n+ this.props.styles.text,\n+ this.props.textStyle,\n+ ]} numberOfLines={1}>\n{this.props.userInfo.username}\n</Text>\n{parentThreadNotice}\n@@ -54,7 +74,7 @@ class UserListUser extends React.PureComponent<Props> {\n}\n-const styles = StyleSheet.create({\n+const styles = {\nbutton: {\nflexDirection: 'row',\njustifyContent: 'space-between',\n@@ -62,7 +82,7 @@ const styles = StyleSheet.create({\n},\ntext: {\nflex: 1,\n- color: \"black\",\n+ color: 'modalForegroundLabel',\npaddingHorizontal: 12,\npaddingVertical: 6,\nfontSize: 16,\n@@ -71,10 +91,15 @@ const styles = StyleSheet.create({\ncolor: \"#888888\",\nfontStyle: 'italic',\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\n+const WrappedUserListUser = connect((state: AppState) => ({\n+ activeTheme: state.globalThemeInfo.activeTheme,\n+ styles: stylesSelector(state),\n+}))(UserListUser);\nexport {\n- UserListUser,\n+ WrappedUserListUser as UserListUser,\ngetUserListItemHeight,\n};\n" }, { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -21,8 +21,10 @@ const colors = {\npanelForegroundLabel: 'black',\npanelForegroundSecondaryLabel: '#888888',\npanelIosHighlightUnderlay: '#EEEEEEDD',\n+ modalForegroundLabel: 'black',\nmodalBackground: '#E5E5EA',\nmodalBackgroundLabel: '#333333',\n+ modalIosHighlightUnderlay: '#CCCCCCDD',\n},\ndark: {\nredButton: '#FF4444',\n@@ -37,8 +39,10 @@ const colors = {\npanelForegroundLabel: 'white',\npanelForegroundSecondaryLabel: '#AAAAAA',\npanelIosHighlightUnderlay: '#444444DD',\n+ modalForegroundLabel: 'white',\nmodalBackground: '#2C2C2E',\nmodalBackgroundLabel: '#CCCCCC',\n+ modalIosHighlightUnderlay: '#AAAAAA88',\n},\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Require iosHighlightUnderlayColor in Button Since it will now be theme-dependent
129,187
22.10.2019 20:53:40
14,400
3e340a3710132331b68cfc66031cd8f0a544c375
[native] Dark mode for Calendar tab
[ { "change_type": "MODIFY", "old_path": "native/calendar/calendar-input-bar.react.js", "new_path": "native/calendar/calendar-input-bar.react.js", "diff": "// @flow\n-import React from 'react';\n-import { View, StyleSheet, Text } from 'react-native';\n+import type { AppState } from '../redux/redux-setup';\n+import type { Styles } from '../types/styles';\n+\n+import * as React from 'react';\n+import { View, Text } from 'react-native';\nimport PropTypes from 'prop-types';\n+import { connect } from 'lib/utils/redux-utils';\n+\nimport Button from '../components/button.react';\nimport {\naddKeyboardShowListener,\naddKeyboardDismissListener,\nremoveKeyboardListener,\n} from '../keyboard';\n+import { styleSelector } from '../themes/colors';\ntype Props = {|\nonSave: () => void,\ndisabled: bool,\n+ // Redux state\n+ styles: Styles,\n|};\ntype State = {|\nkeyboardActive: bool,\n@@ -23,6 +31,7 @@ class CalendarInputBar extends React.PureComponent<Props, State> {\nstatic propTypes = {\nonSave: PropTypes.func.isRequired,\ndisabled: PropTypes.bool.isRequired,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\n};\nstate = {\nkeyboardActive: false,\n@@ -59,14 +68,14 @@ class CalendarInputBar extends React.PureComponent<Props, State> {\nrender() {\nconst inactiveStyle = this.state.keyboardActive && !this.props.disabled\n? undefined\n- : styles.inactiveContainer;\n+ : this.props.styles.inactiveContainer;\nreturn (\n- <View style={[styles.container, inactiveStyle]}>\n+ <View style={[ this.props.styles.container, inactiveStyle ]}>\n<Button\nonPress={this.props.onSave}\niosActiveOpacity={0.5}\n>\n- <Text style={styles.saveButtonText}>\n+ <Text style={this.props.styles.saveButtonText}>\nSave\n</Text>\n</Button>\n@@ -76,9 +85,9 @@ class CalendarInputBar extends React.PureComponent<Props, State> {\n}\n-const styles = StyleSheet.create({\n+const styles = {\ncontainer: {\n- backgroundColor: '#E2E2E2',\n+ backgroundColor: 'listInputBar',\nalignItems: 'flex-end',\n},\ninactiveContainer: {\n@@ -86,12 +95,15 @@ const styles = StyleSheet.create({\nopacity: 0,\n},\nsaveButtonText: {\n- color: \"#036AFF\",\n+ color: 'link',\nfontWeight: 'bold',\nfontSize: 16,\npadding: 8,\nmarginRight: 5,\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\n-export default CalendarInputBar;\n+export default connect((state: AppState) => ({\n+ styles: stylesSelector(state),\n+}))(CalendarInputBar);\n" }, { "change_type": "MODIFY", "old_path": "native/calendar/calendar.react.js", "new_path": "native/calendar/calendar.react.js", "diff": "@@ -31,11 +31,12 @@ import {\ntype ConnectionStatus,\nconnectionStatusPropType,\n} from 'lib/types/socket-types';\n+import type { Styles } from '../types/styles';\n+import { type GlobalTheme, globalThemePropType } from '../types/themes';\nimport * as React from 'react';\nimport {\nView,\n- StyleSheet,\nText,\nFlatList,\nAppState as NativeAppState,\n@@ -96,6 +97,7 @@ import {\n} from '../navigation/route-names';\nimport DisconnectedBar from '../navigation/disconnected-bar.react';\nimport SafeAreaView from '../components/safe-area-view.react';\n+import { colors, styleSelector } from '../themes/colors';\nexport type EntryInfoWithHeight = {|\n...EntryInfo,\n@@ -136,6 +138,8 @@ type Props = {\ncontentVerticalOffset: number,\nloadingStatus: LoadingStatus,\nconnectionStatus: ConnectionStatus,\n+ activeTheme: ?GlobalTheme,\n+ styles: Styles,\n// Redux dispatch functions\ndispatchActionPromise: DispatchActionPromise,\n// async functions that hit server APIs\n@@ -184,6 +188,8 @@ class Calendar extends React.PureComponent<Props, State> {\ncontentVerticalOffset: PropTypes.number.isRequired,\nloadingStatus: loadingStatusPropType.isRequired,\nconnectionStatus: connectionStatusPropType.isRequired,\n+ activeTheme: globalThemePropType,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\ndispatchActionPromise: PropTypes.func.isRequired,\nupdateCalendarQuery: PropTypes.func.isRequired,\n};\n@@ -662,12 +668,12 @@ class Calendar extends React.PureComponent<Props, State> {\n}\nconst dateObj = dateFromString(item.dateString).getDay();\nconst weekendStyle = dateObj === 0 || dateObj === 6\n- ? styles.weekendSectionHeader\n+ ? this.props.styles.weekendSectionHeader\n: null;\nreturn (\n<TouchableWithoutFeedback onPress={this.makeAllEntriesInactive}>\n- <View style={[styles.sectionHeader, weekendStyle]}>\n- <Text style={styles.sectionHeaderText}>\n+ <View style={[ this.props.styles.sectionHeader, weekendStyle ]}>\n+ <Text style={this.props.styles.sectionHeaderText}>\n{date}\n</Text>\n</View>\n@@ -737,6 +743,9 @@ class Calendar extends React.PureComponent<Props, State> {\n}\nrender() {\n+ const isDark = this.props.activeTheme === 'dark';\n+ const { listSeparatorLabel } = isDark ? colors.dark : colors.light;\n+\nconst listDataWithHeights = this.state.listDataWithHeights;\nlet flatList = null;\nif (listDataWithHeights) {\n@@ -757,7 +766,7 @@ class Calendar extends React.PureComponent<Props, State> {\nonScrollEndDrag={this.onScrollEndDrag}\nscrollsToTop={false}\nextraData={this.state.extraData}\n- style={[styles.flatList, flatListStyle]}\n+ style={[ this.props.styles.flatList, flatListStyle ]}\nref={this.flatListRef}\n/>\n);\n@@ -765,24 +774,24 @@ class Calendar extends React.PureComponent<Props, State> {\nlet loadingIndicator = null;\nif (!listDataWithHeights || !this.state.readyToShowList) {\nloadingIndicator = (\n- <View style={styles.loadingIndicatorContainer}>\n+ <View style={this.props.styles.loadingIndicatorContainer}>\n<ActivityIndicator\n- color=\"black\"\n+ color={listSeparatorLabel}\nsize=\"large\"\n- style={styles.loadingIndicator}\n+ style={this.props.styles.loadingIndicator}\n/>\n</View>\n);\n}\nreturn (\n- <SafeAreaView style={styles.container}>\n+ <SafeAreaView style={this.props.styles.container}>\n<DisconnectedBar />\n<TextHeightMeasurer\ntextToMeasure={this.state.textToMeasure}\nallHeightsMeasuredCallback={this.allHeightsMeasured}\nstyle={[entryStyles.entry, entryStyles.text]}\n/>\n- <KeyboardAvoidingView style={styles.keyboardAvoidingView}>\n+ <KeyboardAvoidingView style={this.props.styles.keyboardAvoidingView}>\n{loadingIndicator}\n{flatList}\n<CalendarInputBar\n@@ -1132,31 +1141,30 @@ class Calendar extends React.PureComponent<Props, State> {\n}\n-const styles = StyleSheet.create({\n+const styles = {\nicon: {\nfontSize: 28,\n},\ncontainer: {\nflex: 1,\n- backgroundColor: '#E9E9EF',\n+ backgroundColor: 'listSeparator',\n},\nflatList: {\nflex: 1,\n- backgroundColor: '#EEEEEE',\n+ backgroundColor: 'listSeparator',\n},\nsectionHeader: {\nheight: 31,\n- backgroundColor: '#EEEEEE',\n+ backgroundColor: 'listSeparator',\nborderBottomWidth: 2,\n- borderColor: '#FFFFFF',\n+ borderColor: 'listBackground',\n},\nweekendSectionHeader: {\n- backgroundColor: '#EEEEEE',\n},\nsectionHeaderText: {\npadding: 5,\nfontWeight: 'bold',\n- color: '#555555',\n+ color: 'listSeparatorLabel',\n},\nloadingIndicator: {\nflex: 1,\n@@ -1171,7 +1179,8 @@ const styles = StyleSheet.create({\nkeyboardAvoidingView: {\nflex: 1,\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\nconst loadingStatusSelector = createLoadingStatusSelector(\nupdateCalendarQueryActionTypes,\n@@ -1192,6 +1201,8 @@ export default connect(\ncontentVerticalOffset: contentVerticalOffsetSelector(state),\nloadingStatus: loadingStatusSelector(state),\nconnectionStatus: state.connection.status,\n+ activeTheme: state.globalThemeInfo.activeTheme,\n+ styles: stylesSelector(state),\n}),\n{ updateCalendarQuery },\n)(Calendar);\n" }, { "change_type": "MODIFY", "old_path": "native/calendar/entry.react.js", "new_path": "native/calendar/entry.react.js", "diff": "@@ -45,6 +45,7 @@ import _isEqual from 'lodash/fp/isEqual';\nimport Icon from 'react-native-vector-icons/FontAwesome';\nimport { NavigationActions } from 'react-navigation';\nimport Hyperlink from 'react-native-hyperlink';\n+import tinycolor from 'tinycolor2';\nimport { colorIsDark } from 'lib/shared/thread-utils';\nimport {\n@@ -77,6 +78,13 @@ import {\nimport LoadingIndicator from './loading-indicator.react';\nimport { colors, styleSelector } from '../themes/colors';\n+function hueDistance(firstColor: string, secondColor: string): number {\n+ const firstHue = tinycolor(firstColor).toHsv().h;\n+ const secondHue = tinycolor(secondColor).toHsv().h;\n+ const distance = Math.abs(firstHue - secondHue);\n+ return distance > 180 ? 360 - distance : distance;\n+}\n+\ntype Props = {|\nnavigation: NavigationScreenProp<NavigationRoute>,\nentryInfo: EntryInfoWithHeight,\n@@ -245,6 +253,7 @@ class InternalEntry extends React.Component<Props, State> {\nrender() {\nconst active = InternalEntry.isActive(this.props, this.state);\nconst { editing } = this.state;\n+ const threadColor = `#${this.state.threadInfo.color}`;\nconst darkColor = colorIsDark(this.state.threadInfo.color);\nlet actionLinks = null;\n@@ -254,6 +263,7 @@ class InternalEntry extends React.Component<Props, State> {\nconst { modalIosHighlightUnderlay: actionLinksUnderlayColor } = darkColor\n? colors.dark\n: colors.light;\n+ const loadingIndicatorCanUseRed = hueDistance('red', threadColor) > 50;\nlet editButtonContent = null;\nif (editing && this.state.text.trim() === \"\") {\n} else if (editing) {\n@@ -330,6 +340,7 @@ class InternalEntry extends React.Component<Props, State> {\n<LoadingIndicator\nloadingStatus={this.state.loadingStatus}\ncolor={actionLinksColor}\n+ canUseRed={loadingIndicatorCanUseRed}\n/>\n<Button\nonPress={this.onPressThreadName}\n@@ -358,7 +369,7 @@ class InternalEntry extends React.Component<Props, State> {\nif (editing) {\nconst textInputStyle = {\ncolor: textColor,\n- backgroundColor: `#${this.state.threadInfo.color}`,\n+ backgroundColor: threadColor,\n};\nconst selectionColor = darkColor ? '#129AFF' : '#036AFF';\ntextInput = (\n@@ -380,14 +391,15 @@ class InternalEntry extends React.Component<Props, State> {\nrawText += \" \";\n}\nconst textStyle = { color: textColor };\n- const linkStyle = darkColor\n- ? this.props.styles.lightLinkText\n- : this.props.styles.darkLinkText;\n+ const linkColorStyle = darkColor\n+ ? { color: colors.dark.link }\n+ : { color: colors.light.link };\n+ const linkStyle = [ this.props.styles.linkText, linkColorStyle ];\n// We use an empty View to set the height of the entry, and then position\n// the Text and TextInput absolutely. This allows to measure height changes\n// to the Text while controlling the actual height of the entry.\nconst heightStyle = { height: this.state.height };\n- const entryStyle = { backgroundColor: `#${this.state.threadInfo.color}` };\n+ const entryStyle = { backgroundColor: threadColor };\nconst opacity = editing ? 1.0 : 0.6;\nreturn (\n<TouchableWithoutFeedback onPress={this.props.onPressWhitespace}>\n@@ -672,7 +684,7 @@ class InternalEntry extends React.Component<Props, State> {\nconst styles = {\ncontainer: {\n- backgroundColor: '#FFFFFF',\n+ backgroundColor: 'listBackground',\n},\nentry: {\nborderRadius: 8,\n@@ -737,12 +749,7 @@ const styles = {\nbutton: {\npadding: 5,\n},\n- darkLinkText: {\n- color: \"#036AFF\",\n- textDecorationLine: \"underline\",\n- },\n- lightLinkText: {\n- color: \"#129AFF\",\n+ linkText: {\ntextDecorationLine: \"underline\",\n},\npencilIcon: {\n" }, { "change_type": "MODIFY", "old_path": "native/calendar/loading-indicator.react.js", "new_path": "native/calendar/loading-indicator.react.js", "diff": "@@ -9,10 +9,19 @@ import Icon from 'react-native-vector-icons/Feather';\ntype Props = {|\nloadingStatus: LoadingStatus,\ncolor: string,\n+ canUseRed: bool,\n|};\nfunction LoadingIndicator(props: Props) {\nif (props.loadingStatus === \"error\") {\n- return <Icon name=\"x-circle\" style={styles.errorIcon} />;\n+ const colorStyle = props.canUseRed\n+ ? { color: 'red' }\n+ : { color: props.color };\n+ return (\n+ <Icon\n+ name=\"x-circle\"\n+ style={[ styles.errorIcon, colorStyle ]}\n+ />\n+ );\n} else if (props.loadingStatus === \"loading\") {\nreturn <ActivityIndicator size=\"small\" color={props.color} />;\n} else {\n@@ -22,7 +31,6 @@ function LoadingIndicator(props: Props) {\nconst styles = StyleSheet.create({\nerrorIcon: {\n- color: 'red',\npaddingTop: Platform.OS === \"android\" ? 6 : 4,\nfontSize: 16,\n},\n" }, { "change_type": "MODIFY", "old_path": "native/calendar/section-footer.react.js", "new_path": "native/calendar/section-footer.react.js", "diff": "@@ -65,12 +65,12 @@ class SectionFooter extends React.PureComponent<Props> {\nconst styles = {\nsectionFooter: {\n- backgroundColor: 'white',\n+ backgroundColor: 'listBackground',\nheight: 40,\nalignItems: 'flex-start',\n},\naddButton: {\n- backgroundColor: '#EEEEEE',\n+ backgroundColor: 'listSeparator',\npaddingLeft: 10,\npaddingRight: 10,\npaddingTop: 5,\n@@ -85,11 +85,11 @@ const styles = {\naddIcon: {\nfontSize: 14,\npaddingRight: 6,\n- color: '#555555',\n+ color: 'listSeparatorLabel',\n},\nactionLinksText: {\nfontWeight: 'bold',\n- color: '#555555',\n+ color: 'listSeparatorLabel',\n},\n};\nconst stylesSelector = styleSelector(styles);\n" }, { "change_type": "MODIFY", "old_path": "native/calendar/thread-picker-modal.react.js", "new_path": "native/calendar/thread-picker-modal.react.js", "diff": "@@ -90,12 +90,6 @@ class ThreadPickerModal extends React.PureComponent<Props> {\n}\nconst styles = StyleSheet.create({\n- headerText: {\n- fontSize: 24,\n- textAlign: 'center',\n- color: \"black\",\n- paddingBottom: 8,\n- },\nthreadListItem: {\npaddingVertical: 2,\npaddingLeft: 10,\n" }, { "change_type": "MODIFY", "old_path": "native/components/list-loading-indicator.react.js", "new_path": "native/components/list-loading-indicator.react.js", "diff": "// @flow\n-import React from 'react';\n-import { ActivityIndicator, StyleSheet } from 'react-native';\n+import type { AppState } from '../redux/redux-setup';\n+import type { Styles } from '../types/styles';\n+import { type GlobalTheme, globalThemePropType } from '../types/themes';\n-class ListLoadingIndicator extends React.PureComponent<{||}> {\n+import * as React from 'react';\n+import { ActivityIndicator } from 'react-native';\n+import PropTypes from 'prop-types';\n+\n+import { connect } from 'lib/utils/redux-utils';\n+\n+import { colors, styleSelector } from '../themes/colors';\n+\n+type Props = {|\n+ // Redux state\n+ activeTheme: ?GlobalTheme,\n+ styles: Styles,\n+|};\n+class ListLoadingIndicator extends React.PureComponent<Props> {\n+\n+ static propTypes = {\n+ activeTheme: globalThemePropType,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\n+ };\nrender() {\n+ const { listBackgroundLabel } = this.props.activeTheme === 'dark'\n+ ? colors.dark\n+ : colors.light;\nreturn (\n<ActivityIndicator\n- color=\"black\"\n+ color={listBackgroundLabel}\nsize=\"large\"\n- style={styles.loadingIndicator}\n+ style={this.props.styles.loadingIndicator}\n/>\n);\n}\n}\n-const styles = StyleSheet.create({\n+const styles = {\nloadingIndicator: {\nflex: 1,\n- backgroundColor: 'white',\n+ backgroundColor: 'listBackground',\npadding: 10,\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\n-export default ListLoadingIndicator;\n+export default connect((state: AppState) => ({\n+ activeTheme: state.globalThemeInfo.activeTheme,\n+ styles: stylesSelector(state),\n+}))(ListLoadingIndicator);\n" }, { "change_type": "MODIFY", "old_path": "native/components/thread-list.react.js", "new_path": "native/components/thread-list.react.js", "diff": "// @flow\n-import type { ViewStyle, TextStyle } from '../types/styles';\n+import type { ViewStyle, TextStyle, Styles } from '../types/styles';\nimport { type ThreadInfo, threadInfoPropType } from 'lib/types/thread-types';\n+import type { AppState } from '../redux/redux-setup';\n+import { type GlobalTheme, globalThemePropType } from '../types/themes';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n@@ -10,7 +12,6 @@ import {\nViewPropTypes,\nView,\nText,\n- StyleSheet,\nTouchableOpacity,\nTextInput,\nPlatform,\n@@ -20,8 +21,10 @@ import invariant from 'invariant';\nimport { createSelector } from 'reselect';\nimport SearchIndex from 'lib/shared/search-index';\n+import { connect } from 'lib/utils/redux-utils';\nimport ThreadListThread from './thread-list-thread.react';\n+import { colors, styleSelector } from '../themes/colors';\ntype Props = {|\nthreadInfos: $ReadOnlyArray<ThreadInfo>,\n@@ -29,6 +32,9 @@ type Props = {|\nitemStyle?: ViewStyle,\nitemTextStyle?: TextStyle,\nsearchIndex?: SearchIndex,\n+ // Redux state\n+ activeTheme: ?GlobalTheme,\n+ styles: Styles,\n|};\ntype State = {|\nsearchText: string,\n@@ -43,6 +49,8 @@ class ThreadList extends React.PureComponent<Props, State> {\nitemStyle: ViewPropTypes.style,\nitemTextStyle: Text.propTypes.style,\nsearchIndex: PropTypes.instanceOf(SearchIndex),\n+ activeTheme: globalThemePropType,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\n};\nstate = {\nsearchText: \"\",\n@@ -76,6 +84,9 @@ class ThreadList extends React.PureComponent<Props, State> {\nrender() {\nlet searchBar = null;\nif (this.props.searchIndex) {\n+ const { listSearchIcon: iconColor } = this.props.activeTheme === 'dark'\n+ ? colors.dark\n+ : colors.light;\nlet clearSearchInputIcon = null;\nif (this.state.searchText) {\nclearSearchInputIcon = (\n@@ -86,26 +97,26 @@ class ThreadList extends React.PureComponent<Props, State> {\n<Icon\nname=\"times-circle\"\nsize={18}\n- color=\"#AAAAAA\"\n+ color={iconColor}\n/>\n</TouchableOpacity>\n);\n}\nsearchBar = (\n- <View style={styles.search}>\n+ <View style={this.props.styles.search}>\n<Icon\nname=\"search\"\nsize={18}\n- color=\"#AAAAAA\"\n- style={styles.searchIcon}\n+ color={iconColor}\n+ style={this.props.styles.searchIcon}\n/>\n<TextInput\n- style={styles.searchInput}\n+ style={this.props.styles.searchInput}\nunderlineColorAndroid=\"transparent\"\nvalue={this.state.searchText}\nonChangeText={this.onChangeSearchText}\nplaceholder=\"Search threads\"\n- placeholderTextColor=\"#AAAAAA\"\n+ placeholderTextColor={iconColor}\nreturnKeyType=\"go\"\nautoFocus={true}\n/>\n@@ -159,12 +170,12 @@ class ThreadList extends React.PureComponent<Props, State> {\n}\n-const styles = StyleSheet.create({\n+const styles = {\nsearchIcon: {\npaddingBottom: Platform.OS === \"android\" ? 0 : 2,\n},\nsearch: {\n- backgroundColor: '#DDDDDD',\n+ backgroundColor: 'listSearchBackground',\nflexDirection: 'row',\nalignItems: 'center',\nmarginBottom: 8,\n@@ -180,8 +191,12 @@ const styles = StyleSheet.create({\nfontSize: 16,\npadding: 0,\nmarginVertical: 0,\n- color: 'black',\n+ color: 'modalForegroundLabel',\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\n-export default ThreadList;\n+export default connect((state: AppState) => ({\n+ activeTheme: state.globalThemeInfo.activeTheme,\n+ styles: stylesSelector(state),\n+}))(ThreadList);\n" }, { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -22,9 +22,16 @@ const colors = {\npanelForegroundSecondaryLabel: '#888888',\npanelIosHighlightUnderlay: '#EEEEEEDD',\nmodalForegroundLabel: 'black',\n- modalBackground: '#E5E5EA',\n+ modalBackground: '#EEEEEE',\nmodalBackgroundLabel: '#333333',\nmodalIosHighlightUnderlay: '#CCCCCCDD',\n+ listBackground: 'white',\n+ listBackgroundLabel: 'black',\n+ listSeparator: '#EEEEEE',\n+ listSeparatorLabel: '#555555',\n+ listInputBar: '#E2E2E2',\n+ listSearchBackground: '#DDDDDD',\n+ listSearchIcon: '#AAAAAA',\n},\ndark: {\nredButton: '#FF4444',\n@@ -33,7 +40,7 @@ const colors = {\ngreenText: '#44FF44',\nlink: '#129AFF',\npanelBackground: '#1C1C1E',\n- panelBackgroundLabel: '#8E8E93',\n+ panelBackgroundLabel: '#C7C7CC',\npanelForeground: '#3A3A3C',\npanelForegroundBorder: '#2C2C2E',\npanelForegroundLabel: 'white',\n@@ -43,6 +50,13 @@ const colors = {\nmodalBackground: '#2C2C2E',\nmodalBackgroundLabel: '#CCCCCC',\nmodalIosHighlightUnderlay: '#AAAAAA88',\n+ listBackground: '#1C1C1E',\n+ listBackgroundLabel: '#C7C7CC',\n+ listSeparator: '#3A3A3C',\n+ listSeparatorLabel: '#EEEEEE',\n+ listInputBar: '#555555',\n+ listSearchBackground: '#555555',\n+ listSearchIcon: '#AAAAAA',\n},\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Dark mode for Calendar tab
129,187
23.10.2019 13:02:15
14,400
1dbc59c7ae4adc5e632e8a2c2dcd90acf518bb76
[native] Fix up keyboard interplay with ChatInputBar on Android
[ { "change_type": "MODIFY", "old_path": "native/navigation/navigation-setup.js", "new_path": "native/navigation/navigation-setup.js", "diff": "@@ -116,6 +116,7 @@ import {\n} from '../chat/text-message-tooltip-modal.react';\nimport ThreadSettingsMemberTooltipModal\nfrom '../chat/settings/thread-settings-member-tooltip-modal.react';\n+import TabBar from './tab-bar.react';\nuseScreens();\n@@ -153,6 +154,7 @@ const TabNavigator = createBottomTabNavigator(\n{\ninitialRouteName: CalendarRouteName,\nlazy: false,\n+ tabBarComponent: TabBar,\ntabBarOptions: {\nkeyboardHidesTabBar: false,\n},\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/navigation/tab-bar.react.js", "diff": "+// @flow\n+\n+import * as React from 'react';\n+import { Platform } from 'react-native';\n+import { BottomTabBar } from 'react-navigation-tabs';\n+\n+import {\n+ type KeyboardState,\n+ withKeyboardState,\n+} from '../navigation/keyboard-state';\n+\n+type Props = {|\n+ ...React.ElementConfig<typeof BottomTabBar>,\n+ // withKeyboardState\n+ keyboardState: ?KeyboardState,\n+|};\n+function TabBar(props: Props) {\n+ const { keyboardState, ...rest } = props;\n+ if (\n+ Platform.OS === \"android\" &&\n+ keyboardState &&\n+ keyboardState.keyboardShowing\n+ ) {\n+ return null;\n+ }\n+ return <BottomTabBar {...rest} />;\n+}\n+\n+export default withKeyboardState(TabBar);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Fix up keyboard interplay with ChatInputBar on Android
129,187
23.10.2019 14:48:20
14,400
4fcb578dfa13a09f3734edad39bc702f7d85282b
[native] Fix color of HeaderBackButton on Android
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-navigator.react.js", "new_path": "native/chat/chat-navigator.react.js", "diff": "@@ -6,6 +6,7 @@ import type {\n} from 'react-navigation';\nimport * as React from 'react';\n+import { Platform } from 'react-native';\nimport { createStackNavigator } from 'react-navigation-stack';\nimport ChatThreadList from './chat-thread-list.react';\n@@ -23,6 +24,7 @@ import {\nChatThreadListRouteName,\n} from '../navigation/route-names';\nimport Header from '../navigation/header.react';\n+import HeaderBackButton from '../navigation/header-back-button.react';\nconst ChatNavigator = createStackNavigator(\n{\n@@ -33,9 +35,13 @@ const ChatNavigator = createStackNavigator(\n[DeleteThreadRouteName]: DeleteThread,\n},\n{\n- defaultNavigationOptions: {\n+ defaultNavigationOptions: ({ navigation }) => ({\nheader: Header,\n- },\n+ headerLeft:\n+ Platform.OS === \"android\" && !navigation.isFirstRouteInParent()\n+ ? HeaderBackButton\n+ : undefined,\n+ }),\ncardStyle: {\nbackgroundColor: \"#E9E9EF\",\n},\n" }, { "change_type": "MODIFY", "old_path": "native/more/more.react.js", "new_path": "native/more/more.react.js", "diff": "// @flow\nimport React from 'react';\n-import { StyleSheet } from 'react-native';\n+import { StyleSheet, Platform } from 'react-native';\nimport Icon from 'react-native-vector-icons/FontAwesome';\nimport { createStackNavigator } from 'react-navigation-stack';\n@@ -22,6 +22,7 @@ import {\nAppearancePreferencesRouteName,\n} from '../navigation/route-names';\nimport Header from '../navigation/header.react';\n+import HeaderBackButton from '../navigation/header-back-button.react';\nconst More = createStackNavigator(\n{\n@@ -34,9 +35,13 @@ const More = createStackNavigator(\n[AppearancePreferencesRouteName]: AppearancePreferences,\n},\n{\n- defaultNavigationOptions: {\n+ defaultNavigationOptions: ({ navigation }) => ({\nheader: Header,\n- },\n+ headerLeft:\n+ Platform.OS === \"android\" && !navigation.isFirstRouteInParent()\n+ ? HeaderBackButton\n+ : undefined,\n+ }),\ncardStyle: {\nbackgroundColor: \"#E9E9EF\",\n},\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/navigation/header-back-button.react.js", "diff": "+// @flow\n+\n+import type { AppState } from '../redux/redux-setup';\n+import type { GlobalTheme } from '../types/themes';\n+\n+import * as React from 'react';\n+import {\n+ HeaderBackButton as BaseHeaderBackButton,\n+} from 'react-navigation-stack';\n+\n+import { connect } from 'lib/utils/redux-utils';\n+\n+import { colors } from '../themes/colors';\n+\n+type Props = {\n+ ...React.ElementConfig<typeof BaseHeaderBackButton>,\n+ // Redux state\n+ activeTheme: ?GlobalTheme,\n+};\n+function HeaderBackButton(props: Props) {\n+ if (props.scene && props.scene.index === 0) {\n+ return null;\n+ }\n+ const { activeTheme, ...rest } = props;\n+ const { link: tintColor } = activeTheme === 'dark'\n+ ? colors.dark\n+ : colors.light;\n+ return <BaseHeaderBackButton {...rest} tintColor={tintColor} />;\n+}\n+\n+export default connect((state: AppState) => ({\n+ activeTheme: state.globalThemeInfo.activeTheme,\n+}))(HeaderBackButton);\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"react-native-vector-icons\": \"^6.6.0\",\n\"react-navigation\": \"^4.0.6\",\n\"react-navigation-redux-helpers\": \"^4.0.0\",\n- \"react-navigation-stack\": \"^1.9.0\",\n+ \"react-navigation-stack\": \"^1.10.2\",\n\"react-navigation-tabs\": \"^2.5.4\",\n\"react-redux\": \"^7.1.1\",\n\"reactotron-react-native\": \"^4.0.2\",\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -10239,10 +10239,10 @@ react-navigation-redux-helpers@^4.0.0:\ndependencies:\ninvariant \"^2.2.2\"\n-react-navigation-stack@^1.9.0:\n- version \"1.9.4\"\n- resolved \"https://registry.yarnpkg.com/react-navigation-stack/-/react-navigation-stack-1.9.4.tgz#9de7537bb83a1d30a177957bc7932b9447f4c409\"\n- integrity sha512-0Iv8t99RPsznXVadlHGRwOJqLzJmj96PfWiwmZEhVnbNwMVXMLz3oOno0LL9tbiukQxEaFAKUIblElpd9izS6w==\n+react-navigation-stack@^1.10.2:\n+ version \"1.10.2\"\n+ resolved \"https://registry.yarnpkg.com/react-navigation-stack/-/react-navigation-stack-1.10.2.tgz#86521ec876ce030b54073b89d31d3a1d82e6675b\"\n+ integrity sha512-dLyhLX0EM53grtsuzjl3azatCVr9ZdK/I/ZzW6c9GSqwXwFTJ+XL4z9kbIXoviMb9qXbLRpVhSR9eAlpsmPZUw==\ndependencies:\nprop-types \"^15.7.2\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Fix color of HeaderBackButton on Android
129,187
23.10.2019 14:53:28
14,400
30ad85ce1f7459d011e36db7a8ce37b78ecbd661
[native] Show notice in ImageGalleryKeyboard if no media was found
[ { "change_type": "MODIFY", "old_path": "native/media/image-gallery-keyboard.react.js", "new_path": "native/media/image-gallery-keyboard.react.js", "diff": "@@ -335,7 +335,7 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\nrender() {\nlet content;\nconst { imageInfos, error, containerHeight } = this.state;\n- if (imageInfos && containerHeight) {\n+ if (imageInfos && imageInfos.length > 0 && containerHeight) {\ncontent = (\n<FlatList\nhorizontal={true}\n@@ -352,6 +352,8 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\nref={this.flatListRef}\n/>\n);\n+ } else if (imageInfos && containerHeight) {\n+ content = <Text style={styles.error}>no media was found!</Text>;\n} else if (error) {\ncontent = <Text style={styles.error}>{error}</Text>;\n} else {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Show notice in ImageGalleryKeyboard if no media was found
129,187
23.10.2019 15:20:41
14,400
65ac46338312e02f058b47e0e0129d401ed6006e
[native] Use themed link color for ThreadSettingsButton
[ { "change_type": "MODIFY", "old_path": "native/chat/thread-settings-button.react.js", "new_path": "native/chat/thread-settings-button.react.js", "diff": "import { type ThreadInfo, threadInfoPropType } from 'lib/types/thread-types';\nimport type { Navigate } from '../navigation/route-names';\n+import type { AppState } from '../redux/redux-setup';\n+import { type GlobalTheme, globalThemePropType } from '../types/themes';\nimport * as React from 'react';\nimport { StyleSheet } from 'react-native';\nimport Icon from 'react-native-vector-icons/Ionicons';\nimport PropTypes from 'prop-types';\n+import { connect } from 'lib/utils/redux-utils';\n+\nimport { ThreadSettingsRouteName } from '../navigation/route-names';\nimport Button from '../components/button.react';\n+import { colors } from '../themes/colors';\ntype Props = {|\nthreadInfo: ThreadInfo,\nnavigate: Navigate,\n+ // Redux state\n+ activeTheme: ?GlobalTheme,\n|};\nclass ThreadSettingsButton extends React.PureComponent<Props> {\nstatic propTypes = {\nthreadInfo: threadInfoPropType.isRequired,\nnavigate: PropTypes.func.isRequired,\n+ activeTheme: globalThemePropType,\n};\nrender() {\n+ const { link: color } = this.props.activeTheme === 'dark'\n+ ? colors.dark\n+ : colors.light;\nreturn (\n<Button onPress={this.onPress} androidBorderlessRipple={true}>\n<Icon\nname=\"md-settings\"\nsize={30}\nstyle={styles.button}\n- color=\"#3366AA\"\n+ color={color}\n/>\n</Button>\n);\n@@ -52,4 +63,6 @@ const styles = StyleSheet.create({\n},\n});\n-export default ThreadSettingsButton;\n+export default connect((state: AppState) => ({\n+ activeTheme: state.globalThemeInfo.activeTheme,\n+}))(ThreadSettingsButton);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use themed link color for ThreadSettingsButton
129,187
23.10.2019 17:34:04
14,400
fcc56c04bbe91af7c0ea28744131b9cca5fc45d8
[lib] Fix robotext for unnamed child thread creation
[ { "change_type": "MODIFY", "old_path": "lib/shared/message-utils.js", "new_path": "lib/shared/message-utils.js", "diff": "@@ -110,10 +110,12 @@ function robotextForMessageInfo(\nlet text = `${creator} created a child thread`;\nconst childName = messageInfo.childThreadInfo.name;\nif (childName) {\n- text +=\n+ return `${creator} created a child thread` +\n` named \"<${encodeURI(childName)}|t${messageInfo.childThreadInfo.id}>\"`;\n+ } else {\n+ return `${creator} created a ` +\n+ `<child thread|t${messageInfo.childThreadInfo.id}>`;\n}\n- return text;\n} else if (messageInfo.type === messageTypes.CHANGE_SETTINGS) {\nlet value;\nif (messageInfo.field === \"color\") {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Fix robotext for unnamed child thread creation
129,187
24.10.2019 00:38:48
14,400
3318306d0a1015e722c6d8ad861a636e224daac8
[native] New style for ChatInputBar Supports dark mode
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-input-bar.react.js", "new_path": "native/chat/chat-input-bar.react.js", "diff": "@@ -27,11 +27,12 @@ import {\nkeyboardStatePropType,\nwithKeyboardState,\n} from '../navigation/keyboard-state';\n+import type { Styles } from '../types/styles';\n+import { type GlobalTheme, globalThemePropType } from '../types/themes';\nimport * as React from 'react';\nimport {\nView,\n- StyleSheet,\nTextInput,\nTouchableOpacity,\nLayoutAnimation,\n@@ -71,6 +72,7 @@ import {\nimageGalleryBackgroundColor,\n} from '../media/image-gallery-keyboard.react';\nimport { ChatInputStateContext } from './chat-input-state';\n+import { colors, styleSelector } from '../themes/colors';\nconst draftKeyFromThreadID =\n(threadID: string) => `${threadID}/message_composer`;\n@@ -83,6 +85,8 @@ type Props = {|\njoinThreadLoadingStatus: LoadingStatus,\ncalendarQuery: () => CalendarQuery,\nnextLocalID: number,\n+ activeTheme: ?GlobalTheme,\n+ styles: Styles,\n// withKeyboardState\nkeyboardState: ?KeyboardState,\n// Redux dispatch functions\n@@ -110,6 +114,8 @@ class ChatInputBar extends React.PureComponent<Props, State> {\njoinThreadLoadingStatus: loadingStatusPropType.isRequired,\ncalendarQuery: PropTypes.func.isRequired,\nnextLocalID: PropTypes.number.isRequired,\n+ activeTheme: globalThemePropType,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\nkeyboardState: keyboardStatePropType,\ndispatchActionPayload: PropTypes.func.isRequired,\ndispatchActionPromise: PropTypes.func.isRequired,\n@@ -208,21 +214,21 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nget expandoButtonsStyle() {\nreturn {\n- ...styles.expandoButtons,\n+ ...this.props.styles.expandoButtons,\nwidth: this.expandoButtonsWidth,\n};\n}\nget cameraRollIconStyle() {\nreturn {\n- ...styles.cameraRollIcon,\n+ ...this.props.styles.cameraRollIcon,\nopacity: this.cameraRollOpacity,\n};\n}\nget expandIconStyle() {\nreturn {\n- ...styles.expandIcon,\n+ ...this.props.styles.expandIcon,\nopacity: this.expandOpacity,\n};\n}\n@@ -240,20 +246,20 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n<ActivityIndicator\nsize=\"small\"\ncolor=\"white\"\n- style={styles.joinThreadLoadingIndicator}\n+ style={this.props.styles.joinThreadLoadingIndicator}\n/>\n);\n} else {\nbuttonContent = (\n- <Text style={styles.joinButtonText}>Join Thread</Text>\n+ <Text style={this.props.styles.joinButtonText}>Join Thread</Text>\n);\n}\njoinButton = (\n- <View style={styles.joinButtonContainer}>\n+ <View style={this.props.styles.joinButtonContainer}>\n<Button\nonPress={this.onPressJoin}\niosActiveOpacity={0.5}\n- style={styles.joinButton}\n+ style={this.props.styles.joinButton}\n>\n{buttonContent}\n</Button>\n@@ -263,58 +269,61 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nlet content;\nif (threadHasPermission(this.props.threadInfo, threadPermissions.VOICED)) {\n+ const themeColors =\n+ this.props.activeTheme === 'dark' ? colors.dark : colors.light;\n+\nlet button = null;\nif (this.state.text.trim()) {\nbutton = (\n<TouchableOpacity\nonPress={this.onSend}\nactiveOpacity={0.4}\n- style={styles.bottomAligned}\n+ style={this.props.styles.bottomAligned}\n>\n<Icon\nname=\"md-send\"\nsize={25}\n- style={styles.sendIcon}\n- color=\"#88BB88\"\n+ style={this.props.styles.sendIcon}\n+ color={themeColors.greenButton}\n/>\n</TouchableOpacity>\n);\n}\ncontent = (\n<TouchableWithoutFeedback onPress={this.dismissKeyboard}>\n- <View style={styles.inputContainer}>\n+ <View style={this.props.styles.inputContainer}>\n<Animated.View style={this.expandoButtonsStyle}>\n<TouchableOpacity\nonPress={this.onRightmostButtonPress}\nactiveOpacity={0.4}\n- style={styles.expandoButtons}\n+ style={this.props.styles.expandoButtons}\n>\n<Animated.View style={this.expandIconStyle}>\n<FAIcon\nname=\"chevron-right\"\nsize={19}\n- color=\"#888888\"\n+ color={themeColors.listInputButton}\n/>\n</Animated.View>\n<Animated.View style={this.cameraRollIconStyle}>\n<Icon\nname=\"md-image\"\nsize={25}\n- color=\"#888888\"\n+ color={themeColors.listInputButton}\n/>\n</Animated.View>\n</TouchableOpacity>\n</Animated.View>\n- <View style={styles.textInputContainer}>\n+ <View style={this.props.styles.textInputContainer}>\n<TextInput\nvalue={this.state.text}\nonChangeText={this.updateText}\nunderlineColorAndroid=\"transparent\"\nplaceholder=\"Send a message...\"\n- placeholderTextColor=\"#888888\"\n+ placeholderTextColor={themeColors.listInputButton}\nmultiline={true}\nonContentSizeChange={this.onContentSizeChange}\n- style={[styles.textInput, this.textInputStyle]}\n+ style={[this.props.styles.textInput, this.textInputStyle]}\nref={this.textInputRef}\n/>\n</View>\n@@ -324,7 +333,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n);\n} else if (isMember) {\ncontent = (\n- <Text style={styles.explanation}>\n+ <Text style={this.props.styles.explanation}>\nYou don't have permission to send messages.\n</Text>\n);\n@@ -340,13 +349,13 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n!!defaultRole.permissions[threadPermissions.VOICED];\nif (membersAreVoiced) {\ncontent = (\n- <Text style={styles.explanation}>\n+ <Text style={this.props.styles.explanation}>\nJoin this thread to send messages.\n</Text>\n);\n} else {\ncontent = (\n- <Text style={styles.explanation}>\n+ <Text style={this.props.styles.explanation}>\nYou don't have permission to send messages.\n</Text>\n);\n@@ -370,7 +379,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n}\nreturn (\n- <View style={styles.container}>\n+ <View style={this.props.styles.container}>\n{joinButton}\n{content}\n{keyboardAccessoryView}\n@@ -530,30 +539,27 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n}\n-const styles = StyleSheet.create({\n+const styles = {\ncontainer: {\n- backgroundColor: 'white',\n+ backgroundColor: 'listBackground',\n},\ninputContainer: {\nflexDirection: 'row',\n- backgroundColor: '#EEEEEE',\n- borderTopWidth: 1,\n- borderColor: '#AAAAAAAA',\n},\ntextInputContainer: {\nflex: 1,\n},\ntextInput: {\n- backgroundColor: 'white',\n+ backgroundColor: 'listInputBackground',\nmarginVertical: 5,\nmarginHorizontal: 4,\npaddingVertical: 5,\npaddingHorizontal: 10,\nborderRadius: 10,\nfontSize: 16,\n- borderColor: '#AAAAAAAA',\n+ borderColor: 'listInputBorder',\nborderWidth: 1,\n- color: 'black',\n+ color: 'listBackgroundLabel',\n},\nbottomAligned: {\nalignSelf: 'flex-end',\n@@ -576,7 +582,7 @@ const styles = StyleSheet.create({\npaddingBottom: Platform.OS === \"ios\" ? 5 : 8,\n},\nexplanation: {\n- color: '#777777',\n+ color: 'listBackgroundSecondaryLabel',\ntextAlign: 'center',\npaddingTop: 1,\npaddingBottom: 4,\n@@ -591,19 +597,20 @@ const styles = StyleSheet.create({\npaddingTop: 3,\npaddingBottom: 5,\nflex: 1,\n- backgroundColor: '#44CC99FF',\n+ backgroundColor: 'mintButton',\nborderRadius: 5,\njustifyContent: 'center',\n},\njoinButtonText: {\nfontSize: 20,\n- color: 'white',\n+ color: 'listBackground',\ntextAlign: 'center',\n},\njoinThreadLoadingIndicator: {\npaddingVertical: 2,\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\nconst joinThreadLoadingStatusSelector\n= createLoadingStatusSelector(joinThreadActionTypes);\n@@ -617,6 +624,8 @@ export default connect(\njoinThreadLoadingStatus: joinThreadLoadingStatusSelector(state),\ncalendarQuery: nonThreadCalendarQuery(state),\nnextLocalID: state.nextLocalID,\n+ activeTheme: state.globalThemeInfo.activeTheme,\n+ styles: stylesSelector(state),\n};\n},\n{ sendTextMessage, joinThread },\n" }, { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -11,6 +11,7 @@ const colors = {\nlight: {\nredButton: '#BB8888',\ngreenButton: '#88BB88',\n+ mintButton: '#44CC99',\nredText: '#AA0000',\ngreenText: 'green',\nlink: '#036AFF',\n@@ -27,15 +28,20 @@ const colors = {\nmodalIosHighlightUnderlay: '#CCCCCCDD',\nlistBackground: 'white',\nlistBackgroundLabel: 'black',\n+ listBackgroundSecondaryLabel: '#777777',\nlistSeparator: '#EEEEEE',\nlistSeparatorLabel: '#555555',\nlistInputBar: '#E2E2E2',\n+ listInputBorder: '#AAAAAAAA',\n+ listInputButton: '#888888',\n+ listInputBackground: '#DDDDDD',\nlistSearchBackground: '#DDDDDD',\nlistSearchIcon: '#AAAAAA',\n},\ndark: {\nredButton: '#FF4444',\ngreenButton: '#44BB44',\n+ mintButton: '#44CC99',\nredText: '#FF4444',\ngreenText: '#44FF44',\nlink: '#129AFF',\n@@ -52,9 +58,13 @@ const colors = {\nmodalIosHighlightUnderlay: '#AAAAAA88',\nlistBackground: '#1C1C1E',\nlistBackgroundLabel: '#C7C7CC',\n+ listBackgroundSecondaryLabel: '#BBBBBB',\nlistSeparator: '#3A3A3C',\nlistSeparatorLabel: '#EEEEEE',\nlistInputBar: '#555555',\n+ listInputBorder: '#333333',\n+ listInputButton: '#AAAAAA',\n+ listInputBackground: '#38383C',\nlistSearchBackground: '#555555',\nlistSearchIcon: '#AAAAAA',\n},\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] New style for ChatInputBar Supports dark mode
129,187
24.10.2019 12:48:31
14,400
9fc3af8d963581f8c9a9e0b1299560bf4649b192
[native] colorsSelector
[ { "change_type": "MODIFY", "old_path": "native/calendar/calendar.react.js", "new_path": "native/calendar/calendar.react.js", "diff": "@@ -32,7 +32,7 @@ import {\nconnectionStatusPropType,\n} from 'lib/types/socket-types';\nimport type { Styles } from '../types/styles';\n-import { type GlobalTheme, globalThemePropType } from '../types/themes';\n+import type { Colors } from '../themes/colors';\nimport * as React from 'react';\nimport {\n@@ -97,7 +97,7 @@ import {\n} from '../navigation/route-names';\nimport DisconnectedBar from '../navigation/disconnected-bar.react';\nimport SafeAreaView from '../components/safe-area-view.react';\n-import { colors, styleSelector } from '../themes/colors';\n+import { colorsSelector, styleSelector } from '../themes/colors';\nexport type EntryInfoWithHeight = {|\n...EntryInfo,\n@@ -138,7 +138,7 @@ type Props = {\ncontentVerticalOffset: number,\nloadingStatus: LoadingStatus,\nconnectionStatus: ConnectionStatus,\n- activeTheme: ?GlobalTheme,\n+ colors: Colors,\nstyles: Styles,\n// Redux dispatch functions\ndispatchActionPromise: DispatchActionPromise,\n@@ -188,7 +188,7 @@ class Calendar extends React.PureComponent<Props, State> {\ncontentVerticalOffset: PropTypes.number.isRequired,\nloadingStatus: loadingStatusPropType.isRequired,\nconnectionStatus: connectionStatusPropType.isRequired,\n- activeTheme: globalThemePropType,\n+ colors: PropTypes.objectOf(PropTypes.string).isRequired,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\ndispatchActionPromise: PropTypes.func.isRequired,\nupdateCalendarQuery: PropTypes.func.isRequired,\n@@ -743,8 +743,7 @@ class Calendar extends React.PureComponent<Props, State> {\n}\nrender() {\n- const isDark = this.props.activeTheme === 'dark';\n- const { listSeparatorLabel } = isDark ? colors.dark : colors.light;\n+ const { listSeparatorLabel } = this.props.colors;\nconst listDataWithHeights = this.state.listDataWithHeights;\nlet flatList = null;\n@@ -1201,7 +1200,7 @@ export default connect(\ncontentVerticalOffset: contentVerticalOffsetSelector(state),\nloadingStatus: loadingStatusSelector(state),\nconnectionStatus: state.connection.status,\n- activeTheme: state.globalThemeInfo.activeTheme,\n+ colors: colorsSelector(state),\nstyles: stylesSelector(state),\n}),\n{ updateCalendarQuery },\n" }, { "change_type": "MODIFY", "old_path": "native/calendar/section-footer.react.js", "new_path": "native/calendar/section-footer.react.js", "diff": "import type { AppState } from '../redux/redux-setup';\nimport type { Styles } from '../types/styles';\n-import { type GlobalTheme, globalThemePropType } from '../types/themes';\n+import type { Colors } from '../themes/colors';\nimport * as React from 'react';\nimport { View, Text, TouchableWithoutFeedback } from 'react-native';\n@@ -12,14 +12,14 @@ import PropTypes from 'prop-types';\nimport { connect } from 'lib/utils/redux-utils';\nimport Button from '../components/button.react';\n-import { colors, styleSelector } from '../themes/colors';\n+import { colorsSelector, styleSelector } from '../themes/colors';\ntype Props = {|\ndateString: string,\nonAdd: (dateString: string) => void,\nonPressWhitespace: () => void,\n// Redux state\n- activeTheme: ?GlobalTheme,\n+ colors: Colors,\nstyles: Styles,\n|};\nclass SectionFooter extends React.PureComponent<Props> {\n@@ -28,15 +28,12 @@ class SectionFooter extends React.PureComponent<Props> {\ndateString: PropTypes.string.isRequired,\nonAdd: PropTypes.func.isRequired,\nonPressWhitespace: PropTypes.func.isRequired,\n- activeTheme: globalThemePropType,\n+ colors: PropTypes.objectOf(PropTypes.string).isRequired,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\n};\nrender() {\n- const { modalIosHighlightUnderlay: underlayColor } =\n- this.props.activeTheme === 'dark'\n- ? colors.dark\n- : colors.light;\n+ const { modalIosHighlightUnderlay: underlayColor } = this.props.colors;\nreturn (\n<TouchableWithoutFeedback onPress={this.props.onPressWhitespace}>\n<View style={this.props.styles.sectionFooter}>\n@@ -95,6 +92,6 @@ const styles = {\nconst stylesSelector = styleSelector(styles);\nexport default connect((state: AppState) => ({\n- activeTheme: state.globalThemeInfo.activeTheme,\n+ colors: colorsSelector(state),\nstyles: stylesSelector(state),\n}))(SectionFooter);\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat-input-bar.react.js", "new_path": "native/chat/chat-input-bar.react.js", "diff": "@@ -28,7 +28,7 @@ import {\nwithKeyboardState,\n} from '../navigation/keyboard-state';\nimport type { Styles } from '../types/styles';\n-import { type GlobalTheme, globalThemePropType } from '../types/themes';\n+import type { Colors } from '../themes/colors';\nimport * as React from 'react';\nimport {\n@@ -72,7 +72,7 @@ import {\nimageGalleryBackgroundColor,\n} from '../media/image-gallery-keyboard.react';\nimport { ChatInputStateContext } from './chat-input-state';\n-import { colors, styleSelector } from '../themes/colors';\n+import { colorsSelector, styleSelector } from '../themes/colors';\nconst draftKeyFromThreadID =\n(threadID: string) => `${threadID}/message_composer`;\n@@ -85,7 +85,7 @@ type Props = {|\njoinThreadLoadingStatus: LoadingStatus,\ncalendarQuery: () => CalendarQuery,\nnextLocalID: number,\n- activeTheme: ?GlobalTheme,\n+ colors: Colors,\nstyles: Styles,\n// withKeyboardState\nkeyboardState: ?KeyboardState,\n@@ -114,7 +114,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\njoinThreadLoadingStatus: loadingStatusPropType.isRequired,\ncalendarQuery: PropTypes.func.isRequired,\nnextLocalID: PropTypes.number.isRequired,\n- activeTheme: globalThemePropType,\n+ colors: PropTypes.objectOf(PropTypes.string).isRequired,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\nkeyboardState: keyboardStatePropType,\ndispatchActionPayload: PropTypes.func.isRequired,\n@@ -269,9 +269,6 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nlet content;\nif (threadHasPermission(this.props.threadInfo, threadPermissions.VOICED)) {\n- const themeColors =\n- this.props.activeTheme === 'dark' ? colors.dark : colors.light;\n-\nlet button = null;\nif (this.state.text.trim()) {\nbutton = (\n@@ -284,7 +281,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nname=\"md-send\"\nsize={25}\nstyle={this.props.styles.sendIcon}\n- color={themeColors.greenButton}\n+ color={this.props.colors.greenButton}\n/>\n</TouchableOpacity>\n);\n@@ -302,14 +299,14 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n<FAIcon\nname=\"chevron-right\"\nsize={19}\n- color={themeColors.listInputButton}\n+ color={this.props.colors.listInputButton}\n/>\n</Animated.View>\n<Animated.View style={this.cameraRollIconStyle}>\n<Icon\nname=\"md-image\"\nsize={25}\n- color={themeColors.listInputButton}\n+ color={this.props.colors.listInputButton}\n/>\n</Animated.View>\n</TouchableOpacity>\n@@ -320,7 +317,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nonChangeText={this.updateText}\nunderlineColorAndroid=\"transparent\"\nplaceholder=\"Send a message...\"\n- placeholderTextColor={themeColors.listInputButton}\n+ placeholderTextColor={this.props.colors.listInputButton}\nmultiline={true}\nonContentSizeChange={this.onContentSizeChange}\nstyle={[this.props.styles.textInput, this.textInputStyle]}\n@@ -624,7 +621,7 @@ export default connect(\njoinThreadLoadingStatus: joinThreadLoadingStatusSelector(state),\ncalendarQuery: nonThreadCalendarQuery(state),\nnextLocalID: state.nextLocalID,\n- activeTheme: state.globalThemeInfo.activeTheme,\n+ colors: colorsSelector(state),\nstyles: stylesSelector(state),\n};\n},\n" }, { "change_type": "MODIFY", "old_path": "native/chat/thread-settings-button.react.js", "new_path": "native/chat/thread-settings-button.react.js", "diff": "import { type ThreadInfo, threadInfoPropType } from 'lib/types/thread-types';\nimport type { Navigate } from '../navigation/route-names';\nimport type { AppState } from '../redux/redux-setup';\n-import { type GlobalTheme, globalThemePropType } from '../types/themes';\n+import type { Colors } from '../themes/colors';\nimport * as React from 'react';\nimport { StyleSheet } from 'react-native';\n@@ -14,26 +14,24 @@ import { connect } from 'lib/utils/redux-utils';\nimport { ThreadSettingsRouteName } from '../navigation/route-names';\nimport Button from '../components/button.react';\n-import { colors } from '../themes/colors';\n+import { colorsSelector } from '../themes/colors';\ntype Props = {|\nthreadInfo: ThreadInfo,\nnavigate: Navigate,\n// Redux state\n- activeTheme: ?GlobalTheme,\n+ colors: Colors,\n|};\nclass ThreadSettingsButton extends React.PureComponent<Props> {\nstatic propTypes = {\nthreadInfo: threadInfoPropType.isRequired,\nnavigate: PropTypes.func.isRequired,\n- activeTheme: globalThemePropType,\n+ colors: PropTypes.objectOf(PropTypes.string).isRequired,\n};\nrender() {\n- const { link: color } = this.props.activeTheme === 'dark'\n- ? colors.dark\n- : colors.light;\n+ const { link: color } = this.props.colors;\nreturn (\n<Button onPress={this.onPress} androidBorderlessRipple={true}>\n<Icon\n@@ -64,5 +62,5 @@ const styles = StyleSheet.create({\n});\nexport default connect((state: AppState) => ({\n- activeTheme: state.globalThemeInfo.activeTheme,\n+ colors: colorsSelector(state),\n}))(ThreadSettingsButton);\n" }, { "change_type": "MODIFY", "old_path": "native/components/color-picker.react.js", "new_path": "native/components/color-picker.react.js", "diff": "// @flow\nimport type { AppState } from '../redux/redux-setup';\n-import { type GlobalTheme, globalThemePropType } from '../types/themes';\n+import type { Colors } from '../themes/colors';\nimport type { ViewStyle } from '../types/styles';\nimport type {\n@@ -28,7 +28,7 @@ import invariant from 'invariant';\nimport { connect } from 'lib/utils/redux-utils';\nimport Button from './button.react';\n-import { colors } from '../themes/colors';\n+import { colorsSelector } from '../themes/colors';\ntype PanEvent = {\nnativeEvent: {\n@@ -49,7 +49,7 @@ type Props = {|\nbuttonText: string,\noldButtonText: string,\n// Redux state\n- activeTheme: ?GlobalTheme,\n+ colors: Colors,\n|};\ntype State = {|\ncolor: HSVColor,\n@@ -74,7 +74,7 @@ class ColorPicker extends React.PureComponent<Props, State> {\nstyle: ViewPropTypes.style,\nbuttonText: PropTypes.string,\noldButtonText: PropTypes.string,\n- activeTheme: globalThemePropType,\n+ colors: PropTypes.objectOf(PropTypes.string).isRequired,\n};\nstatic defaultProps = {\nbuttonText: \"Select\",\n@@ -327,10 +327,7 @@ class ColorPicker extends React.PureComponent<Props, State> {\nconst tc = tinycolor(color);\nconst selectedColor: string = tc.toHexString();\nconst isDark: bool = tc.isDark();\n- const { modalIosHighlightUnderlay: underlayColor } =\n- this.props.activeTheme === 'dark'\n- ? colors.dark\n- : colors.light;\n+ const { modalIosHighlightUnderlay: underlayColor } = this.props.colors;\nlet picker = null;\nif (pickerSize) {\n@@ -656,5 +653,5 @@ const styles = StyleSheet.create({\n});\nexport default connect((state: AppState) => ({\n- activeTheme: state.globalThemeInfo.activeTheme,\n+ colors: colorsSelector(state),\n}))(ColorPicker);\n" }, { "change_type": "MODIFY", "old_path": "native/components/edit-setting-button.react.js", "new_path": "native/components/edit-setting-button.react.js", "diff": "import type { TextStyle } from '../types/styles';\nimport type { AppState } from '../redux/redux-setup';\n-import type { GlobalTheme } from '../types/themes';\n+import type { Colors } from '../themes/colors';\nimport * as React from 'react';\nimport { TouchableOpacity, StyleSheet, Platform } from 'react-native';\n@@ -10,14 +10,14 @@ import Icon from 'react-native-vector-icons/FontAwesome';\nimport { connect } from 'lib/utils/redux-utils';\n-import { colors } from '../themes/colors';\n+import { colorsSelector } from '../themes/colors';\ntype Props = {|\nonPress: () => void,\ncanChangeSettings: bool,\nstyle?: TextStyle,\n// Redux state\n- activeTheme: ?GlobalTheme,\n+ colors: Colors,\n|};\nfunction EditSettingButton(props: Props) {\nif (!props.canChangeSettings) {\n@@ -27,8 +27,7 @@ function EditSettingButton(props: Props) {\nif (props.style) {\nappliedStyles.push(props.style);\n}\n- const isDark = props.activeTheme === 'dark';\n- const { link: linkColor } = isDark ? colors.dark : colors.light;\n+ const { link: linkColor } = props.colors;\nreturn (\n<TouchableOpacity onPress={props.onPress}>\n<Icon\n@@ -50,5 +49,5 @@ const styles = StyleSheet.create({\n});\nexport default connect((state: AppState) => ({\n- activeTheme: state.globalThemeInfo.activeTheme,\n+ colors: colorsSelector(state),\n}))(EditSettingButton);\n" }, { "change_type": "MODIFY", "old_path": "native/components/list-loading-indicator.react.js", "new_path": "native/components/list-loading-indicator.react.js", "diff": "import type { AppState } from '../redux/redux-setup';\nimport type { Styles } from '../types/styles';\n-import { type GlobalTheme, globalThemePropType } from '../types/themes';\n+import type { Colors } from '../themes/colors';\nimport * as React from 'react';\nimport { ActivityIndicator } from 'react-native';\n@@ -10,24 +10,22 @@ import PropTypes from 'prop-types';\nimport { connect } from 'lib/utils/redux-utils';\n-import { colors, styleSelector } from '../themes/colors';\n+import { colorsSelector, styleSelector } from '../themes/colors';\ntype Props = {|\n// Redux state\n- activeTheme: ?GlobalTheme,\n+ colors: Colors,\nstyles: Styles,\n|};\nclass ListLoadingIndicator extends React.PureComponent<Props> {\nstatic propTypes = {\n- activeTheme: globalThemePropType,\n+ colors: PropTypes.objectOf(PropTypes.string).isRequired,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\n};\nrender() {\n- const { listBackgroundLabel } = this.props.activeTheme === 'dark'\n- ? colors.dark\n- : colors.light;\n+ const { listBackgroundLabel } = this.props.colors;\nreturn (\n<ActivityIndicator\ncolor={listBackgroundLabel}\n@@ -49,6 +47,6 @@ const styles = {\nconst stylesSelector = styleSelector(styles);\nexport default connect((state: AppState) => ({\n- activeTheme: state.globalThemeInfo.activeTheme,\n+ colors: colorsSelector(state),\nstyles: stylesSelector(state),\n}))(ListLoadingIndicator);\n" }, { "change_type": "MODIFY", "old_path": "native/components/thread-list-thread.react.js", "new_path": "native/components/thread-list-thread.react.js", "diff": "import type { ViewStyle, TextStyle, Styles } from '../types/styles';\nimport type { AppState } from '../redux/redux-setup';\n-import { type GlobalTheme, globalThemePropType } from '../types/themes';\n+import type { Colors } from '../themes/colors';\nimport { type ThreadInfo, threadInfoPropType } from 'lib/types/thread-types';\n@@ -14,7 +14,7 @@ import { connect } from 'lib/utils/redux-utils';\nimport Button from './button.react';\nimport ColorSplotch from './color-splotch.react';\n-import { colors, styleSelector } from '../themes/colors';\n+import { colorsSelector, styleSelector } from '../themes/colors';\ntype Props = {|\nthreadInfo: ThreadInfo,\n@@ -22,7 +22,7 @@ type Props = {|\nstyle?: ViewStyle,\ntextStyle?: TextStyle,\n// Redux state\n- activeTheme: ?GlobalTheme,\n+ colors: Colors,\nstyles: Styles,\n|};\nclass ThreadListThread extends React.PureComponent<Props> {\n@@ -32,15 +32,12 @@ class ThreadListThread extends React.PureComponent<Props> {\nonSelect: PropTypes.func.isRequired,\nstyle: ViewPropTypes.style,\ntextStyle: Text.propTypes.style,\n- activeTheme: globalThemePropType,\n+ colors: PropTypes.objectOf(PropTypes.string).isRequired,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\n};\nrender() {\n- const { modalIosHighlightUnderlay: underlayColor } =\n- this.props.activeTheme === 'dark'\n- ? colors.dark\n- : colors.light;\n+ const { modalIosHighlightUnderlay: underlayColor } = this.props.colors;\nreturn (\n<Button\nonPress={this.onSelect}\n@@ -83,6 +80,6 @@ const styles = {\nconst stylesSelector = styleSelector(styles);\nexport default connect((state: AppState) => ({\n- activeTheme: state.globalThemeInfo.activeTheme,\n+ colors: colorsSelector(state),\nstyles: stylesSelector(state),\n}))(ThreadListThread);\n" }, { "change_type": "MODIFY", "old_path": "native/components/thread-list.react.js", "new_path": "native/components/thread-list.react.js", "diff": "import type { ViewStyle, TextStyle, Styles } from '../types/styles';\nimport { type ThreadInfo, threadInfoPropType } from 'lib/types/thread-types';\nimport type { AppState } from '../redux/redux-setup';\n-import { type GlobalTheme, globalThemePropType } from '../types/themes';\n+import type { Colors } from '../themes/colors';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n@@ -24,7 +24,7 @@ import SearchIndex from 'lib/shared/search-index';\nimport { connect } from 'lib/utils/redux-utils';\nimport ThreadListThread from './thread-list-thread.react';\n-import { colors, styleSelector } from '../themes/colors';\n+import { colorsSelector, styleSelector } from '../themes/colors';\ntype Props = {|\nthreadInfos: $ReadOnlyArray<ThreadInfo>,\n@@ -33,7 +33,7 @@ type Props = {|\nitemTextStyle?: TextStyle,\nsearchIndex?: SearchIndex,\n// Redux state\n- activeTheme: ?GlobalTheme,\n+ colors: Colors,\nstyles: Styles,\n|};\ntype State = {|\n@@ -49,7 +49,7 @@ class ThreadList extends React.PureComponent<Props, State> {\nitemStyle: ViewPropTypes.style,\nitemTextStyle: Text.propTypes.style,\nsearchIndex: PropTypes.instanceOf(SearchIndex),\n- activeTheme: globalThemePropType,\n+ colors: PropTypes.objectOf(PropTypes.string).isRequired,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\n};\nstate = {\n@@ -57,14 +57,7 @@ class ThreadList extends React.PureComponent<Props, State> {\nsearchResults: new Set(),\n};\n- listDataSelector = createSelector<\n- PropsAndState,\n- void,\n- $ReadOnlyArray<ThreadInfo>,\n- $ReadOnlyArray<ThreadInfo>,\n- string,\n- Set<string>,\n- >(\n+ listDataSelector = createSelector(\n(propsAndState: PropsAndState) => propsAndState.threadInfos,\n(propsAndState: PropsAndState) => propsAndState.searchText,\n(propsAndState: PropsAndState) => propsAndState.searchResults,\n@@ -72,7 +65,7 @@ class ThreadList extends React.PureComponent<Props, State> {\nthreadInfos: $ReadOnlyArray<ThreadInfo>,\ntext: string,\nsearchResults: Set<string>,\n- ): $ReadOnlyArray<ThreadInfo> => text\n+ ) => text\n? threadInfos.filter(threadInfo => searchResults.has(threadInfo.id))\n: threadInfos,\n);\n@@ -84,9 +77,7 @@ class ThreadList extends React.PureComponent<Props, State> {\nrender() {\nlet searchBar = null;\nif (this.props.searchIndex) {\n- const { listSearchIcon: iconColor } = this.props.activeTheme === 'dark'\n- ? colors.dark\n- : colors.light;\n+ const { listSearchIcon: iconColor } = this.props.colors;\nlet clearSearchInputIcon = null;\nif (this.state.searchText) {\nclearSearchInputIcon = (\n@@ -197,6 +188,6 @@ const styles = {\nconst stylesSelector = styleSelector(styles);\nexport default connect((state: AppState) => ({\n- activeTheme: state.globalThemeInfo.activeTheme,\n+ colors: colorsSelector(state),\nstyles: stylesSelector(state),\n}))(ThreadList);\n" }, { "change_type": "MODIFY", "old_path": "native/components/user-list-user.react.js", "new_path": "native/components/user-list-user.react.js", "diff": "import type { TextStyle, Styles } from '../types/styles';\nimport { type UserListItem, userListItemPropType } from 'lib/types/user-types';\nimport type { AppState } from '../redux/redux-setup';\n-import { type GlobalTheme, globalThemePropType } from '../types/themes';\n+import type { Colors } from '../themes/colors';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n@@ -12,7 +12,7 @@ import { Text, Platform } from 'react-native';\nimport { connect } from 'lib/utils/redux-utils';\nimport Button from './button.react';\n-import { colors, styleSelector } from '../themes/colors';\n+import { colorsSelector, styleSelector } from '../themes/colors';\nconst getUserListItemHeight = (item: UserListItem) => {\nreturn Platform.OS === \"ios\" ? 31.5 : 33.5;\n@@ -23,7 +23,7 @@ type Props = {|\nonSelect: (userID: string) => void,\ntextStyle?: TextStyle,\n// Redux state\n- activeTheme: ?GlobalTheme,\n+ colors: Colors,\nstyles: Styles,\n|};\nclass UserListUser extends React.PureComponent<Props> {\n@@ -32,7 +32,7 @@ class UserListUser extends React.PureComponent<Props> {\nuserInfo: userListItemPropType.isRequired,\nonSelect: PropTypes.func.isRequired,\ntextStyle: Text.propTypes.style,\n- activeTheme: globalThemePropType,\n+ colors: PropTypes.objectOf(PropTypes.string).isRequired,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\n};\n@@ -45,10 +45,7 @@ class UserListUser extends React.PureComponent<Props> {\n</Text>\n);\n}\n- const { modalIosHighlightUnderlay: underlayColor } =\n- this.props.activeTheme === 'dark'\n- ? colors.dark\n- : colors.light;\n+ const { modalIosHighlightUnderlay: underlayColor } = this.props.colors;\nreturn (\n<Button\nonPress={this.onSelect}\n@@ -95,7 +92,7 @@ const styles = {\nconst stylesSelector = styleSelector(styles);\nconst WrappedUserListUser = connect((state: AppState) => ({\n- activeTheme: state.globalThemeInfo.activeTheme,\n+ colors: colorsSelector(state),\nstyles: stylesSelector(state),\n}))(UserListUser);\n" }, { "change_type": "MODIFY", "old_path": "native/more/appearance-preferences.react.js", "new_path": "native/more/appearance-preferences.react.js", "diff": "@@ -10,6 +10,7 @@ import {\n} from '../types/themes';\nimport { updateThemeInfoActionType } from '../redux/action-types';\nimport type { Styles } from '../types/styles';\n+import type { Colors } from '../themes/colors';\nimport * as React from 'react';\nimport { View, Text, ScrollView, Platform } from 'react-native';\n@@ -19,7 +20,7 @@ import Icon from 'react-native-vector-icons/Ionicons';\nimport { connect } from 'lib/utils/redux-utils';\nimport Button from '../components/button.react';\n-import { colors, styleSelector } from '../themes/colors';\n+import { colorsSelector, styleSelector } from '../themes/colors';\nconst CheckIcon = (props: {||}) => (\n<Icon\n@@ -49,6 +50,7 @@ type Props = {|\n// Redux state\nglobalThemeInfo: GlobalThemeInfo,\nstyles: Styles,\n+ colors: Colors,\n// Redux dispatch functions\ndispatchActionPayload: DispatchActionPayload,\n|};\n@@ -57,6 +59,7 @@ class AppearancePreferences extends React.PureComponent<Props> {\nstatic propTypes = {\nglobalThemeInfo: globalThemeInfoPropType.isRequired,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\n+ colors: PropTypes.objectOf(PropTypes.string).isRequired,\ndispatchActionPayload: PropTypes.func.isRequired,\n};\nstatic navigationOptions = {\n@@ -64,10 +67,7 @@ class AppearancePreferences extends React.PureComponent<Props> {\n};\nrender() {\n- const isDark = this.props.globalThemeInfo.activeTheme === 'dark';\n- const { panelIosHighlightUnderlay: underlay } = isDark\n- ? colors.dark\n- : colors.light;\n+ const { panelIosHighlightUnderlay: underlay } = this.props.colors;\nconst options = [];\nfor (let i = 0; i < optionTexts.length; i++) {\n@@ -169,6 +169,7 @@ const stylesSelector = styleSelector(styles);\nexport default connect(\n(state: AppState) => ({\nglobalThemeInfo: state.globalThemeInfo,\n+ colors: colorsSelector(state),\nstyles: stylesSelector(state),\n}),\nnull,\n" }, { "change_type": "MODIFY", "old_path": "native/more/dev-tools.react.js", "new_path": "native/more/dev-tools.react.js", "diff": "@@ -7,7 +7,7 @@ import type {\nNavigationLeafRoute,\n} from 'react-navigation';\nimport type { Styles } from '../types/styles';\n-import { type GlobalTheme, globalThemePropType } from '../types/themes';\n+import type { Colors } from '../themes/colors';\nimport * as React from 'react';\nimport { View, Text, ScrollView, Platform } from 'react-native';\n@@ -23,7 +23,7 @@ import Button from '../components/button.react';\nimport { getPersistor } from '../redux/persist';\nimport { serverOptions } from '../utils/url-utils';\nimport { CustomServerModalRouteName } from '../navigation/route-names';\n-import { colors, styleSelector } from '../themes/colors';\n+import { colorsSelector, styleSelector } from '../themes/colors';\nconst ServerIcon = (props: {||}) => (\n<Icon\n@@ -39,7 +39,7 @@ type Props = {|\n// Redux state\nurlPrefix: string,\ncustomServer: ?string,\n- activeTheme: ?GlobalTheme,\n+ colors: Colors,\nstyles: Styles,\n// Redux dispatch functions\ndispatchActionPayload: DispatchActionPayload,\n@@ -52,7 +52,7 @@ class DevTools extends React.PureComponent<Props> {\n}).isRequired,\nurlPrefix: PropTypes.string.isRequired,\ncustomServer: PropTypes.string,\n- activeTheme: globalThemePropType,\n+ colors: PropTypes.objectOf(PropTypes.string).isRequired,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\ndispatchActionPayload: PropTypes.func.isRequired,\n};\n@@ -61,10 +61,7 @@ class DevTools extends React.PureComponent<Props> {\n};\nrender() {\n- const isDark = this.props.activeTheme === 'dark';\n- const { panelIosHighlightUnderlay: underlay } = isDark\n- ? colors.dark\n- : colors.light;\n+ const { panelIosHighlightUnderlay: underlay } = this.props.colors;\nconst serverButtons = [];\nfor (let server of serverOptions) {\n@@ -252,7 +249,7 @@ const stylesSelector = styleSelector(styles);\nexport default connect(\n(state: AppState) => ({\nurlPrefix: state.urlPrefix,\n- activeTheme: state.globalThemeInfo.activeTheme,\n+ colors: colorsSelector(state),\nstyles: stylesSelector(state),\n}),\nnull,\n" }, { "change_type": "MODIFY", "old_path": "native/more/more-screen.react.js", "new_path": "native/more/more-screen.react.js", "diff": "@@ -9,7 +9,7 @@ import type { LogOutResult } from 'lib/types/account-types';\nimport type { LoadingStatus } from 'lib/types/loading-types';\nimport { loadingStatusPropType } from 'lib/types/loading-types';\nimport type { Styles } from '../types/styles';\n-import { type GlobalTheme, globalThemePropType } from '../types/themes';\n+import type { Colors } from '../themes/colors';\nimport * as React from 'react';\nimport {\n@@ -48,7 +48,7 @@ import {\nDevToolsRouteName,\nAppearancePreferencesRouteName,\n} from '../navigation/route-names';\n-import { colors, styleSelector } from '../themes/colors';\n+import { colorsSelector, styleSelector } from '../themes/colors';\ntype Props = {\nnavigation: NavigationScreenProp<*>,\n@@ -57,7 +57,7 @@ type Props = {\nemail: ?string,\nemailVerified: ?bool,\nresendVerificationLoadingStatus: LoadingStatus,\n- activeTheme: ?GlobalTheme,\n+ colors: Colors,\nstyles: Styles,\n// Redux dispatch functions\ndispatchActionPromise: DispatchActionPromise,\n@@ -75,7 +75,7 @@ class MoreScreen extends React.PureComponent<Props> {\nemail: PropTypes.string,\nemailVerified: PropTypes.bool,\nresendVerificationLoadingStatus: loadingStatusPropType.isRequired,\n- activeTheme: globalThemePropType,\n+ colors: PropTypes.objectOf(PropTypes.string).isRequired,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\ndispatchActionPromise: PropTypes.func.isRequired,\nlogOut: PropTypes.func.isRequired,\n@@ -132,10 +132,10 @@ class MoreScreen extends React.PureComponent<Props> {\n);\n}\n- const isDark = this.props.activeTheme === 'dark';\n- const { panelIosHighlightUnderlay: underlay, link: linkColor } = isDark\n- ? colors.dark\n- : colors.light;\n+ const {\n+ panelIosHighlightUnderlay: underlay,\n+ link: linkColor,\n+ } = this.props.colors;\nreturn (\n<View style={this.props.styles.container}>\n<ScrollView\n@@ -479,7 +479,7 @@ export default connect(\n: undefined,\nresendVerificationLoadingStatus:\nresendVerificationLoadingStatusSelector(state),\n- activeTheme: state.globalThemeInfo.activeTheme,\n+ colors: colorsSelector(state),\nstyles: stylesSelector(state),\n}),\n{ logOut, resendVerificationEmail },\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/header-back-button.react.js", "new_path": "native/navigation/header-back-button.react.js", "diff": "// @flow\nimport type { AppState } from '../redux/redux-setup';\n-import type { GlobalTheme } from '../types/themes';\n+import type { Colors } from '../themes/colors';\nimport * as React from 'react';\nimport {\n@@ -10,24 +10,22 @@ import {\nimport { connect } from 'lib/utils/redux-utils';\n-import { colors } from '../themes/colors';\n+import { colorsSelector } from '../themes/colors';\ntype Props = {\n...React.ElementConfig<typeof BaseHeaderBackButton>,\n// Redux state\n- activeTheme: ?GlobalTheme,\n+ colors: Colors,\n};\nfunction HeaderBackButton(props: Props) {\nif (props.scene && props.scene.index === 0) {\nreturn null;\n}\n- const { activeTheme, ...rest } = props;\n- const { link: tintColor } = activeTheme === 'dark'\n- ? colors.dark\n- : colors.light;\n+ const { colors, ...rest } = props;\n+ const { link: tintColor } = colors;\nreturn <BaseHeaderBackButton {...rest} tintColor={tintColor} />;\n}\nexport default connect((state: AppState) => ({\n- activeTheme: state.globalThemeInfo.activeTheme,\n+ colors: colorsSelector(state),\n}))(HeaderBackButton);\n" }, { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -7,8 +7,7 @@ import type { AppState } from '../redux/redux-setup';\nimport { StyleSheet } from 'react-native';\nimport { createSelector } from 'reselect';\n-const colors = {\n- light: {\n+const light = Object.freeze({\nredButton: '#BB8888',\ngreenButton: '#88BB88',\nmintButton: '#44CC99',\n@@ -37,8 +36,10 @@ const colors = {\nlistInputBackground: '#DDDDDD',\nlistSearchBackground: '#DDDDDD',\nlistSearchIcon: '#AAAAAA',\n- },\n- dark: {\n+});\n+export type Colors = $Exact<typeof light>;\n+\n+const dark: Colors = {\nredButton: '#FF4444',\ngreenButton: '#44BB44',\nmintButton: '#44CC99',\n@@ -67,8 +68,16 @@ const colors = {\nlistInputBackground: '#38383C',\nlistSearchBackground: '#555555',\nlistSearchIcon: '#AAAAAA',\n- },\n};\n+const colors = { light, dark };\n+\n+const colorsSelector: (state: AppState) => Colors = createSelector(\n+ (state: AppState) => state.globalThemeInfo.activeTheme,\n+ (theme: ?GlobalTheme) => {\n+ const explicitTheme = theme ? theme : 'light';\n+ return colors[explicitTheme];\n+ },\n+);\nconst magicStrings = new Set();\nfor (let theme in colors) {\n@@ -79,10 +88,8 @@ for (let theme in colors) {\nfunction styleSelector<+S: Styles>(obj: S): (state: AppState) => S {\nreturn createSelector(\n- (state: AppState) => state.globalThemeInfo.activeTheme,\n- (theme: ?GlobalTheme) => {\n- const explicitTheme = theme ? theme : 'light';\n-\n+ colorsSelector,\n+ (themeColors: Colors) => {\nconst result = {};\nfor (let key in obj) {\nconst style = obj[key];\n@@ -90,7 +97,7 @@ function styleSelector<+S: Styles>(obj: S): (state: AppState) => S {\nfor (let styleKey in style) {\nconst styleValue = style[styleKey];\nif (magicStrings.has(styleValue)) {\n- const mapped = colors[explicitTheme][styleValue];\n+ const mapped = themeColors[styleValue];\nif (mapped) {\nfilledInStyle[styleKey] = mapped;\n}\n@@ -98,7 +105,6 @@ function styleSelector<+S: Styles>(obj: S): (state: AppState) => S {\n}\nresult[key] = filledInStyle;\n}\n-\nreturn StyleSheet.create(result);\n},\n);\n@@ -106,5 +112,6 @@ function styleSelector<+S: Styles>(obj: S): (state: AppState) => S {\nexport {\ncolors,\n+ colorsSelector,\nstyleSelector,\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] colorsSelector
129,187
24.10.2019 13:39:06
14,400
d8ee338b396ad46c629ce69dbaa7c731613a520f
[native] Search component
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-thread-list.react.js", "new_path": "native/chat/chat-thread-list.react.js", "diff": "@@ -7,17 +7,15 @@ import {\nchatThreadItemPropType,\n} from 'lib/selectors/chat-selectors';\nimport type { NavigationScreenProp, NavigationRoute } from 'react-navigation';\n+import type { Styles } from '../types/styles';\nimport * as React from 'react';\nimport {\nView,\n- StyleSheet,\nFlatList,\nPlatform,\nTextInput,\n- TouchableOpacity,\n} from 'react-native';\n-import Icon from 'react-native-vector-icons/FontAwesome';\nimport IonIcon from 'react-native-vector-icons/Ionicons';\nimport PropTypes from 'prop-types';\nimport _sum from 'lodash/fp/sum';\n@@ -37,6 +35,8 @@ import {\nComposeThreadRouteName,\nMessageListRouteName,\n} from '../navigation/route-names';\n+import { styleSelector } from '../themes/colors';\n+import Search from '../components/search.react';\nconst floatingActions = [{\ntext: 'Compose',\n@@ -53,6 +53,7 @@ type Props = {|\nchatListData: $ReadOnlyArray<ChatThreadItem>,\nviewerID: ?string,\nthreadSearchIndex: SearchIndex,\n+ styles: Styles,\n|};\ntype State = {|\nsearchText: string,\n@@ -71,6 +72,7 @@ class ChatThreadList extends React.PureComponent<Props, State> {\nchatListData: PropTypes.arrayOf(chatThreadItemPropType).isRequired,\nviewerID: PropTypes.string,\nthreadSearchIndex: PropTypes.instanceOf(SearchIndex).isRequired,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\n};\nstatic navigationOptions = ({ navigation }) => ({\ntitle: 'Threads',\n@@ -104,53 +106,22 @@ class ChatThreadList extends React.PureComponent<Props, State> {\nrenderItem = (row: { item: Item }) => {\nconst item = row.item;\nif (item.type === \"search\") {\n- return this.renderSearchBar();\n- }\nreturn (\n- <ChatThreadListItem data={item} onPressItem={this.onPressItem} />\n- );\n- }\n-\n- renderSearchBar() {\n- let clearSearchInputIcon = null;\n- if (this.state.searchText) {\n- clearSearchInputIcon = (\n- <TouchableOpacity\n- onPress={this.clearSearch}\n- activeOpacity={0.5}\n- >\n- <Icon\n- name=\"times-circle\"\n- size={18}\n- color=\"#AAAAAA\"\n- />\n- </TouchableOpacity>\n- );\n- }\n- return (\n- <View style={styles.searchContainer}>\n- <View style={styles.search}>\n- <Icon\n- name=\"search\"\n- size={18}\n- color=\"#AAAAAA\"\n- style={styles.searchIcon}\n- />\n- <TextInput\n- style={styles.searchInput}\n- underlineColorAndroid=\"transparent\"\n- value={this.state.searchText}\n+ <View style={this.props.styles.searchContainer}>\n+ <Search\n+ searchText={this.state.searchText}\nonChangeText={this.onChangeSearchText}\n+ style={this.props.styles.search}\nplaceholder=\"Search threads\"\n- placeholderTextColor=\"#AAAAAA\"\n- returnKeyType=\"go\"\nref={this.searchInputRef}\n/>\n- {clearSearchInputIcon}\n- </View>\n</View>\n);\n}\n+ return (\n+ <ChatThreadListItem data={item} onPressItem={this.onPressItem} />\n+ );\n+ }\nsearchInputRef = (searchInput: ?TextInput) => {\nthis.searchInput = searchInput;\n@@ -234,7 +205,7 @@ class ChatThreadList extends React.PureComponent<Props, State> {\n);\n}\nreturn (\n- <View style={styles.container}>\n+ <View style={this.props.styles.container}>\n<FlatList\ndata={this.listData}\nrenderItem={this.renderItem}\n@@ -243,7 +214,7 @@ class ChatThreadList extends React.PureComponent<Props, State> {\nextraData={this.props.viewerID}\ninitialNumToRender={11}\nkeyboardShouldPersistTaps=\"handled\"\n- style={styles.flatList}\n+ style={this.props.styles.flatList}\nref={this.flatListRef}\n/>\n{floatingAction}\n@@ -260,12 +231,8 @@ class ChatThreadList extends React.PureComponent<Props, State> {\nthis.setState({ searchText, searchResults: new Set(results) });\n}\n- clearSearch = () => {\n- this.onChangeSearchText(\"\");\n- }\n-\nonPressItem = (threadInfo: ThreadInfo) => {\n- this.clearSearch();\n+ this.onChangeSearchText(\"\");\nif (this.searchInput) {\nthis.searchInput.blur();\n}\n@@ -285,7 +252,7 @@ class ChatThreadList extends React.PureComponent<Props, State> {\n}\n-const styles = StyleSheet.create({\n+const styles = {\nicon: {\nfontSize: 28,\n},\n@@ -298,38 +265,21 @@ const styles = StyleSheet.create({\nborderColor: '#DDDDDD',\nmarginBottom: 5,\n},\n- searchIcon: {\n- paddingBottom: Platform.OS === \"android\" ? 0 : 2,\n- },\nsearch: {\n- backgroundColor: '#DDDDDD',\n- flexDirection: 'row',\n- alignItems: 'center',\n- marginHorizontal: 12,\nmarginBottom: 8,\n+ marginHorizontal: 12,\nmarginTop: Platform.OS === \"android\" ? 10 : 8,\n- paddingLeft: 14,\n- paddingRight: 12,\n- paddingTop: Platform.OS === \"android\" ? 1 : 6,\n- paddingBottom: Platform.OS === \"android\" ? 2 : 6,\n- borderRadius: 6,\n- },\n- searchInput: {\n- flex: 1,\n- marginLeft: 8,\n- fontSize: 16,\n- padding: 0,\n- marginVertical: 0,\n- color: 'black',\n},\nflatList: {\nflex: 1,\n- backgroundColor: 'white',\n+ backgroundColor: 'listBackground',\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\nexport default connect((state: AppState) => ({\nchatListData: chatListData(state),\nviewerID: state.currentUserInfo && state.currentUserInfo.id,\nthreadSearchIndex: threadSearchIndex(state),\n+ styles: stylesSelector(state),\n}))(ChatThreadList);\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/components/search.react.js", "diff": "+// @flow\n+\n+import type { AppState } from '../redux/redux-setup';\n+import type { Colors } from '../themes/colors';\n+import type { ViewStyle, Styles } from '../types/styles';\n+\n+import * as React from 'react';\n+import PropTypes from 'prop-types';\n+import {\n+ View,\n+ ViewPropTypes,\n+ TouchableOpacity,\n+ TextInput,\n+ Platform,\n+} from 'react-native';\n+import Icon from 'react-native-vector-icons/FontAwesome';\n+\n+import { connect } from 'lib/utils/redux-utils';\n+\n+import { colorsSelector, styleSelector } from '../themes/colors';\n+\n+type Props = {|\n+ searchText: string,\n+ onChangeText: (searchText: string) => void,\n+ style?: ViewStyle,\n+ textInputRef?: React.Ref<TextInput>,\n+ // Redux state\n+ colors: Colors,\n+ styles: Styles,\n+ ...$Shape<React.ElementProps<typeof TextInput>>,\n+|};\n+class Search extends React.PureComponent<Props> {\n+\n+ static propTypes = {\n+ searchText: PropTypes.string.isRequired,\n+ onChangeText: PropTypes.func.isRequired,\n+ style: ViewPropTypes.style,\n+ textInputRef: PropTypes.func,\n+ colors: PropTypes.objectOf(PropTypes.string).isRequired,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\n+ };\n+\n+ render() {\n+ const {\n+ searchText,\n+ onChangeText,\n+ style,\n+ textInputRef,\n+ colors,\n+ styles,\n+ ...rest\n+ } = this.props;\n+ const { listSearchIcon: iconColor } = colors;\n+\n+ let clearSearchInputIcon = null;\n+ if (searchText) {\n+ clearSearchInputIcon = (\n+ <TouchableOpacity\n+ onPress={this.clearSearch}\n+ activeOpacity={0.5}\n+ >\n+ <Icon\n+ name=\"times-circle\"\n+ size={18}\n+ color={iconColor}\n+ />\n+ </TouchableOpacity>\n+ );\n+ }\n+\n+ return (\n+ <View style={[ this.props.styles.search, style ]}>\n+ <Icon\n+ name=\"search\"\n+ size={18}\n+ color={iconColor}\n+ style={this.props.styles.searchIcon}\n+ />\n+ <TextInput\n+ style={this.props.styles.searchInput}\n+ underlineColorAndroid=\"transparent\"\n+ value={searchText}\n+ onChangeText={onChangeText}\n+ placeholderTextColor={iconColor}\n+ returnKeyType=\"go\"\n+ ref={textInputRef}\n+ {...rest}\n+ />\n+ {clearSearchInputIcon}\n+ </View>\n+ );\n+ }\n+\n+ clearSearch = () => {\n+ this.props.onChangeText(\"\");\n+ }\n+\n+}\n+\n+const styles = {\n+ searchIcon: {\n+ paddingBottom: Platform.OS === \"android\" ? 0 : 2,\n+ },\n+ search: {\n+ backgroundColor: 'listSearchBackground',\n+ flexDirection: 'row',\n+ alignItems: 'center',\n+ paddingLeft: 14,\n+ paddingRight: 12,\n+ paddingTop: Platform.OS === \"android\" ? 1 : 6,\n+ paddingBottom: Platform.OS === \"android\" ? 2 : 6,\n+ borderRadius: 6,\n+ },\n+ searchInput: {\n+ flex: 1,\n+ marginLeft: 8,\n+ fontSize: 16,\n+ padding: 0,\n+ marginVertical: 0,\n+ color: 'modalForegroundLabel',\n+ },\n+};\n+const stylesSelector = styleSelector(styles);\n+\n+const ConnectedSearch = connect((state: AppState) => ({\n+ colors: colorsSelector(state),\n+ styles: stylesSelector(state),\n+}))(Search);\n+\n+type ConnectedProps = $Diff<Props, {| colors: Colors, styles: Styles |}>;\n+export default React.forwardRef<Props, TextInput>(\n+ (props: ConnectedProps, ref: ?TextInput) =>\n+ <ConnectedSearch {...props} textInputRef={ref} />,\n+);\n" }, { "change_type": "MODIFY", "old_path": "native/components/thread-list.react.js", "new_path": "native/components/thread-list.react.js", "diff": "import type { ViewStyle, TextStyle, Styles } from '../types/styles';\nimport { type ThreadInfo, threadInfoPropType } from 'lib/types/thread-types';\nimport type { AppState } from '../redux/redux-setup';\n-import type { Colors } from '../themes/colors';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport {\nFlatList,\nViewPropTypes,\n- View,\nText,\n- TouchableOpacity,\n- TextInput,\n- Platform,\n} from 'react-native';\n-import Icon from 'react-native-vector-icons/FontAwesome';\nimport invariant from 'invariant';\nimport { createSelector } from 'reselect';\n@@ -24,7 +18,8 @@ import SearchIndex from 'lib/shared/search-index';\nimport { connect } from 'lib/utils/redux-utils';\nimport ThreadListThread from './thread-list-thread.react';\n-import { colorsSelector, styleSelector } from '../themes/colors';\n+import { styleSelector } from '../themes/colors';\n+import Search from './search.react';\ntype Props = {|\nthreadInfos: $ReadOnlyArray<ThreadInfo>,\n@@ -33,7 +28,6 @@ type Props = {|\nitemTextStyle?: TextStyle,\nsearchIndex?: SearchIndex,\n// Redux state\n- colors: Colors,\nstyles: Styles,\n|};\ntype State = {|\n@@ -49,7 +43,6 @@ class ThreadList extends React.PureComponent<Props, State> {\nitemStyle: ViewPropTypes.style,\nitemTextStyle: Text.propTypes.style,\nsearchIndex: PropTypes.instanceOf(SearchIndex),\n- colors: PropTypes.objectOf(PropTypes.string).isRequired,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\n};\nstate = {\n@@ -77,42 +70,14 @@ class ThreadList extends React.PureComponent<Props, State> {\nrender() {\nlet searchBar = null;\nif (this.props.searchIndex) {\n- const { listSearchIcon: iconColor } = this.props.colors;\n- let clearSearchInputIcon = null;\n- if (this.state.searchText) {\n- clearSearchInputIcon = (\n- <TouchableOpacity\n- onPress={this.clearSearch}\n- activeOpacity={0.5}\n- >\n- <Icon\n- name=\"times-circle\"\n- size={18}\n- color={iconColor}\n- />\n- </TouchableOpacity>\n- );\n- }\nsearchBar = (\n- <View style={this.props.styles.search}>\n- <Icon\n- name=\"search\"\n- size={18}\n- color={iconColor}\n- style={this.props.styles.searchIcon}\n- />\n- <TextInput\n- style={this.props.styles.searchInput}\n- underlineColorAndroid=\"transparent\"\n- value={this.state.searchText}\n+ <Search\n+ searchText={this.state.searchText}\nonChangeText={this.onChangeSearchText}\n+ style={this.props.styles.search}\nplaceholder=\"Search threads\"\n- placeholderTextColor={iconColor}\n- returnKeyType=\"go\"\nautoFocus={true}\n/>\n- {clearSearchInputIcon}\n- </View>\n);\n}\nreturn (\n@@ -155,39 +120,15 @@ class ThreadList extends React.PureComponent<Props, State> {\nthis.setState({ searchText, searchResults: new Set(results) });\n}\n- clearSearch = () => {\n- this.onChangeSearchText(\"\");\n- }\n-\n}\nconst styles = {\n- searchIcon: {\n- paddingBottom: Platform.OS === \"android\" ? 0 : 2,\n- },\nsearch: {\n- backgroundColor: 'listSearchBackground',\n- flexDirection: 'row',\n- alignItems: 'center',\nmarginBottom: 8,\n- paddingLeft: 14,\n- paddingRight: 12,\n- paddingTop: Platform.OS === \"android\" ? 1 : 6,\n- paddingBottom: Platform.OS === \"android\" ? 2 : 6,\n- borderRadius: 6,\n- },\n- searchInput: {\n- flex: 1,\n- marginLeft: 8,\n- fontSize: 16,\n- padding: 0,\n- marginVertical: 0,\n- color: 'modalForegroundLabel',\n},\n};\nconst stylesSelector = styleSelector(styles);\nexport default connect((state: AppState) => ({\n- colors: colorsSelector(state),\nstyles: stylesSelector(state),\n}))(ThreadList);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Search component
129,187
24.10.2019 13:43:53
14,400
611f17a09d29702e2f5a17c0bde87beca42a53b1
[native] Floating TextInput style in Chat
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-input-bar.react.js", "new_path": "native/chat/chat-input-bar.react.js", "diff": "@@ -554,8 +554,6 @@ const styles = {\npaddingHorizontal: 10,\nborderRadius: 10,\nfontSize: 16,\n- borderColor: 'listInputBorder',\n- borderWidth: 1,\ncolor: 'listBackgroundLabel',\n},\nbottomAligned: {\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat-navigator.react.js", "new_path": "native/chat/chat-navigator.react.js", "diff": "@@ -42,9 +42,6 @@ const ChatNavigator = createStackNavigator(\n? HeaderBackButton\n: undefined,\n}),\n- cardStyle: {\n- backgroundColor: \"#E9E9EF\",\n- },\n},\n);\nChatNavigator.navigationOptions = ({ navigation }) => ({\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat-thread-list.react.js", "new_path": "native/chat/chat-thread-list.react.js", "diff": "@@ -107,7 +107,6 @@ class ChatThreadList extends React.PureComponent<Props, State> {\nconst item = row.item;\nif (item.type === \"search\") {\nreturn (\n- <View style={this.props.styles.searchContainer}>\n<Search\nsearchText={this.state.searchText}\nonChangeText={this.onChangeSearchText}\n@@ -115,7 +114,6 @@ class ChatThreadList extends React.PureComponent<Props, State> {\nplaceholder=\"Search threads\"\nref={this.searchInputRef}\n/>\n- </View>\n);\n}\nreturn (\n@@ -259,12 +257,6 @@ const styles = {\ncontainer: {\nflex: 1,\n},\n- searchContainer: {\n- backgroundColor: '#F6F6F6',\n- borderBottomWidth: 1,\n- borderColor: '#DDDDDD',\n- marginBottom: 5,\n- },\nsearch: {\nmarginBottom: 8,\nmarginHorizontal: 12,\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat.react.js", "new_path": "native/chat/chat.react.js", "diff": "@@ -8,7 +8,7 @@ import ChatNavigator from './chat-navigator.react';\nimport KeyboardAvoidingView from '../components/keyboard-avoiding-view.react';\nimport MessageStorePruner from './message-store-pruner.react';\n-class Chat extends React.PureComponent<{}> {\n+class Chat extends React.PureComponent<{ ... }> {\nrender() {\nreturn (\n" }, { "change_type": "MODIFY", "old_path": "native/more/more.react.js", "new_path": "native/more/more.react.js", "diff": "@@ -42,9 +42,6 @@ const More = createStackNavigator(\n? HeaderBackButton\n: undefined,\n}),\n- cardStyle: {\n- backgroundColor: \"#E9E9EF\",\n- },\n},\n);\nMore.navigationOptions = ({ navigation }) => ({\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Floating TextInput style in Chat
129,187
24.10.2019 14:02:40
14,400
cacb8a54c5574c4c6d7fe539901e2129d26f5ea5
[native] Dark mode for ChatThreadList
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-input-bar.react.js", "new_path": "native/chat/chat-input-bar.react.js", "diff": "@@ -554,7 +554,7 @@ const styles = {\npaddingHorizontal: 10,\nborderRadius: 10,\nfontSize: 16,\n- color: 'listBackgroundLabel',\n+ color: 'listForegroundLabel',\n},\nbottomAligned: {\nalignSelf: 'flex-end',\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat-thread-list-item.react.js", "new_path": "native/chat/chat-thread-list-item.react.js", "diff": "@@ -5,33 +5,43 @@ import {\nchatThreadItemPropType,\n} from 'lib/selectors/chat-selectors';\nimport type { ThreadInfo } from 'lib/types/thread-types';\n+import type { AppState } from '../redux/redux-setup';\n+import type { Colors } from '../themes/colors';\n+import type { Styles } from '../types/styles';\n-import { shortAbsoluteDate } from 'lib/utils/date-utils';\n-\n-import React from 'react';\n-import { View, StyleSheet, Text } from 'react-native';\n+import * as React from 'react';\n+import { View, Text } from 'react-native';\nimport PropTypes from 'prop-types';\n+import { shortAbsoluteDate } from 'lib/utils/date-utils';\n+import { connect } from 'lib/utils/redux-utils';\n+\nimport Button from '../components/button.react';\nimport MessagePreview from './message-preview.react';\nimport ColorSplotch from '../components/color-splotch.react';\n+import { colorsSelector, styleSelector } from '../themes/colors';\ntype Props = {\ndata: ChatThreadItem,\nonPressItem: (threadInfo: ThreadInfo) => void,\n+ // Redux state\n+ colors: Colors,\n+ styles: Styles,\n};\nclass ChatThreadListItem extends React.PureComponent<Props> {\nstatic propTypes = {\ndata: chatThreadItemPropType.isRequired,\nonPressItem: PropTypes.func.isRequired,\n+ colors: PropTypes.objectOf(PropTypes.string).isRequired,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\n};\nlastMessage() {\nconst mostRecentMessageInfo = this.props.data.mostRecentMessageInfo;\nif (!mostRecentMessageInfo) {\nreturn (\n- <Text style={styles.noMessages} numberOfLines={1}>\n+ <Text style={this.props.styles.noMessages} numberOfLines={1}>\nNo messages\n</Text>\n);\n@@ -47,30 +57,34 @@ class ChatThreadListItem extends React.PureComponent<Props> {\nrender() {\nconst lastActivity = shortAbsoluteDate(this.props.data.lastUpdatedTime);\nconst unreadStyle = this.props.data.threadInfo.currentUser.unread\n- ? styles.unread\n+ ? this.props.styles.unread\n: null;\n+ const { listIosHighlightUnderlay } = this.props.colors;\nreturn (\n<Button\nonPress={this.onPress}\niosFormat=\"highlight\"\n- iosHighlightUnderlayColor=\"#DDDDDDDD\"\n+ iosHighlightUnderlayColor={listIosHighlightUnderlay}\niosActiveOpacity={0.85}\n>\n- <View style={styles.container}>\n- <View style={styles.row}>\n- <Text style={[styles.threadName, unreadStyle]} numberOfLines={1}>\n+ <View style={this.props.styles.container}>\n+ <View style={this.props.styles.row}>\n+ <Text style={[\n+ this.props.styles.threadName,\n+ unreadStyle,\n+ ]} numberOfLines={1}>\n{this.props.data.threadInfo.uiName}\n</Text>\n- <View style={styles.colorSplotch}>\n+ <View style={this.props.styles.colorSplotch}>\n<ColorSplotch\ncolor={this.props.data.threadInfo.color}\nsize=\"small\"\n/>\n</View>\n</View>\n- <View style={styles.row}>\n+ <View style={this.props.styles.row}>\n{this.lastMessage()}\n- <Text style={[styles.lastActivity, unreadStyle]}>\n+ <Text style={[ this.props.styles.lastActivity, unreadStyle ]}>\n{lastActivity}\n</Text>\n</View>\n@@ -85,7 +99,7 @@ class ChatThreadListItem extends React.PureComponent<Props> {\n}\n-const styles = StyleSheet.create({\n+const styles = {\ncontainer: {\nheight: 60,\npaddingLeft: 10,\n@@ -101,7 +115,7 @@ const styles = StyleSheet.create({\nflex: 1,\npaddingLeft: 10,\nfontSize: 20,\n- color: '#333333',\n+ color: 'listForegroundSecondaryLabel',\n},\ncolorSplotch: {\nmarginTop: 2,\n@@ -112,17 +126,21 @@ const styles = StyleSheet.create({\npaddingLeft: 10,\nfontStyle: 'italic',\nfontSize: 16,\n- color: '#666666',\n+ color: 'listForegroundTertiaryLabel',\n},\nlastActivity: {\nfontSize: 16,\n- color: '#666666',\n+ color: 'listForegroundTertiaryLabel',\nmarginLeft: 10,\n},\nunread: {\n- color: 'black',\n+ color: 'listForegroundLabel',\nfontWeight: 'bold',\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\n-export default ChatThreadListItem;\n+export default connect((state: AppState) => ({\n+ colors: colorsSelector(state),\n+ styles: stylesSelector(state),\n+}))(ChatThreadListItem);\n" }, { "change_type": "MODIFY", "old_path": "native/chat/compose-thread-button.react.js", "new_path": "native/chat/compose-thread-button.react.js", "diff": "// @flow\nimport type { Navigate } from '../navigation/route-names';\n+import type { AppState } from '../redux/redux-setup';\n+import type { Colors } from '../themes/colors';\nimport * as React from 'react';\nimport { StyleSheet } from 'react-native';\nimport Icon from 'react-native-vector-icons/MaterialCommunityIcons';\nimport PropTypes from 'prop-types';\n+import { connect } from 'lib/utils/redux-utils';\n+\nimport { ComposeThreadRouteName } from '../navigation/route-names';\nimport Button from '../components/button.react';\n+import { colorsSelector } from '../themes/colors';\ntype Props = {|\nnavigate: Navigate,\n+ // Redux state\n+ colors: Colors,\n|};\nclass ComposeThreadButton extends React.PureComponent<Props> {\nstatic propTypes = {\nnavigate: PropTypes.func.isRequired,\n+ colors: PropTypes.objectOf(PropTypes.string).isRequired,\n};\nrender() {\n+ const { link: linkColor } = this.props.colors;\nreturn (\n<Button onPress={this.onPress} androidBorderlessRipple={true}>\n<Icon\nname=\"pencil-plus-outline\"\nsize={26}\nstyle={styles.composeButton}\n- color=\"#036ABB\"\n+ color={linkColor}\n/>\n</Button>\n);\n@@ -47,4 +56,6 @@ const styles = StyleSheet.create({\n},\n});\n-export default ComposeThreadButton;\n+export default connect((state: AppState) => ({\n+ colors: colorsSelector(state),\n+}))(ComposeThreadButton);\n" }, { "change_type": "MODIFY", "old_path": "native/chat/message-preview.react.js", "new_path": "native/chat/message-preview.react.js", "diff": "@@ -6,9 +6,12 @@ import {\nmessageTypes,\n} from 'lib/types/message-types';\nimport { type ThreadInfo, threadInfoPropType } from 'lib/types/thread-types';\n+import type { Styles } from '../types/styles';\n+import type { AppState } from '../redux/redux-setup';\n-import React from 'react';\n-import { StyleSheet, Text } from 'react-native';\n+import * as React from 'react';\n+import { Text } from 'react-native';\n+import PropTypes from 'prop-types';\nimport { messagePreviewText } from 'lib/shared/message-utils';\nimport {\n@@ -16,22 +19,28 @@ import {\nthreadIsTwoPersonChat,\n} from 'lib/shared/thread-utils';\nimport { stringForUser } from 'lib/shared/user-utils';\n+import { connect } from 'lib/utils/redux-utils';\n+\n+import { styleSelector } from '../themes/colors';\ntype Props = {|\nmessageInfo: MessageInfo,\nthreadInfo: ThreadInfo,\n+ // Redux state\n+ styles: Styles,\n|};\nclass MessagePreview extends React.PureComponent<Props> {\nstatic propTypes = {\nmessageInfo: messageInfoPropType.isRequired,\nthreadInfo: threadInfoPropType.isRequired,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\n};\nrender() {\nconst messageInfo: MessageInfo = this.props.messageInfo;\nconst unreadStyle = this.props.threadInfo.currentUser.unread\n- ? styles.unread\n+ ? this.props.styles.unread\n: null;\nif (messageInfo.type === messageTypes.TEXT) {\nlet usernameText = null;\n@@ -42,11 +51,17 @@ class MessagePreview extends React.PureComponent<Props> {\nconst userString = stringForUser(messageInfo.creator);\nconst username = `${userString}: `;\nusernameText = (\n- <Text style={[styles.username, unreadStyle]}>{username}</Text>\n+ <Text style={[\n+ this.props.styles.username,\n+ unreadStyle,\n+ ]}>{username}</Text>\n);\n}\nreturn (\n- <Text style={[styles.lastMessage, unreadStyle]} numberOfLines={1}>\n+ <Text style={[\n+ this.props.styles.lastMessage,\n+ unreadStyle,\n+ ]} numberOfLines={1}>\n{usernameText}\n{messageInfo.text}\n</Text>\n@@ -55,7 +70,11 @@ class MessagePreview extends React.PureComponent<Props> {\nconst preview = messagePreviewText(messageInfo, this.props.threadInfo);\nreturn (\n<Text\n- style={[styles.lastMessage, styles.preview, unreadStyle]}\n+ style={[\n+ this.props.styles.lastMessage,\n+ this.props.styles.preview,\n+ unreadStyle,\n+ ]}\nnumberOfLines={1}\n>\n{preview}\n@@ -66,22 +85,25 @@ class MessagePreview extends React.PureComponent<Props> {\n}\n-const styles = StyleSheet.create({\n+const styles = {\nlastMessage: {\nflex: 1,\npaddingLeft: 10,\nfontSize: 16,\n- color: '#666666',\n+ color: 'listForegroundTertiaryLabel',\n},\nusername: {\n- color: '#AAAAAA',\n+ color: 'listForegroundQuaternaryLabel',\n},\npreview: {\n- color: '#AAAAAA',\n+ color: 'listForegroundQuaternaryLabel',\n},\nunread: {\n- color: 'black',\n+ color: 'listForegroundLabel',\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\n-export default MessagePreview;\n+export default connect((state: AppState) => ({\n+ styles: stylesSelector(state),\n+}))(MessagePreview);\n" }, { "change_type": "MODIFY", "old_path": "native/components/search.react.js", "new_path": "native/components/search.react.js", "diff": "@@ -117,7 +117,7 @@ const styles = {\nfontSize: 16,\npadding: 0,\nmarginVertical: 0,\n- color: 'modalForegroundLabel',\n+ color: 'listForegroundLabel',\n},\n};\nconst stylesSelector = styleSelector(styles);\n" }, { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -25,6 +25,10 @@ const light = Object.freeze({\nmodalBackground: '#EEEEEE',\nmodalBackgroundLabel: '#333333',\nmodalIosHighlightUnderlay: '#CCCCCCDD',\n+ listForegroundLabel: 'black',\n+ listForegroundSecondaryLabel: '#333333',\n+ listForegroundTertiaryLabel: '#666666',\n+ listForegroundQuaternaryLabel: '#AAAAAA',\nlistBackground: 'white',\nlistBackgroundLabel: 'black',\nlistBackgroundSecondaryLabel: '#777777',\n@@ -34,6 +38,7 @@ const light = Object.freeze({\nlistInputBorder: '#AAAAAAAA',\nlistInputButton: '#888888',\nlistInputBackground: '#DDDDDD',\n+ listIosHighlightUnderlay: '#DDDDDDDD',\nlistSearchBackground: '#DDDDDD',\nlistSearchIcon: '#AAAAAA',\n});\n@@ -57,6 +62,10 @@ const dark: Colors = {\nmodalBackground: '#2C2C2E',\nmodalBackgroundLabel: '#CCCCCC',\nmodalIosHighlightUnderlay: '#AAAAAA88',\n+ listForegroundLabel: 'white',\n+ listForegroundSecondaryLabel: '#CCCCCC',\n+ listForegroundTertiaryLabel: '#999999',\n+ listForegroundQuaternaryLabel: '#555555',\nlistBackground: '#1C1C1E',\nlistBackgroundLabel: '#C7C7CC',\nlistBackgroundSecondaryLabel: '#BBBBBB',\n@@ -66,6 +75,7 @@ const dark: Colors = {\nlistInputBorder: '#333333',\nlistInputButton: '#AAAAAA',\nlistInputBackground: '#38383C',\n+ listIosHighlightUnderlay: '#BBBBBB88',\nlistSearchBackground: '#555555',\nlistSearchIcon: '#AAAAAA',\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Dark mode for ChatThreadList
129,187
24.10.2019 15:53:49
14,400
07f41169900065f23d3d949cb396fe54be4497e2
[native] Fix color of back button
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-navigator.react.js", "new_path": "native/chat/chat-navigator.react.js", "diff": "@@ -37,10 +37,9 @@ const ChatNavigator = createStackNavigator(\n{\ndefaultNavigationOptions: ({ navigation }) => ({\nheader: Header,\n- headerLeft:\n- Platform.OS === \"android\" && !navigation.isFirstRouteInParent()\n- ? HeaderBackButton\n- : undefined,\n+ headerLeft: navigation.isFirstRouteInParent()\n+ ? undefined\n+ : HeaderBackButton,\n}),\n},\n);\n" }, { "change_type": "MODIFY", "old_path": "native/more/more.react.js", "new_path": "native/more/more.react.js", "diff": "@@ -37,10 +37,9 @@ const More = createStackNavigator(\n{\ndefaultNavigationOptions: ({ navigation }) => ({\nheader: Header,\n- headerLeft:\n- Platform.OS === \"android\" && !navigation.isFirstRouteInParent()\n- ? HeaderBackButton\n- : undefined,\n+ headerLeft: navigation.isFirstRouteInParent()\n+ ? undefined\n+ : HeaderBackButton,\n}),\n},\n);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Fix color of back button
129,187
24.10.2019 17:19:54
14,400
46fd96299beb648c32cae758ba7d66a363fdff41
[native] Dark mode for ComposeThread
[ { "change_type": "MODIFY", "old_path": "native/chat/compose-thread.react.js", "new_path": "native/chat/compose-thread.react.js", "diff": "@@ -23,10 +23,12 @@ import {\n} from 'lib/types/user-types';\nimport type { DispatchActionPromise } from 'lib/utils/action-utils';\nimport type { UserSearchResult } from 'lib/types/search-types';\n+import type { Styles } from '../types/styles';\n+import type { Colors } from '../themes/colors';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n-import { View, Text, StyleSheet, Alert } from 'react-native';\n+import { View, Text, Alert } from 'react-native';\nimport invariant from 'invariant';\nimport _flow from 'lodash/fp/flow';\nimport _filter from 'lodash/fp/filter';\n@@ -63,6 +65,7 @@ import LinkButton from '../components/link-button.react';\nimport { MessageListRouteName } from '../navigation/route-names';\nimport { registerChatScreen } from './chat-screen-registry';\nimport ThreadVisibility from '../components/thread-visibility.react';\n+import { colorsSelector, styleSelector } from '../themes/colors';\nconst tagInputProps = {\nplaceholder: \"username\",\n@@ -107,6 +110,8 @@ type Props = {|\notherUserInfos: {[id: string]: AccountUserInfo},\nuserSearchIndex: SearchIndex,\nthreadInfos: {[id: string]: ThreadInfo},\n+ colors: Colors,\n+ styles: Styles,\n// Redux dispatch functions\ndispatchActionPromise: DispatchActionPromise,\n// async functions that hit server APIs\n@@ -138,6 +143,8 @@ class ComposeThread extends React.PureComponent<Props, State> {\notherUserInfos: PropTypes.objectOf(accountUserInfoPropType).isRequired,\nuserSearchIndex: PropTypes.instanceOf(SearchIndex).isRequired,\nthreadInfos: PropTypes.objectOf(threadInfoPropType).isRequired,\n+ colors: PropTypes.objectOf(PropTypes.string).isRequired,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\ndispatchActionPromise: PropTypes.func.isRequired,\nnewThread: PropTypes.func.isRequired,\nsearchUsers: PropTypes.func.isRequired,\n@@ -238,17 +245,17 @@ class ComposeThread extends React.PureComponent<Props, State> {\nconst { existingThreads, userSearchResults } = this;\nif (existingThreads.length > 0) {\nexistingThreadsSection = (\n- <View style={styles.existingThreads}>\n- <View style={styles.existingThreadsRow}>\n- <Text style={styles.existingThreadsLabel}>\n+ <View style={this.props.styles.existingThreads}>\n+ <View style={this.props.styles.existingThreadsRow}>\n+ <Text style={this.props.styles.existingThreadsLabel}>\nExisting threads\n</Text>\n</View>\n- <View style={styles.existingThreadList}>\n+ <View style={this.props.styles.existingThreadList}>\n<ThreadList\nthreadInfos={existingThreads}\nonSelect={this.onSelectExistingThread}\n- itemTextStyle={styles.listItem}\n+ itemTextStyle={this.props.styles.listItem}\n/>\n</View>\n</View>\n@@ -267,11 +274,15 @@ class ComposeThread extends React.PureComponent<Props, State> {\nthreadType !== undefined && threadType !== null,\n`no threadType provided for ${parentThreadID}`,\n);\n+ const threadVisibilityColor = this.props.colors.modalForegroundLabel;\nparentThreadRow = (\n- <View style={styles.parentThreadRow}>\n- <ThreadVisibility threadType={threadType} />\n- <Text style={styles.parentThreadLabel}>within</Text>\n- <Text style={styles.parentThreadName}>\n+ <View style={this.props.styles.parentThreadRow}>\n+ <ThreadVisibility\n+ threadType={threadType}\n+ color={threadVisibilityColor}\n+ />\n+ <Text style={this.props.styles.parentThreadLabel}>within</Text>\n+ <Text style={this.props.styles.parentThreadName}>\n{parentThreadInfo.uiName}\n</Text>\n</View>\n@@ -282,11 +293,11 @@ class ComposeThread extends React.PureComponent<Props, State> {\nonSubmitEditing: this.onPressCreateThread,\n};\nreturn (\n- <View style={styles.container}>\n+ <View style={this.props.styles.container}>\n{parentThreadRow}\n- <View style={styles.userSelectionRow}>\n- <Text style={styles.tagInputLabel}>To: </Text>\n- <View style={styles.tagInputContainer}>\n+ <View style={this.props.styles.userSelectionRow}>\n+ <Text style={this.props.styles.tagInputLabel}>To: </Text>\n+ <View style={this.props.styles.tagInputContainer}>\n<TagInput\nvalue={this.state.userInfoInputArray}\nonChange={this.onChangeTagInput}\n@@ -298,11 +309,11 @@ class ComposeThread extends React.PureComponent<Props, State> {\n/>\n</View>\n</View>\n- <View style={styles.userList}>\n+ <View style={this.props.styles.userList}>\n<UserList\nuserInfos={userSearchResults}\nonSelect={this.onUserSelect}\n- itemTextStyle={styles.listItem}\n+ itemTextStyle={this.props.styles.listItem}\n/>\n</View>\n{existingThreadsSection}\n@@ -430,39 +441,39 @@ class ComposeThread extends React.PureComponent<Props, State> {\n}\n-const styles = StyleSheet.create({\n+const styles = {\ncontainer: {\nflex: 1,\n},\nparentThreadRow: {\nflexDirection: 'row',\nalignItems: 'center',\n- backgroundColor: \"#CCCCCC\",\n+ backgroundColor: 'modalSubtext',\npaddingVertical: 6,\npaddingLeft: 12,\n},\nparentThreadLabel: {\nfontSize: 16,\n- color: \"#777777\",\n+ color: 'modalSubtextLabel',\npaddingLeft: 6,\n},\nparentThreadName: {\nfontSize: 16,\npaddingLeft: 6,\n- color: \"black\",\n+ color: 'modalForegroundLabel',\n},\nuserSelectionRow: {\nflexDirection: 'row',\nalignItems: 'center',\n- backgroundColor: \"white\",\n+ backgroundColor: 'modalForeground',\npaddingVertical: 6,\nborderBottomWidth: 1,\n- borderColor: \"#CCCCCC\",\n+ borderColor: 'modalForegroundBorder',\n},\ntagInputLabel: {\npaddingLeft: 12,\nfontSize: 16,\n- color: \"#888888\",\n+ color: 'modalForegroundSecondaryLabel',\n},\ntagInputContainer: {\nflex: 1,\n@@ -473,31 +484,34 @@ const styles = StyleSheet.create({\nflex: 1,\npaddingLeft: 35,\npaddingRight: 12,\n+ backgroundColor: 'modalBackground',\n},\nlistItem: {\n- color: \"#222222\",\n+ color: 'modalForegroundLabel',\n},\nexistingThreadsRow: {\n- backgroundColor: \"white\",\n+ backgroundColor: 'modalForeground',\npaddingVertical: 6,\nborderBottomWidth: 1,\nborderTopWidth: 1,\n- borderColor: \"#CCCCCC\",\n+ borderColor: 'modalForegroundBorder',\n},\nexistingThreadsLabel: {\ntextAlign: 'center',\npaddingLeft: 12,\nfontSize: 16,\n- color: \"#888888\",\n+ color: 'modalForegroundSecondaryLabel',\n},\nexistingThreadList: {\nflex: 1,\n- marginRight: 12,\n+ paddingRight: 12,\n+ backgroundColor: 'modalBackground',\n},\nexistingThreads: {\nflex: 1,\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\nconst loadingStatusSelector\n= createLoadingStatusSelector(newThreadActionTypes);\n@@ -518,6 +532,8 @@ export default connect(\nuserInfoSelectorForOtherMembersOfThread((null: ?string))(state),\nuserSearchIndex: userSearchIndexForOtherMembersOfThread(null)(state),\nthreadInfos: threadInfoSelector(state),\n+ colors: colorsSelector(state),\n+ styles: stylesSelector(state),\n};\n},\n{ newThread, searchUsers },\n" }, { "change_type": "MODIFY", "old_path": "native/components/link-button.react.js", "new_path": "native/components/link-button.react.js", "diff": "// @flow\n-import type { ViewStyle } from '../types/styles';\n+import type { ViewStyle, Styles } from '../types/styles';\n+import type { AppState } from '../redux/redux-setup';\n-import React from 'react';\n-import { Text, StyleSheet, Platform, ViewPropTypes } from 'react-native';\n+import * as React from 'react';\n+import { Text, ViewPropTypes } from 'react-native';\nimport PropTypes from 'prop-types';\n+import { connect } from 'lib/utils/redux-utils';\n+\nimport Button from './button.react';\n+import { styleSelector } from '../themes/colors';\ntype Props = {\ntext: string,\nonPress: () => void,\ndisabled?: bool,\nstyle?: ViewStyle,\n+ // Redux state\n+ styles: Styles,\n};\nclass LinkButton extends React.PureComponent<Props> {\n@@ -21,10 +27,13 @@ class LinkButton extends React.PureComponent<Props> {\nonPress: PropTypes.func.isRequired,\ndisabled: PropTypes.bool,\nstyle: ViewPropTypes.style,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\n};\nrender() {\n- const disabledStyle = this.props.disabled ? styles.disabled : null;\n+ const disabledStyle = this.props.disabled\n+ ? this.props.styles.disabled\n+ : null;\nreturn (\n<Button\nonPress={this.props.onPress}\n@@ -33,26 +42,27 @@ class LinkButton extends React.PureComponent<Props> {\ndisabled={!!this.props.disabled}\nstyle={this.props.style}\n>\n- <Text style={[styles.text, disabledStyle]}>{this.props.text}</Text>\n+ <Text style={[ this.props.styles.text, disabledStyle ]}>\n+ {this.props.text}\n+ </Text>\n</Button>\n);\n}\n}\n-const styles = StyleSheet.create({\n+const styles = {\ntext: {\nfontSize: 17,\npaddingHorizontal: 10,\n- color: Platform.select({\n- ios: '#037AFF',\n- android: '#0077CC',\n- }),\n- fontWeight: Platform.select({ android: 'bold' }),\n+ color: 'link',\n},\ndisabled: {\n- color: \"#AAAAAA\",\n+ color: 'modalBackgroundSecondaryLabel',\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\n-export default LinkButton;\n+export default connect((state: AppState) => ({\n+ styles: stylesSelector(state),\n+}))(LinkButton);\n" }, { "change_type": "MODIFY", "old_path": "native/components/tag-input.react.js", "new_path": "native/components/tag-input.react.js", "diff": "import type { ViewStyle, TextStyle } from '../types/styles';\nimport { type Dimensions, dimensionsPropType } from 'lib/types/media-types';\nimport type { AppState } from '../redux/redux-setup';\n+import type { Colors } from '../themes/colors';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n@@ -22,6 +23,7 @@ import invariant from 'invariant';\nimport { connect } from 'lib/utils/redux-utils';\nimport { dimensionsSelector } from '../selectors/dimension-selectors';\n+import { colorsSelector } from '../themes/colors';\ntype Props<T> = {|\n/**\n@@ -50,11 +52,11 @@ type Props<T> = {|\n/**\n* Background color of tags\n*/\n- tagColor: string,\n+ tagColor?: string,\n/**\n* Text color of tags\n*/\n- tagTextColor: string,\n+ tagTextColor?: string,\n/**\n* Styling override for container surrounding tag text\n*/\n@@ -66,7 +68,7 @@ type Props<T> = {|\n/**\n* Color of text input\n*/\n- inputColor: string,\n+ inputColor?: string,\n/**\n* Any misc. TextInput props (autoFocus, placeholder, returnKeyType, etc.)\n*/\n@@ -92,6 +94,7 @@ type Props<T> = {|\ninnerRef?: (tagInput: ?TagInput<T>) => void,\n// Redux state\ndimensions: Dimensions,\n+ colors: Colors,\n|};\ntype State = {|\nwrapperHeight: number,\n@@ -119,6 +122,7 @@ class TagInput<T> extends React.PureComponent<Props<T>, State> {\ndefaultInputWidth: PropTypes.number,\ninnerRef: PropTypes.func,\ndimensions: dimensionsPropType.isRequired,\n+ colors: PropTypes.objectOf(PropTypes.string).isRequired,\n};\n// scroll to bottom\nscrollViewHeight = 0;\n@@ -128,9 +132,6 @@ class TagInput<T> extends React.PureComponent<Props<T>, State> {\nscrollView: ?React.ElementRef<typeof ScrollView> = null;\nstatic defaultProps = {\n- tagColor: '#dddddd',\n- tagTextColor: '#777777',\n- inputColor: '#777777',\nminHeight: 30,\nmaxHeight: 75,\ndefaultInputWidth: 90,\n@@ -222,6 +223,11 @@ class TagInput<T> extends React.PureComponent<Props<T>, State> {\n}\nrender() {\n+ const tagColor = this.props.tagColor || this.props.colors.modalSubtext;\n+ const tagTextColor = this.props.tagTextColor ||\n+ this.props.colors.modalSubtextLabel;\n+ const inputColor = this.props.inputColor ||\n+ this.props.colors.modalSubtextLabel;\nconst tags = this.props.value.map((tag, index) => (\n<Tag\nindex={index}\n@@ -229,8 +235,8 @@ class TagInput<T> extends React.PureComponent<Props<T>, State> {\nisLastTag={this.props.value.length === index + 1}\nonLayoutLastTag={this.onLayoutLastTag}\nremoveIndex={this.removeIndex}\n- tagColor={this.props.tagColor}\n- tagTextColor={this.props.tagTextColor}\n+ tagColor={tagColor}\n+ tagTextColor={tagTextColor}\ntagContainerStyle={this.props.tagContainerStyle}\ntagTextStyle={this.props.tagTextStyle}\nkey={index}\n@@ -273,13 +279,14 @@ class TagInput<T> extends React.PureComponent<Props<T>, State> {\nvalue={this.props.text}\nstyle={[styles.textInput, {\nwidth: inputWidth,\n- color: this.props.inputColor,\n+ color: inputColor,\n}]}\nonBlur={Platform.OS === \"ios\" ? this.onBlur : undefined}\nonChangeText={this.props.onChangeText}\nautoCapitalize=\"none\"\nautoCorrect={false}\nplaceholder=\"Start typing\"\n+ placeholderTextColor={tagColor}\nreturnKeyType=\"done\"\nkeyboardType=\"default\"\nunderlineColorAndroid=\"rgba(0,0,0,0)\"\n@@ -460,5 +467,6 @@ const styles = StyleSheet.create({\nexport default connect(\n(state: AppState) => ({\ndimensions: dimensionsSelector(state),\n+ colors: colorsSelector(state),\n}),\n)(TagInput);\n" }, { "change_type": "MODIFY", "old_path": "native/components/thread-visibility.react.js", "new_path": "native/components/thread-visibility.react.js", "diff": "@@ -13,14 +13,14 @@ import PropTypes from 'prop-types';\ntype Props = {|\nthreadType: ThreadType,\n- color?: string,\n+ color: string,\nincludeLabel: bool,\n|};\nclass ThreadVisibility extends React.PureComponent<Props> {\nstatic propTypes = {\nthreadType: threadTypePropType.isRequired,\n- color: PropTypes.string,\n+ color: PropTypes.string.isRequired,\nincludeLabel: PropTypes.bool,\n};\nstatic defaultProps = {\n@@ -28,11 +28,10 @@ class ThreadVisibility extends React.PureComponent<Props> {\n};\nrender() {\n- const threadType = this.props.threadType;\n- const color = this.props.color ? this.props.color : \"black\";\n+ const { threadType, color, includeLabel } = this.props;\nconst visLabelStyle = [ styles.visibilityLabel, { color } ];\nif (threadType === threadTypes.CHAT_NESTED_OPEN) {\n- const label = this.props.includeLabel\n+ const label = includeLabel\n? <Text style={visLabelStyle}>Open</Text>\n: null;\nreturn (\n@@ -42,7 +41,7 @@ class ThreadVisibility extends React.PureComponent<Props> {\n</View>\n);\n} else {\n- const label = this.props.includeLabel\n+ const label = includeLabel\n? <Text style={visLabelStyle}>Secret</Text>\n: null;\nreturn (\n" }, { "change_type": "MODIFY", "old_path": "native/components/user-list-user.react.js", "new_path": "native/components/user-list-user.react.js", "diff": "@@ -85,7 +85,7 @@ const styles = {\nfontSize: 16,\n},\nparentThreadNotice: {\n- color: \"#888888\",\n+ color: 'modalForegroundSecondaryLabel',\nfontStyle: 'italic',\n},\n};\n" }, { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -21,10 +21,16 @@ const light = Object.freeze({\npanelForegroundLabel: 'black',\npanelForegroundSecondaryLabel: '#888888',\npanelIosHighlightUnderlay: '#EEEEEEDD',\n+ modalForeground: 'white',\n+ modalForegroundBorder: '#CCCCCC',\nmodalForegroundLabel: 'black',\n+ modalForegroundSecondaryLabel: '#888888',\nmodalBackground: '#EEEEEE',\nmodalBackgroundLabel: '#333333',\n+ modalBackgroundSecondaryLabel: '#AAAAAA',\nmodalIosHighlightUnderlay: '#CCCCCCDD',\n+ modalSubtext: '#CCCCCC',\n+ modalSubtextLabel: '#555555',\nlistForegroundLabel: 'black',\nlistForegroundSecondaryLabel: '#333333',\nlistForegroundTertiaryLabel: '#666666',\n@@ -58,10 +64,16 @@ const dark: Colors = {\npanelForegroundLabel: 'white',\npanelForegroundSecondaryLabel: '#AAAAAA',\npanelIosHighlightUnderlay: '#444444DD',\n+ modalForeground: '#1C1C1E',\n+ modalForegroundBorder: '#1C1C1E',\nmodalForegroundLabel: 'white',\n+ modalForegroundSecondaryLabel: '#AAAAAA',\nmodalBackground: '#2C2C2E',\nmodalBackgroundLabel: '#CCCCCC',\n+ modalBackgroundSecondaryLabel: '#555555',\nmodalIosHighlightUnderlay: '#AAAAAA88',\n+ modalSubtext: '#444444',\n+ modalSubtextLabel: '#AAAAAA',\nlistForegroundLabel: 'white',\nlistForegroundSecondaryLabel: '#CCCCCC',\nlistForegroundTertiaryLabel: '#999999',\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Dark mode for ComposeThread
129,187
24.10.2019 21:52:09
14,400
c9c99dce5bbed10cd699a4b0ba7a66756e6f7679
[native] Back out react-native-hyperlink update It seems to have broken things
[ { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"react-native-floating-action\": \"^1.19.1\",\n\"react-native-fs\": \"^2.14.1\",\n\"react-native-gesture-handler\": \"^1.4.1\",\n- \"react-native-hyperlink\": \"^0.0.16\",\n+ \"react-native-hyperlink\": \"git+https://git@github.com/ashoat/react-native-hyperlink.git#both\",\n\"react-native-image-resizer\": \"^1.0.1\",\n\"react-native-in-app-message\": \"^1.0.2\",\n\"react-native-keyboard-input\": \"^5.3.1\",\n" }, { "change_type": "RENAME", "old_path": "patches/react-native-hyperlink+0.0.16.patch", "new_path": "patches/react-native-hyperlink+0.0.12.patch", "diff": "diff --git a/node_modules/react-native-hyperlink/dist/index.js b/node_modules/react-native-hyperlink/dist/index.js\n-index a895324..caa80b6 100644\n+index a63c4ee..a345761 100644\n--- a/node_modules/react-native-hyperlink/dist/index.js\n+++ b/node_modules/react-native-hyperlink/dist/index.js\n@@ -52,13 +52,11 @@ var Hyperlink = function (_Component) {\n@@ -21,17 +21,8 @@ index a895324..caa80b6 100644\n}\n}, {\nkey: 'render',\n-@@ -115,7 +113,7 @@ var Hyperlink = function (_Component) {\n- if (_this2.props.linkText) text = typeof _this2.props.linkText === 'function' ? _this2.props.linkText(url) : _this2.props.linkText;\n-\n- var clickHandlerProps = {};\n-- if (OS !== 'web') {\n-+ if (OS !== 'web' && this.props.onLongPress) {\n- clickHandlerProps.onLongPress = _this2.props.onLongPress ? function () {\n- return _this2.props.onLongPress(url, text);\n- } : undefined;\ndiff --git a/node_modules/react-native-hyperlink/src/Hyperlink.js b/node_modules/react-native-hyperlink/src/Hyperlink.js\n-index c391bb0..7d6f69e 100644\n+index ad90132..9406200 100644\n--- a/node_modules/react-native-hyperlink/src/Hyperlink.js\n+++ b/node_modules/react-native-hyperlink/src/Hyperlink.js\n@@ -23,8 +23,10 @@ class Hyperlink extends Component {\n@@ -47,12 +38,3 @@ index c391bb0..7d6f69e 100644\n}\nrender() {\n-@@ -79,7 +81,7 @@ class Hyperlink extends Component {\n- : this.props.linkText\n-\n- const clickHandlerProps = {}\n-- if (OS !== 'web') {\n-+ if (OS !== 'web' && this.props.onLongPress) {\n- clickHandlerProps.onLongPress = this.props.onLongPress\n- ? () => this.props.onLongPress(url, text)\n- : undefined\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -7301,7 +7301,14 @@ levn@^0.3.0, levn@~0.3.0:\nprelude-ls \"~1.1.2\"\ntype-check \"~0.3.2\"\n-linkify-it@^2.0.3, linkify-it@^2.2.0:\n+linkify-it@^1.2.0:\n+ version \"1.2.4\"\n+ resolved \"https://registry.yarnpkg.com/linkify-it/-/linkify-it-1.2.4.tgz#0773526c317c8fd13bd534ee1d180ff88abf881a\"\n+ integrity sha1-B3NSbDF8j9E71TTuHRgP+Iq/iBo=\n+ dependencies:\n+ uc.micro \"^1.0.1\"\n+\n+linkify-it@^2.0.3:\nversion \"2.2.0\"\nresolved \"https://registry.yarnpkg.com/linkify-it/-/linkify-it-2.2.0.tgz#e3b54697e78bf915c70a38acd78fd09e0058b1cf\"\nintegrity sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==\n@@ -10082,12 +10089,11 @@ react-native-gesture-handler@^1.4.1:\ninvariant \"^2.2.4\"\nprop-types \"^15.7.2\"\n-react-native-hyperlink@^0.0.16:\n- version \"0.0.16\"\n- resolved \"https://registry.yarnpkg.com/react-native-hyperlink/-/react-native-hyperlink-0.0.16.tgz#3f60f6d1fb86ea883c64a2cec3e9ee2c890ae739\"\n- integrity sha512-3W+dK0u96XTbNzmjTV0NLBCjZuF3r87Zr1FwDYeob5fjeU9grc9dss5Rind/drJFmXH5hXRyhKxX0xFs1gULFw==\n+\"react-native-hyperlink@git+https://git@github.com/ashoat/react-native-hyperlink.git#both\":\n+ version \"0.0.12\"\n+ resolved \"git+https://git@github.com/ashoat/react-native-hyperlink.git#0c872d5be30ba6382c926e78ad1545a97f586f85\"\ndependencies:\n- linkify-it \"^2.2.0\"\n+ linkify-it \"^1.2.0\"\nmdurl \"^1.0.0\"\nreact-native-image-resizer@^1.0.1:\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Back out react-native-hyperlink update It seems to have broken things
129,187
24.10.2019 22:35:59
14,400
68ee6d213c9a57ef7afd049f476cce6a70557c9d
[native] Dark mode for MessageList
[ { "change_type": "MODIFY", "old_path": "native/calendar/entry.react.js", "new_path": "native/calendar/entry.react.js", "diff": "@@ -391,10 +391,7 @@ class InternalEntry extends React.Component<Props, State> {\nrawText += \" \";\n}\nconst textStyle = { color: textColor };\n- const linkColorStyle = darkColor\n- ? { color: colors.dark.link }\n- : { color: colors.light.link };\n- const linkStyle = [ this.props.styles.linkText, linkColorStyle ];\n+ const linkStyle = darkColor ? styles.lightLinkText : styles.darkLinkText;\n// We use an empty View to set the height of the entry, and then position\n// the Text and TextInput absolutely. This allows to measure height changes\n// to the Text while controlling the actual height of the entry.\n@@ -749,7 +746,12 @@ const styles = {\nbutton: {\npadding: 5,\n},\n- linkText: {\n+ lightLinkText: {\n+ color: colors.dark.link,\n+ textDecorationLine: \"underline\",\n+ },\n+ darkLinkText: {\n+ color: colors.light.link,\ntextDecorationLine: \"underline\",\n},\npencilIcon: {\n" }, { "change_type": "MODIFY", "old_path": "native/chat/composed-message.react.js", "new_path": "native/chat/composed-message.react.js", "diff": "@@ -4,6 +4,7 @@ import type { ChatMessageInfoItemWithHeight } from './message.react';\nimport { chatMessageItemPropType } from 'lib/selectors/chat-selectors';\nimport { assertComposableMessageType } from 'lib/types/message-types';\nimport type { AppState } from '../redux/redux-setup';\n+import type { Colors } from '../themes/colors';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n@@ -15,6 +16,7 @@ import { connect } from 'lib/utils/redux-utils';\nimport FailedSend from './failed-send.react';\nimport { composedMessageMaxWidthSelector } from './composed-message-width';\nimport MessageHeader from './message-header.react';\n+import { colorsSelector } from '../themes/colors';\ntype Props = {|\nitem: ChatMessageInfoItemWithHeight,\n@@ -23,6 +25,7 @@ type Props = {|\nchildren: React.Node,\n// Redux state\ncomposedMessageMaxWidth: number,\n+ colors: Colors,\n...React.ElementProps<typeof View>,\n|};\nclass ComposedMessage extends React.PureComponent<Props> {\n@@ -33,6 +36,7 @@ class ComposedMessage extends React.PureComponent<Props> {\nfocused: PropTypes.bool.isRequired,\nchildren: PropTypes.node.isRequired,\ncomposedMessageMaxWidth: PropTypes.number.isRequired,\n+ colors: PropTypes.objectOf(PropTypes.string).isRequired,\n};\nrender() {\n@@ -56,12 +60,12 @@ class ComposedMessage extends React.PureComponent<Props> {\nlet failedSendInfo = null;\nif (isViewer) {\nlet deliveryIconName;\n- let deliveryIconColor = item.threadInfo.color;\n+ let deliveryIconColor = `#${item.threadInfo.color}`;\nif (id !== null && id !== undefined) {\ndeliveryIconName = \"check-circle\";\n} else if (sendFailed) {\ndeliveryIconName = \"x-circle\";\n- deliveryIconColor = \"FF0000\";\n+ deliveryIconColor = this.props.colors.redText;\nfailedSendInfo = <FailedSend item={item} />;\n} else {\ndeliveryIconName = \"circle\";\n@@ -70,7 +74,7 @@ class ComposedMessage extends React.PureComponent<Props> {\n<View style={styles.iconContainer}>\n<Icon\nname={deliveryIconName}\n- style={[styles.icon, { color: `#${deliveryIconColor}` }]}\n+ style={[ styles.icon, { color: deliveryIconColor } ]}\n/>\n</View>\n);\n@@ -78,7 +82,7 @@ class ComposedMessage extends React.PureComponent<Props> {\nreturn (\n<View {...viewProps}>\n- <MessageHeader item={item} focused={focused} color=\"dark\" />\n+ <MessageHeader item={item} focused={focused} contrast=\"low\" />\n<View style={containerStyle}>\n<View style={[ styles.content, alignStyle ]}>\n<View style={[ styles.messageBox, messageBoxStyle, alignStyle ]}>\n@@ -128,5 +132,6 @@ const styles = StyleSheet.create({\nexport default connect(\n(state: AppState) => ({\ncomposedMessageMaxWidth: composedMessageMaxWidthSelector(state),\n+ colors: colorsSelector(state),\n}),\n)(ComposedMessage);\n" }, { "change_type": "MODIFY", "old_path": "native/chat/failed-send.react.js", "new_path": "native/chat/failed-send.react.js", "diff": "@@ -10,9 +10,10 @@ import {\n} from 'lib/types/message-types';\nimport type { AppState } from '../redux/redux-setup';\nimport type { DispatchActionPromise } from 'lib/utils/action-utils';\n+import type { Styles } from '../types/styles';\nimport * as React from 'react';\n-import { Text, StyleSheet, View } from 'react-native';\n+import { Text, View } from 'react-native';\nimport invariant from 'invariant';\nimport PropTypes from 'prop-types';\n@@ -29,11 +30,13 @@ import {\n} from './chat-input-state';\nimport Button from '../components/button.react';\n+import { styleSelector } from '../themes/colors';\ntype Props = {|\nitem: ChatMessageInfoItemWithHeight,\n// Redux state\nrawMessageInfo: ?RawMessageInfo,\n+ styles: Styles,\n// Redux dispatch functions\ndispatchActionPromise: DispatchActionPromise,\n// async functions that hit server APIs\n@@ -50,6 +53,7 @@ class FailedSend extends React.PureComponent<Props> {\nstatic propTypes = {\nitem: chatMessageItemPropType.isRequired,\nrawMessageInfo: PropTypes.object,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\ndispatchActionPromise: PropTypes.func.isRequired,\nsendTextMessage: PropTypes.func.isRequired,\nchatInputState: chatInputStatePropType,\n@@ -60,12 +64,12 @@ class FailedSend extends React.PureComponent<Props> {\nreturn null;\n}\nreturn (\n- <View style={styles.failedSendInfo}>\n- <Text style={styles.deliveryFailed} numberOfLines={1}>\n+ <View style={this.props.styles.failedSendInfo}>\n+ <Text style={this.props.styles.deliveryFailed} numberOfLines={1}>\nDELIVERY FAILED.\n</Text>\n<Button onPress={this.retrySend}>\n- <Text style={styles.retrySend} numberOfLines={1}>\n+ <Text style={this.props.styles.retrySend} numberOfLines={1}>\nRETRY?\n</Text>\n</Button>\n@@ -128,7 +132,7 @@ class FailedSend extends React.PureComponent<Props> {\n}\n-const styles = StyleSheet.create({\n+const styles = {\nfailedSendInfo: {\npaddingTop: 5,\nflex: 1,\n@@ -138,19 +142,21 @@ const styles = StyleSheet.create({\n},\ndeliveryFailed: {\npaddingHorizontal: 3,\n- color: '#555555',\n+ color: 'listSeparatorLabel',\n},\nretrySend: {\npaddingHorizontal: 3,\n- color: \"#036AFF\",\n+ color: 'link',\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\nexport default connect(\n(state: AppState, ownProps: { item: ChatMessageInfoItemWithHeight }) => {\nconst id = messageID(ownProps.item.messageInfo);\nreturn {\nrawMessageInfo: state.messageStore.messages[id],\n+ styles: stylesSelector(state),\n};\n},\n{ sendTextMessage },\n" }, { "change_type": "MODIFY", "old_path": "native/chat/inner-text-message.react.js", "new_path": "native/chat/inner-text-message.react.js", "diff": "import { chatMessageItemPropType } from 'lib/selectors/chat-selectors';\nimport type { ChatTextMessageInfoItemWithHeight } from './text-message.react';\n+import { type GlobalTheme, globalThemePropType } from '../types/themes';\n+import type { AppState } from '../redux/redux-setup';\n+import type { Colors } from '../themes/colors';\nimport * as React from 'react';\nimport { View, Text, StyleSheet, TouchableOpacity } from 'react-native';\n@@ -10,13 +13,18 @@ import Hyperlink from 'react-native-hyperlink';\nimport { colorIsDark } from 'lib/shared/thread-utils';\nimport { onlyEmojiRegex } from 'lib/shared/emojis';\n+import { connect } from 'lib/utils/redux-utils';\nimport { RoundedMessageContainer } from './rounded-message-container.react';\n+import { colorsSelector, colors } from '../themes/colors';\ntype Props = {|\nitem: ChatTextMessageInfoItemWithHeight,\nonPress: () => void,\nmessageRef?: (message: ?View) => void,\n+ // Redux state\n+ activeTheme: ?GlobalTheme,\n+ colors: Colors,\n|};\nclass InnerTextMessage extends React.PureComponent<Props> {\n@@ -24,6 +32,8 @@ class InnerTextMessage extends React.PureComponent<Props> {\nitem: chatMessageItemPropType.isRequired,\nonPress: PropTypes.func.isRequired,\nmessageRef: PropTypes.func,\n+ activeTheme: globalThemePropType,\n+ colors: PropTypes.objectOf(PropTypes.string).isRequired,\n};\nrender() {\n@@ -31,19 +41,21 @@ class InnerTextMessage extends React.PureComponent<Props> {\nconst { text, id, creator } = item.messageInfo;\nconst { isViewer } = creator;\n- let messageStyle = {}, textCustomStyle = {}, darkColor = false;\n+ let messageStyle = {}, textCustomStyle = {}, darkColor;\nif (isViewer) {\nconst threadColor = item.threadInfo.color;\nmessageStyle.backgroundColor = `#${threadColor}`;\ndarkColor = colorIsDark(threadColor);\n- textCustomStyle.color = darkColor ? 'white' : 'black';\n} else {\n- messageStyle.backgroundColor = \"#DDDDDDBB\";\n- textCustomStyle.color = 'black';\n+ messageStyle.backgroundColor = this.props.colors.listChatBubble;\n+ darkColor = this.props.activeTheme === 'dark';\n}\ntextCustomStyle.height = item.contentHeight;\nconst linkStyle = darkColor ? styles.lightLinkText : styles.darkLinkText;\n+ textCustomStyle.color = darkColor\n+ ? colors.dark.listForegroundLabel\n+ : colors.light.listForegroundLabel;\nconst textStyle = onlyEmojiRegex.test(text)\n? styles.emojiOnlyText\n: styles.text;\n@@ -100,13 +112,16 @@ const styles = StyleSheet.create({\npaddingHorizontal: 12,\n},\ndarkLinkText: {\n- color: \"#036AFF\",\n+ color: colors.light.link,\ntextDecorationLine: \"underline\",\n},\nlightLinkText: {\n- color: \"#129AFF\",\n+ color: colors.dark.link,\ntextDecorationLine: \"underline\",\n},\n});\n-export default InnerTextMessage;\n+export default connect((state: AppState) => ({\n+ activeTheme: state.globalThemeInfo.activeTheme,\n+ colors: colorsSelector(state),\n+}))(InnerTextMessage);\n" }, { "change_type": "MODIFY", "old_path": "native/chat/message-header.react.js", "new_path": "native/chat/message-header.react.js", "diff": "// @flow\nimport type { ChatMessageInfoItemWithHeight } from './message.react';\n+import type { AppState } from '../redux/redux-setup';\n+import type { Styles } from '../types/styles';\nimport * as React from 'react';\n-import { View, Text, StyleSheet } from 'react-native';\n+import { View, Text } from 'react-native';\nimport { stringForUser } from 'lib/shared/user-utils';\n+import { connect } from 'lib/utils/redux-utils';\nimport Timestamp from './timestamp.react';\n+import { styleSelector } from '../themes/colors';\ntype Props = {|\nitem: ChatMessageInfoItemWithHeight,\nfocused: bool,\n- color: 'light' | 'dark',\n+ contrast: 'high' | 'low',\n+ // Redux state\n+ styles: Styles,\n|};\nfunction MessageHeader(props: Props) {\n- const { item, focused, color } = props;\n+ const { item, focused, contrast } = props;\nconst { creator, time } = item.messageInfo;\nconst { isViewer } = creator;\nlet authorName = null;\nif (!isViewer && (item.startsCluster || focused)) {\n- const style = color === 'light' || !item.startsCluster\n- ? [ styles.authorName, styles.light ]\n- : [ styles.authorName, styles.dark ];\n+ const style = contrast === 'high' || !item.startsCluster\n+ ? [ props.styles.authorName, props.styles.highContrast ]\n+ : [ props.styles.authorName, props.styles.lowContrast ];\nauthorName = (\n<Text style={style} numberOfLines={1}>\n{stringForUser(creator)}\n@@ -31,18 +37,18 @@ function MessageHeader(props: Props) {\n);\n}\n- const timestampColor = color === 'light' || !item.startsConversation\n- ? 'light'\n- : 'dark';\n+ const timestampContrast = contrast === 'high' || !item.startsConversation\n+ ? 'high'\n+ : 'low';\nconst timestamp = focused || item.startsConversation\n- ? <Timestamp time={time} color={timestampColor} />\n+ ? <Timestamp time={time} contrast={timestampContrast} />\n: null;\nif (!timestamp && !authorName) {\nreturn null;\n}\nconst style = !item.startsCluster\n- ? styles.clusterMargin\n+ ? props.styles.clusterMargin\n: null;\nreturn (\n<View style={style}>\n@@ -52,12 +58,11 @@ function MessageHeader(props: Props) {\n);\n}\n-const styles = StyleSheet.create({\n+const styles = {\nclusterMargin: {\nmarginTop: 7,\n},\nauthorName: {\n- color: '#777777',\nfontSize: 14,\nmarginLeft: 12,\nmarginRight: 7,\n@@ -65,12 +70,16 @@ const styles = StyleSheet.create({\npaddingVertical: 4,\nheight: 25,\n},\n- dark: {\n- color: '#777777',\n+ lowContrast: {\n+ color: 'listBackgroundSecondaryLabel',\n},\n- light: {\n+ highContrast: {\n+ // high contrast framed against LightboxNavigator-dimmed background\ncolor: 'white',\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\n-export default MessageHeader;\n+export default connect((state: AppState) => ({\n+ styles: stylesSelector(state),\n+}))(MessageHeader);\n" }, { "change_type": "MODIFY", "old_path": "native/chat/message-list-container.react.js", "new_path": "native/chat/message-list-container.react.js", "diff": "@@ -16,10 +16,12 @@ import {\ntype MessageListNavProp,\nmessageListNavPropType,\n} from './message-list-types';\n+import type { Colors } from '../themes/colors';\n+import type { Styles } from '../types/styles';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n-import { View, Platform, StyleSheet, ActivityIndicator } from 'react-native';\n+import { View, Platform, ActivityIndicator } from 'react-native';\nimport _differenceWith from 'lodash/fp/differenceWith';\nimport invariant from 'invariant';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n@@ -50,6 +52,7 @@ import {\nchatInputStatePropType,\nwithChatInputState,\n} from './chat-input-state';\n+import { colorsSelector, styleSelector } from '../themes/colors';\nexport type ChatMessageItemWithHeight =\n{| itemType: \"loader\" |} |\n@@ -62,6 +65,8 @@ type Props = {|\nmessageListData: $ReadOnlyArray<ChatMessageItem>,\ntextMessageMaxWidth: number,\ncomposedMessageMaxWidth: number,\n+ colors: Colors,\n+ styles: Styles,\n// withChatInputState\nchatInputState: ?ChatInputState,\n|};\n@@ -77,6 +82,8 @@ class MessageListContainer extends React.PureComponent<Props, State> {\nmessageListData: PropTypes.arrayOf(chatMessageItemPropType).isRequired,\ntextMessageMaxWidth: PropTypes.number.isRequired,\ncomposedMessageMaxWidth: PropTypes.number.isRequired,\n+ colors: PropTypes.objectOf(PropTypes.string).isRequired,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\nchatInputState: chatInputStatePropType,\n};\nstatic navigationOptions = ({ navigation }) => ({\n@@ -124,8 +131,8 @@ class MessageListContainer extends React.PureComponent<Props, State> {\nif (messageInfo.type === messageTypes.TEXT) {\nconst style = [\nonlyEmojiRegex.test(messageInfo.text)\n- ? styles.emojiOnlyText\n- : styles.text,\n+ ? this.props.styles.emojiOnlyText\n+ : this.props.styles.text,\n{ width: this.props.textMessageMaxWidth },\n];\ntextToMeasure.push({\n@@ -137,7 +144,7 @@ class MessageListContainer extends React.PureComponent<Props, State> {\ntextToMeasure.push({\nid: messageKey(messageInfo),\ntext: robotextToRawString(item.robotext),\n- style: styles.robotext,\n+ style: this.props.styles.robotext,\n});\n}\n}\n@@ -210,18 +217,18 @@ class MessageListContainer extends React.PureComponent<Props, State> {\n);\n} else {\nmessageList = (\n- <View style={styles.loadingIndicatorContainer}>\n+ <View style={this.props.styles.loadingIndicatorContainer}>\n<ActivityIndicator\n- color=\"black\"\n+ color={this.props.colors.listSeparatorLabel}\nsize=\"large\"\n- style={styles.loadingIndicator}\n+ style={this.props.styles.loadingIndicator}\n/>\n</View>\n);\n}\nreturn (\n- <View style={styles.container}>\n+ <View style={this.props.styles.container}>\n<TextHeightMeasurer\ntextToMeasure={this.state.textToMeasure}\nallHeightsMeasuredCallback={this.allHeightsMeasured}\n@@ -326,9 +333,10 @@ class MessageListContainer extends React.PureComponent<Props, State> {\n}\n-const styles = StyleSheet.create({\n+const styles = {\ncontainer: {\nflex: 1,\n+ backgroundColor: 'listSeparator',\n},\nloadingIndicator: {\nflex: 1,\n@@ -350,7 +358,8 @@ const styles = StyleSheet.create({\nfontSize: 15,\nfontFamily: 'Arial',\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\nconst ConnectedMessageListContainer = connect(\n(state: AppState, ownProps: { navigation: MessageListNavProp }) => {\n@@ -360,6 +369,8 @@ const ConnectedMessageListContainer = connect(\nmessageListData: messageListData(threadID)(state),\ntextMessageMaxWidth: textMessageMaxWidthSelector(state),\ncomposedMessageMaxWidth: composedMessageMaxWidthSelector(state),\n+ colors: colorsSelector(state),\n+ styles: stylesSelector(state),\n};\n},\n)(withChatInputState(MessageListContainer));\n" }, { "change_type": "MODIFY", "old_path": "native/chat/message-list-header-title.react.js", "new_path": "native/chat/message-list-header-title.react.js", "diff": "import type { ThreadInfo } from 'lib/types/thread-types';\nimport { threadInfoPropType } from 'lib/types/thread-types';\nimport type { Navigate } from '../navigation/route-names';\n+import type { AppState } from '../redux/redux-setup';\n+import type { Styles } from '../types/styles';\nimport * as React from 'react';\n-import { View, Text, StyleSheet, Platform } from 'react-native';\n+import { View, Text, Platform } from 'react-native';\nimport PropTypes from 'prop-types';\nimport Icon from 'react-native-vector-icons/Ionicons';\nimport { HeaderTitle } from 'react-navigation-stack';\n+import { connect } from 'lib/utils/redux-utils';\n+\nimport Button from '../components/button.react';\nimport { ThreadSettingsRouteName } from '../navigation/route-names';\n+import { styleSelector } from '../themes/colors';\ntype Props = {|\nthreadInfo: ThreadInfo,\nnavigate: Navigate,\n+ // Redux state\n+ styles: Styles,\n|};\nclass MessageListHeaderTitle extends React.PureComponent<Props> {\nstatic propTypes = {\nthreadInfo: threadInfoPropType.isRequired,\nnavigate: PropTypes.func.isRequired,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\n};\nrender() {\n@@ -31,26 +39,25 @@ class MessageListHeaderTitle extends React.PureComponent<Props> {\n<Icon\nname=\"ios-arrow-forward\"\nsize={20}\n- style={styles.forwardIcon}\n- color=\"#036AFF\"\n+ style={this.props.styles.forwardIcon}\n/>\n);\nfakeIcon = (\n<Icon\nname=\"ios-arrow-forward\"\nsize={20}\n- style={styles.fakeIcon}\n+ style={this.props.styles.fakeIcon}\n/>\n);\n}\nreturn (\n<Button\nonPress={this.onPress}\n- style={styles.button}\n- topStyle={styles.button}\n+ style={this.props.styles.button}\n+ topStyle={this.props.styles.button}\nandroidBorderlessRipple={true}\n>\n- <View style={styles.container}>\n+ <View style={this.props.styles.container}>\n{fakeIcon}\n<HeaderTitle>\n{this.props.threadInfo.uiName}\n@@ -72,7 +79,7 @@ class MessageListHeaderTitle extends React.PureComponent<Props> {\n}\n-const styles = StyleSheet.create({\n+const styles = {\nbutton: {\nposition: 'absolute',\nleft: 0,\n@@ -89,12 +96,18 @@ const styles = StyleSheet.create({\nforwardIcon: {\nflex: 1,\nminWidth: 25,\n+ color: 'link',\n},\nfakeIcon: {\nflex: 1,\nminWidth: 25,\nopacity: 0,\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\n-export default MessageListHeaderTitle;\n+export default connect((state: AppState) => ({\n+ urlPrefix: state.urlPrefix,\n+ customServer: state.customServer,\n+ styles: stylesSelector(state),\n+}))(MessageListHeaderTitle);\n" }, { "change_type": "MODIFY", "old_path": "native/chat/message-list.react.js", "new_path": "native/chat/message-list.react.js", "diff": "@@ -22,15 +22,11 @@ import {\nkeyboardStatePropType,\nwithKeyboardState,\n} from '../navigation/keyboard-state';\n+import type { Styles } from '../types/styles';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n-import {\n- View,\n- StyleSheet,\n- FlatList,\n- TouchableWithoutFeedback,\n-} from 'react-native';\n+import { View, FlatList, TouchableWithoutFeedback } from 'react-native';\nimport _sum from 'lodash/fp/sum';\nimport _find from 'lodash/fp/find';\nimport { createSelector } from 'reselect';\n@@ -56,6 +52,7 @@ import ListLoadingIndicator from '../components/list-loading-indicator.react';\nimport {\nscrollBlockingChatModalsClosedSelector,\n} from '../selectors/nav-selectors';\n+import { styleSelector } from '../themes/colors';\ntype Props = {|\nthreadInfo: ThreadInfo,\n@@ -65,6 +62,7 @@ type Props = {|\nviewerID: ?string,\nstartReached: bool,\nscrollBlockingModalsClosed: bool,\n+ styles: Styles,\n// withOverlayableScrollViewState\noverlayableScrollViewState: ?OverlayableScrollViewState,\n// withKeyboardState\n@@ -102,6 +100,7 @@ class MessageList extends React.PureComponent<Props, State> {\nviewerID: PropTypes.string,\nstartReached: PropTypes.bool.isRequired,\nscrollBlockingModalsClosed: PropTypes.bool.isRequired,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\noverlayableScrollViewState: overlayableScrollViewStatePropType,\nkeyboardState: keyboardStatePropType,\ndispatchActionPromise: PropTypes.func.isRequired,\n@@ -204,7 +203,7 @@ class MessageList extends React.PureComponent<Props, State> {\nif (row.item.itemType === \"loader\") {\nreturn (\n<TouchableWithoutFeedback onPress={this.dismissKeyboard}>\n- <View style={styles.listLoadingIndicator}>\n+ <View style={this.props.styles.listLoadingIndicator}>\n<ListLoadingIndicator />\n</View>\n</TouchableWithoutFeedback>\n@@ -268,17 +267,16 @@ class MessageList extends React.PureComponent<Props, State> {\nreturn _sum(data.map(this.itemHeight));\n}\n- static ListFooterComponent(props: {}) {\n// Actually header, it's just that our FlatList is inverted\n- return <View style={styles.header} />;\n- }\n+ ListFooterComponent =\n+ (props: {}) => <View style={this.props.styles.header} />;\nrender() {\nconst { messageListData, startReached } = this.props;\n- const footer = startReached ? MessageList.ListFooterComponent : undefined;\n+ const footer = startReached ? this.ListFooterComponent : undefined;\nreturn (\n<View\n- style={styles.container}\n+ style={this.props.styles.container}\nref={this.flatListContainerRef}\nonLayout={this.onFlatListContainerLayout}\n>\n@@ -369,10 +367,10 @@ class MessageList extends React.PureComponent<Props, State> {\n}\n-const styles = StyleSheet.create({\n+const styles = {\ncontainer: {\nflex: 1,\n- backgroundColor: '#FFFFFF',\n+ backgroundColor: 'listBackground',\n},\nheader: {\nheight: 12,\n@@ -380,7 +378,8 @@ const styles = StyleSheet.create({\nlistLoadingIndicator: {\nflex: 1,\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\nregisterFetchKey(fetchMessagesBeforeCursorActionTypes);\nregisterFetchKey(fetchMostRecentMessagesActionTypes);\n@@ -393,6 +392,7 @@ export default connect(\nstartReached: !!(state.messageStore.threads[threadID] &&\nstate.messageStore.threads[threadID].startReached),\nscrollBlockingModalsClosed: scrollBlockingChatModalsClosedSelector(state),\n+ styles: stylesSelector(state),\n};\n},\n{ fetchMessagesBeforeCursor, fetchMostRecentMessages },\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-tooltip-button.react.js", "new_path": "native/chat/multimedia-tooltip-button.react.js", "diff": "@@ -123,7 +123,7 @@ class MultimediaTooltipButton extends React.PureComponent<Props> {\nreturn (\n<React.Fragment>\n<Animated.View style={this.headerStyle}>\n- <MessageHeader item={item} focused={true} color=\"light\" />\n+ <MessageHeader item={item} focused={true} contrast=\"high\" />\n</Animated.View>\n<View style={[ styles.media, roundedStyle ]}>\n<InlineMultimedia\n" }, { "change_type": "MODIFY", "old_path": "native/chat/robotext-message.react.js", "new_path": "native/chat/robotext-message.react.js", "diff": "@@ -13,14 +13,10 @@ import {\nkeyboardStatePropType,\nwithKeyboardState,\n} from '../navigation/keyboard-state';\n+import type { Styles } from '../types/styles';\nimport * as React from 'react';\n-import {\n- Text,\n- StyleSheet,\n- TouchableWithoutFeedback,\n- View,\n-} from 'react-native';\n+import { Text, TouchableWithoutFeedback, View } from 'react-native';\nimport PropTypes from 'prop-types';\nimport Hyperlink from 'react-native-hyperlink';\n@@ -34,6 +30,7 @@ import { connect } from 'lib/utils/redux-utils';\nimport { MessageListRouteName } from '../navigation/route-names';\nimport Timestamp from './timestamp.react';\n+import { styleSelector } from '../themes/colors';\nexport type ChatRobotextMessageInfoItemWithHeight = {|\nitemType: \"message\",\n@@ -60,6 +57,8 @@ type Props = {|\ntoggleFocus: (messageKey: string) => void,\n// withKeyboardState\nkeyboardState: ?KeyboardState,\n+ // Redux state\n+ styles: Styles,\n...React.ElementProps<typeof View>,\n|};\nclass RobotextMessage extends React.PureComponent<Props> {\n@@ -69,6 +68,7 @@ class RobotextMessage extends React.PureComponent<Props> {\nfocused: PropTypes.bool.isRequired,\ntoggleFocus: PropTypes.func.isRequired,\nkeyboardState: keyboardStatePropType,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\n};\nrender() {\n@@ -82,7 +82,7 @@ class RobotextMessage extends React.PureComponent<Props> {\nlet timestamp = null;\nif (focused || item.startsConversation) {\ntimestamp = (\n- <Timestamp time={item.messageInfo.time} color=\"dark\" />\n+ <Timestamp time={item.messageInfo.time} contrast=\"low\" />\n);\n}\nreturn (\n@@ -120,8 +120,8 @@ class RobotextMessage extends React.PureComponent<Props> {\n}\n}\nreturn (\n- <Hyperlink linkDefault={true} linkStyle={styles.link}>\n- <Text style={styles.robotext}>{textParts}</Text>\n+ <Hyperlink linkDefault={true} linkStyle={this.props.styles.link}>\n+ <Text style={this.props.styles.robotext}>{textParts}</Text>\n</Hyperlink>\n);\n}\n@@ -137,13 +137,18 @@ class RobotextMessage extends React.PureComponent<Props> {\n}\n-const WrappedRobotextMessage = withKeyboardState(RobotextMessage);\n+const WrappedRobotextMessage = connect(\n+ (state: AppState) => ({\n+ styles: stylesSelector(state),\n+ }),\n+)(withKeyboardState(RobotextMessage));\ntype InnerThreadEntityProps = {\nid: string,\nname: string,\n// Redux state\nthreadInfo: ThreadInfo,\n+ styles: Styles,\n// Redux dispatch functions\ndispatch: Dispatch,\n};\n@@ -153,12 +158,13 @@ class InnerThreadEntity extends React.PureComponent<InnerThreadEntityProps> {\nid: PropTypes.string.isRequired,\nname: PropTypes.string.isRequired,\nthreadInfo: threadInfoPropType.isRequired,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\ndispatch: PropTypes.func.isRequired,\n};\nrender() {\nreturn (\n- <Text style={styles.link} onPress={this.onPressThread}>\n+ <Text style={this.props.styles.link} onPress={this.onPressThread}>\n{this.props.name}\n</Text>\n);\n@@ -178,6 +184,7 @@ class InnerThreadEntity extends React.PureComponent<InnerThreadEntityProps> {\nconst ThreadEntity = connect(\n(state: AppState, ownProps: { id: string }) => ({\nthreadInfo: threadInfoSelector(state)[ownProps.id],\n+ styles: stylesSelector(state),\n}),\nnull,\ntrue,\n@@ -188,10 +195,10 @@ function ColorEntity(props: {| color: string |}) {\nreturn <Text style={colorStyle}>{props.color}</Text>;\n}\n-const styles = StyleSheet.create({\n+const styles = {\nrobotext: {\ntextAlign: 'center',\n- color: '#333333',\n+ color: 'listForegroundSecondaryLabel',\npaddingVertical: 6,\nmarginBottom: 5,\nmarginHorizontal: 24,\n@@ -199,9 +206,10 @@ const styles = StyleSheet.create({\nfontFamily: 'Arial',\n},\nlink: {\n- color: '#3333FF',\n+ color: 'link',\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\nexport {\nWrappedRobotextMessage as RobotextMessage,\n" }, { "change_type": "MODIFY", "old_path": "native/chat/rounded-message-container.react.js", "new_path": "native/chat/rounded-message-container.react.js", "diff": "@@ -4,10 +4,16 @@ import type { ChatMessageInfoItemWithHeight } from './message.react';\nimport { chatMessageItemPropType } from 'lib/selectors/chat-selectors';\nimport type { ViewStyle } from '../types/styles';\nimport type { Corners } from 'lib/types/media-types';\n+import type { AppState } from '../redux/redux-setup';\n+import type { Styles } from '../types/styles';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n-import { StyleSheet, View, ViewPropTypes } from 'react-native';\n+import { View, ViewPropTypes } from 'react-native';\n+\n+import { connect } from 'lib/utils/redux-utils';\n+\n+import { styleSelector } from '../themes/colors';\nfunction filterCorners(\ncorners: Corners,\n@@ -48,6 +54,8 @@ type Props = {|\nborderRadius: number,\nstyle?: ViewStyle,\nchildren: React.Node,\n+ // Redux state\n+ styles: Styles,\n|};\nclass RoundedMessageContainer extends React.PureComponent<Props> {\n@@ -56,6 +64,7 @@ class RoundedMessageContainer extends React.PureComponent<Props> {\nborderRadius: PropTypes.number.isRequired,\nstyle: ViewPropTypes.style,\nchildren: PropTypes.node.isRequired,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\n};\nstatic defaultProps = {\nborderRadius: 8,\n@@ -68,7 +77,7 @@ class RoundedMessageContainer extends React.PureComponent<Props> {\nborderRadius,\n);\nreturn (\n- <View style={[styles.message, cornerStyle, style]}>\n+ <View style={[ this.props.styles.message, cornerStyle, style ]}>\n{this.props.children}\n</View>\n);\n@@ -76,16 +85,23 @@ class RoundedMessageContainer extends React.PureComponent<Props> {\n}\n-const styles = StyleSheet.create({\n+const styles = {\nmessage: {\n- backgroundColor: 'white',\n+ backgroundColor: 'listBackground',\noverflow: 'hidden',\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\n+\n+const WrappedRoundedMessageContainer = connect(\n+ (state: AppState) => ({\n+ styles: stylesSelector(state),\n+ }),\n+)(RoundedMessageContainer);\nexport {\nallCorners,\nfilterCorners,\ngetRoundedContainerStyle,\n- RoundedMessageContainer,\n+ WrappedRoundedMessageContainer as RoundedMessageContainer,\n};\n" }, { "change_type": "MODIFY", "old_path": "native/chat/text-message-tooltip-button.react.js", "new_path": "native/chat/text-message-tooltip-button.react.js", "diff": "@@ -94,7 +94,7 @@ class TextMessageTooltipButton extends React.PureComponent<Props> {\nreturn (\n<React.Fragment>\n<Animated.View style={this.headerStyle}>\n- <MessageHeader item={item} focused={true} color=\"light\" />\n+ <MessageHeader item={item} focused={true} contrast=\"high\" />\n</Animated.View>\n<InnerTextMessage\nitem={item}\n" }, { "change_type": "MODIFY", "old_path": "native/chat/thread-settings-button.react.js", "new_path": "native/chat/thread-settings-button.react.js", "diff": "import { type ThreadInfo, threadInfoPropType } from 'lib/types/thread-types';\nimport type { Navigate } from '../navigation/route-names';\nimport type { AppState } from '../redux/redux-setup';\n-import type { Colors } from '../themes/colors';\n+import type { Styles } from '../types/styles';\nimport * as React from 'react';\n-import { StyleSheet } from 'react-native';\nimport Icon from 'react-native-vector-icons/Ionicons';\nimport PropTypes from 'prop-types';\n@@ -14,31 +13,29 @@ import { connect } from 'lib/utils/redux-utils';\nimport { ThreadSettingsRouteName } from '../navigation/route-names';\nimport Button from '../components/button.react';\n-import { colorsSelector } from '../themes/colors';\n+import { styleSelector } from '../themes/colors';\ntype Props = {|\nthreadInfo: ThreadInfo,\nnavigate: Navigate,\n// Redux state\n- colors: Colors,\n+ styles: Styles,\n|};\nclass ThreadSettingsButton extends React.PureComponent<Props> {\nstatic propTypes = {\nthreadInfo: threadInfoPropType.isRequired,\nnavigate: PropTypes.func.isRequired,\n- colors: PropTypes.objectOf(PropTypes.string).isRequired,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\n};\nrender() {\n- const { link: color } = this.props.colors;\nreturn (\n<Button onPress={this.onPress} androidBorderlessRipple={true}>\n<Icon\nname=\"md-settings\"\nsize={30}\n- style={styles.button}\n- color={color}\n+ style={this.props.styles.button}\n/>\n</Button>\n);\n@@ -55,12 +52,14 @@ class ThreadSettingsButton extends React.PureComponent<Props> {\n}\n-const styles = StyleSheet.create({\n+const styles = {\nbutton: {\npaddingHorizontal: 10,\n+ color: 'link',\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\nexport default connect((state: AppState) => ({\n- colors: colorsSelector(state),\n+ styles: stylesSelector(state),\n}))(ThreadSettingsButton);\n" }, { "change_type": "MODIFY", "old_path": "native/chat/timestamp.react.js", "new_path": "native/chat/timestamp.react.js", "diff": "// @flow\n+import type { AppState } from '../redux/redux-setup';\n+import type { Styles } from '../types/styles';\n+\nimport * as React from 'react';\n-import {\n- Text,\n- StyleSheet,\n-} from 'react-native';\n+import { Text } from 'react-native';\nimport { longAbsoluteDate } from 'lib/utils/date-utils';\n+import { connect } from 'lib/utils/redux-utils';\n+\n+import { styleSelector } from '../themes/colors';\ntype Props = {|\ntime: number,\n- color: 'light' | 'dark',\n+ contrast: 'high' | 'low',\n+ // Redux state\n+ styles: Styles,\n|};\nfunction Timestamp(props: Props) {\n- const style = props.color === 'light'\n- ? [ styles.timestamp, styles.light ]\n- : [ styles.timestamp, styles.dark ];\n+ const style = props.contrast === 'high'\n+ ? [ props.styles.timestamp, props.styles.highContrast ]\n+ : [ props.styles.timestamp, props.styles.lowContrast ];\nreturn (\n<Text style={style} numberOfLines={1}>\n{longAbsoluteDate(props.time).toUpperCase()}\n@@ -23,19 +28,23 @@ function Timestamp(props: Props) {\n);\n}\n-const styles = StyleSheet.create({\n+const styles = {\ntimestamp: {\nfontSize: 14,\npaddingVertical: 3,\nalignSelf: 'center',\nheight: 26,\n},\n- dark: {\n- color: '#777777',\n+ lowContrast: {\n+ color: 'listBackgroundTernaryLabel',\n},\n- light: {\n+ highContrast: {\n+ // high contrast framed against LightboxNavigator-dimmed background\ncolor: 'white',\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\n-export default Timestamp;\n+export default connect((state: AppState) => ({\n+ styles: stylesSelector(state),\n+}))(Timestamp);\n" }, { "change_type": "MODIFY", "old_path": "native/more/build-info.react.js", "new_path": "native/more/build-info.react.js", "diff": "@@ -86,7 +86,7 @@ const styles = {\n},\nreleaseText: {\nfontSize: 16,\n- color: 'red',\n+ color: 'redText',\n},\ntext: {\nfontSize: 16,\n" }, { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -37,7 +37,8 @@ const light = Object.freeze({\nlistForegroundQuaternaryLabel: '#AAAAAA',\nlistBackground: 'white',\nlistBackgroundLabel: 'black',\n- listBackgroundSecondaryLabel: '#777777',\n+ listBackgroundSecondaryLabel: '#444444',\n+ listBackgroundTernaryLabel: '#999999',\nlistSeparator: '#EEEEEE',\nlistSeparatorLabel: '#555555',\nlistInputBar: '#E2E2E2',\n@@ -47,10 +48,11 @@ const light = Object.freeze({\nlistIosHighlightUnderlay: '#DDDDDDDD',\nlistSearchBackground: '#DDDDDD',\nlistSearchIcon: '#AAAAAA',\n+ listChatBubble: '#DDDDDDBB',\n});\nexport type Colors = $Exact<typeof light>;\n-const dark: Colors = {\n+const dark: Colors = Object.freeze({\nredButton: '#FF4444',\ngreenButton: '#44BB44',\nmintButton: '#44CC99',\n@@ -81,6 +83,7 @@ const dark: Colors = {\nlistBackground: '#1C1C1E',\nlistBackgroundLabel: '#C7C7CC',\nlistBackgroundSecondaryLabel: '#BBBBBB',\n+ listBackgroundTernaryLabel: '#555555',\nlistSeparator: '#3A3A3C',\nlistSeparatorLabel: '#EEEEEE',\nlistInputBar: '#555555',\n@@ -90,7 +93,8 @@ const dark: Colors = {\nlistIosHighlightUnderlay: '#BBBBBB88',\nlistSearchBackground: '#555555',\nlistSearchIcon: '#AAAAAA',\n-};\n+ listChatBubble: '#444444DD',\n+});\nconst colors = { light, dark };\nconst colorsSelector: (state: AppState) => Colors = createSelector(\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Dark mode for MessageList
129,187
25.10.2019 13:48:17
14,400
aaac25d2949e5ffba73dacb53dbc2a25d272d8bc
[native] panelForegroundSecondaryLabel -> panelForegroundTertiaryLabel
[ { "change_type": "MODIFY", "old_path": "native/more/build-info.react.js", "new_path": "native/more/build-info.react.js", "diff": "@@ -81,7 +81,7 @@ const styles = {\n},\nlabel: {\nfontSize: 16,\n- color: 'panelForegroundSecondaryLabel',\n+ color: 'panelForegroundTertiaryLabel',\npaddingRight: 12,\n},\nreleaseText: {\n" }, { "change_type": "MODIFY", "old_path": "native/more/dev-tools.react.js", "new_path": "native/more/dev-tools.react.js", "diff": "@@ -230,7 +230,7 @@ const styles = {\ncolor: 'panelBackgroundLabel',\n},\ncustomServerLabel: {\n- color: 'panelForegroundSecondaryLabel',\n+ color: 'panelForegroundTertiaryLabel',\nfontSize: 16,\n},\nserverText: {\n" }, { "change_type": "MODIFY", "old_path": "native/more/more-screen.react.js", "new_path": "native/more/more-screen.react.js", "diff": "@@ -380,7 +380,7 @@ const styles = {\n},\nlabel: {\nfontSize: 16,\n- color: 'panelForegroundSecondaryLabel',\n+ color: 'panelForegroundTertiaryLabel',\npaddingRight: 12,\n},\nusername: {\n" }, { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -19,7 +19,7 @@ const light = Object.freeze({\npanelForeground: '#F2F2F7',\npanelForegroundBorder: '#D1D1D6',\npanelForegroundLabel: 'black',\n- panelForegroundSecondaryLabel: '#888888',\n+ panelForegroundTertiaryLabel: '#888888',\npanelIosHighlightUnderlay: '#EEEEEEDD',\nmodalForeground: 'white',\nmodalForegroundBorder: '#CCCCCC',\n@@ -64,7 +64,7 @@ const dark: Colors = Object.freeze({\npanelForeground: '#3A3A3C',\npanelForegroundBorder: '#2C2C2E',\npanelForegroundLabel: 'white',\n- panelForegroundSecondaryLabel: '#AAAAAA',\n+ panelForegroundTertiaryLabel: '#AAAAAA',\npanelIosHighlightUnderlay: '#444444DD',\nmodalForeground: '#1C1C1E',\nmodalForegroundBorder: '#1C1C1E',\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] panelForegroundSecondaryLabel -> panelForegroundTertiaryLabel
129,187
27.10.2019 17:33:46
14,400
44f528a28751c9398fd3247033d8a10c288f98c5
[native] Update panel white colors a bit
[ { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -14,10 +14,10 @@ const light = Object.freeze({\nredText: '#AA0000',\ngreenText: 'green',\nlink: '#036AFF',\n- panelBackground: '#E0E0E5',\n- panelBackgroundLabel: '#8E8E93',\n- panelForeground: '#F2F2F7',\n- panelForegroundBorder: '#D1D1D6',\n+ panelBackground: '#E9E9EF',\n+ panelBackgroundLabel: '#888888',\n+ panelForeground: 'white',\n+ panelForegroundBorder: '#CCCCCC',\npanelForegroundLabel: 'black',\npanelForegroundSecondaryLabel: '#333333',\npanelForegroundTertiaryLabel: '#888888',\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Update panel white colors a bit
129,187
27.10.2019 17:50:43
14,400
5bd0161086cfca8770ad5c344d1498792212f6f8
[native] Dark mode for ActionResultModal
[ { "change_type": "MODIFY", "old_path": "native/navigation/action-result-modal.react.js", "new_path": "native/navigation/action-result-modal.react.js", "diff": "@@ -5,13 +5,18 @@ import type {\nNavigationLeafRoute,\nNavigationStackScene,\n} from 'react-navigation';\n+import type { AppState } from '../redux/redux-setup';\n+import type { Styles } from '../types/styles';\nimport * as React from 'react';\n-import { View, Text, StyleSheet } from 'react-native';\n+import { View, Text } from 'react-native';\nimport PropTypes from 'prop-types';\nimport Animated from 'react-native-reanimated';\n+import { connect } from 'lib/utils/redux-utils';\n+\nimport { contentBottomOffset } from '../selectors/dimension-selectors';\n+import { styleSelector } from '../themes/colors';\nconst {\nValue,\n@@ -30,6 +35,8 @@ type Props = {|\nnavigation: NavProp,\nscene: NavigationStackScene,\nposition: Value,\n+ // Redux state\n+ styles: Styles,\n|};\nclass ActionResultModal extends React.PureComponent<Props> {\n@@ -44,6 +51,7 @@ class ActionResultModal extends React.PureComponent<Props> {\n}).isRequired,\nscene: PropTypes.object.isRequired,\nposition: PropTypes.instanceOf(Value).isRequired,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\n};\nprogress: Value;\n@@ -72,7 +80,7 @@ class ActionResultModal extends React.PureComponent<Props> {\nget containerStyle() {\nreturn {\n- ...styles.container,\n+ ...this.props.styles.container,\nopacity: this.progress,\n};\n}\n@@ -81,9 +89,9 @@ class ActionResultModal extends React.PureComponent<Props> {\nconst { message } = this.props.navigation.state.params;\nreturn (\n<Animated.View style={this.containerStyle}>\n- <View style={styles.message}>\n- <View style={styles.backdrop} />\n- <Text style={styles.text}>{message}</Text>\n+ <View style={this.props.styles.message}>\n+ <View style={this.props.styles.backdrop} />\n+ <Text style={this.props.styles.text}>{message}</Text>\n</View>\n</Animated.View>\n);\n@@ -91,7 +99,7 @@ class ActionResultModal extends React.PureComponent<Props> {\n}\n-const styles = StyleSheet.create({\n+const styles = {\ncontainer: {\nflex: 1,\njustifyContent: 'flex-end',\n@@ -104,8 +112,8 @@ const styles = StyleSheet.create({\noverflow: 'hidden',\n},\nbackdrop: {\n- backgroundColor: 'black',\n- opacity: 0.7,\n+ backgroundColor: 'modalContrastBackground',\n+ opacity: 0.8,\nposition: 'absolute',\ntop: 0,\nbottom: 0,\n@@ -114,8 +122,11 @@ const styles = StyleSheet.create({\n},\ntext: {\nfontSize: 20,\n- color: 'white',\n+ color: 'modalContrastForegroundLabel',\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\n-export default ActionResultModal;\n+export default connect((state: AppState) => ({\n+ styles: stylesSelector(state),\n+}))(ActionResultModal);\n" }, { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -36,6 +36,8 @@ const light = Object.freeze({\nmodalSubtextLabel: '#555555',\nmodalButton: '#BBBBBB',\nmodalButtonLabel: 'black',\n+ modalContrastBackground: 'black',\n+ modalContrastForegroundLabel: 'white',\nlistForegroundLabel: 'black',\nlistForegroundSecondaryLabel: '#333333',\nlistForegroundTertiaryLabel: '#666666',\n@@ -86,6 +88,8 @@ const dark: Colors = Object.freeze({\nmodalSubtextLabel: '#AAAAAA',\nmodalButton: '#666666',\nmodalButtonLabel: 'white',\n+ modalContrastBackground: 'white',\n+ modalContrastForegroundLabel: 'black',\nlistForegroundLabel: 'white',\nlistForegroundSecondaryLabel: '#CCCCCC',\nlistForegroundTertiaryLabel: '#999999',\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Dark mode for ActionResultModal
129,187
27.10.2019 18:10:50
14,400
d56256a9042e536da0b2648ec70645f61ea9b73e
[native] Different modalContrastOpacity in ActionResultModal for dark mode
[ { "change_type": "MODIFY", "old_path": "native/navigation/action-result-modal.react.js", "new_path": "native/navigation/action-result-modal.react.js", "diff": "@@ -113,7 +113,7 @@ const styles = {\n},\nbackdrop: {\nbackgroundColor: 'modalContrastBackground',\n- opacity: 0.8,\n+ opacity: 'modalContrastOpacity',\nposition: 'absolute',\ntop: 0,\nbottom: 0,\n" }, { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -39,6 +39,7 @@ const light = Object.freeze({\nmodalButtonLabel: 'black',\nmodalContrastBackground: 'black',\nmodalContrastForegroundLabel: 'white',\n+ modalContrastOpacity: 0.7,\nlistForegroundLabel: 'black',\nlistForegroundSecondaryLabel: '#333333',\nlistForegroundTertiaryLabel: '#666666',\n@@ -95,6 +96,7 @@ const dark: Colors = Object.freeze({\nmodalButtonLabel: 'white',\nmodalContrastBackground: 'white',\nmodalContrastForegroundLabel: 'black',\n+ modalContrastOpacity: 0.85,\nlistForegroundLabel: 'white',\nlistForegroundSecondaryLabel: '#CCCCCC',\nlistForegroundTertiaryLabel: '#999999',\n@@ -131,7 +133,13 @@ for (let theme in colors) {\n}\n}\n-function styleSelector<+S: Styles>(obj: S): (state: AppState) => S {\n+// Distinct type needed here because we replace type of some fields with strings\n+type InStyles = { [name: string]: { [field: string]: number | string } };\n+\n+function styleSelector<\n+ IS: InStyles,\n+ +OS: Styles,\n+>(obj: IS): (state: AppState) => OS {\nreturn createSelector(\ncolorsSelector,\n(themeColors: Colors) => {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Different modalContrastOpacity in ActionResultModal for dark mode
129,187
27.10.2019 21:51:56
14,400
32ea2e5258d351cfee0bfd016b0caa2969484467
[native] Dark mode for ImageGalleryKeyboard
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-input-bar.react.js", "new_path": "native/chat/chat-input-bar.react.js", "diff": "@@ -69,7 +69,6 @@ import { nonThreadCalendarQuery } from '../selectors/nav-selectors';\nimport { getKeyboardHeight } from '../keyboard';\nimport {\nimageGalleryKeyboardName,\n- imageGalleryBackgroundColor,\n} from '../media/image-gallery-keyboard.react';\nimport { ChatInputStateContext } from './chat-input-state';\nimport { colorsSelector, styleSelector } from '../themes/colors';\n@@ -123,9 +122,6 @@ class ChatInputBar extends React.PureComponent<Props, State> {\njoinThread: PropTypes.func.isRequired,\n};\nstatic contextType = ChatInputStateContext;\n- static kbInitialProps = {\n- backgroundColor: imageGalleryBackgroundColor,\n- };\ntextInput: ?TextInput;\ncameraRollOpacity: Animated.Value;\nexpandOpacity: Animated.Value;\n@@ -367,7 +363,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n<KeyboardAccessoryView\nkbInputRef={this.textInput}\nkbComponent={kbComponent}\n- kbInitialProps={ChatInputBar.kbInitialProps}\n+ kbInitialProps={this.props.styles.kbInitialProps}\nonItemSelected={this.onImageGalleryItemSelected}\nonKeyboardResigned={this.hideCustomKeyboard}\nmanageScrollView={false}\n@@ -604,6 +600,9 @@ const styles = {\njoinThreadLoadingIndicator: {\npaddingVertical: 2,\n},\n+ kbInitialProps: {\n+ backgroundColor: 'listBackground',\n+ },\n};\nconst stylesSelector = styleSelector(styles);\n" }, { "change_type": "MODIFY", "old_path": "native/media/image-gallery-keyboard.react.js", "new_path": "native/media/image-gallery-keyboard.react.js", "diff": "@@ -4,13 +4,13 @@ import type { GalleryImageInfo } from './image-gallery-image.react';\nimport type { AppState } from '../redux/redux-setup';\nimport { type Dimensions, dimensionsPropType } from 'lib/types/media-types';\nimport type { ViewToken } from 'react-native/Libraries/Lists/ViewabilityHelper';\n-import type { ViewStyle } from '../types/styles';\n+import type { ViewStyle, Styles } from '../types/styles';\n+import { type Colors, colorsPropType } from '../themes/colors';\nimport * as React from 'react';\nimport {\nView,\nText,\n- StyleSheet,\nPlatform,\nPermissionsAndroid,\nFlatList,\n@@ -34,6 +34,7 @@ import {\n} from '../selectors/dimension-selectors';\nimport ImageGalleryImage from './image-gallery-image.react';\nimport Animated, { Easing } from 'react-native-reanimated';\n+import { colorsSelector, styleSelector } from '../themes/colors';\nconst animationSpec = {\nduration: 400,\n@@ -44,6 +45,8 @@ type Props = {|\n// Redux state\nscreenDimensions: Dimensions,\nforeground: bool,\n+ colors: Colors,\n+ styles: Styles,\n|};\ntype State = {|\nimageInfos: ?$ReadOnlyArray<GalleryImageInfo>,\n@@ -60,6 +63,8 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\nstatic propTypes = {\nscreenDimensions: dimensionsPropType.isRequired,\nforeground: PropTypes.bool.isRequired,\n+ colors: colorsPropType.isRequired,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\n};\nmounted = false;\nfetchingPhotos = false;\n@@ -80,7 +85,7 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\n},\n);\nthis.sendButtonStyle = {\n- ...styles.sendButton,\n+ ...props.styles.sendButton,\nopacity: this.queueModeProgress,\ntransform: [\n{ scale: sendButtonScale },\n@@ -324,8 +329,8 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\n);\n}\n- static renderItemSeparator() {\n- return <View style={styles.separator} />;\n+ ItemSeparator = () => {\n+ return <View style={this.props.styles.separator} />;\n}\nstatic keyExtractor(item: GalleryImageInfo) {\n@@ -341,7 +346,7 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\nhorizontal={true}\ndata={imageInfos}\nrenderItem={this.renderItem}\n- ItemSeparatorComponent={ImageGalleryKeyboard.renderItemSeparator}\n+ ItemSeparatorComponent={this.ItemSeparator}\nkeyExtractor={ImageGalleryKeyboard.keyExtractor}\nscrollsToTop={false}\nshowsHorizontalScrollIndicator={false}\n@@ -353,15 +358,19 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\n/>\n);\n} else if (imageInfos && containerHeight) {\n- content = <Text style={styles.error}>no media was found!</Text>;\n+ content = (\n+ <Text style={this.props.styles.error}>\n+ no media was found!\n+ </Text>\n+ );\n} else if (error) {\n- content = <Text style={styles.error}>{error}</Text>;\n+ content = <Text style={this.props.styles.error}>{error}</Text>;\n} else {\ncontent = (\n<ActivityIndicator\n- color=\"black\"\n+ color={this.props.colors.listSeparatorLabel}\nsize=\"large\"\n- style={styles.loadingIndicator}\n+ style={this.props.styles.loadingIndicator}\n/>\n);\n}\n@@ -369,17 +378,20 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\nconst { queuedImageURIs } = this.state;\nconst queueCount = queuedImageURIs ? queuedImageURIs.size : 0;\nreturn (\n- <View style={styles.container} onLayout={this.onContainerLayout}>\n+ <View\n+ style={this.props.styles.container}\n+ onLayout={this.onContainerLayout}\n+ >\n{content}\n<TouchableOpacity\nonPress={this.sendQueuedImages}\nactiveOpacity={0.6}\n- style={styles.sendButtonContainer}\n+ style={this.props.styles.sendButtonContainer}\n>\n<Animated.View style={this.sendButtonStyle}>\n- <Icon name=\"send\" style={styles.sendIcon} />\n- <View style={styles.queueCountBubble}>\n- <Text style={styles.queueCountText}>\n+ <Icon name=\"send\" style={this.props.styles.sendIcon} />\n+ <View style={this.props.styles.queueCountBubble}>\n+ <Text style={this.props.styles.queueCountText}>\n{queueCount}\n</Text>\n</View>\n@@ -485,16 +497,15 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\n}\nconst imageGalleryKeyboardName = 'ImageGalleryKeyboard';\n-const imageGalleryBackgroundColor = '#EEEEEE';\n-const styles = StyleSheet.create({\n+const styles = {\ncontainer: {\nposition: 'absolute',\ntop: 0,\nbottom: -contentBottomOffset,\nleft: 0,\nright: 0,\n- backgroundColor: imageGalleryBackgroundColor,\n+ backgroundColor: 'listBackground',\nflexDirection: 'row',\nalignItems: 'center',\n},\n@@ -503,6 +514,7 @@ const styles = StyleSheet.create({\nfontSize: 28,\ntextAlign: 'center',\nmarginBottom: contentBottomOffset,\n+ color: 'listBackgroundLabel',\n},\nseparator: {\nwidth: 2,\n@@ -547,12 +559,15 @@ const styles = StyleSheet.create({\ntextAlign: 'center',\ncolor: 'white',\n},\n-});\n+};\n+const stylesSelector = styleSelector(styles);\nconst ReduxConnectedImageGalleryKeyboard = connect(\n(state: AppState) => ({\nscreenDimensions: dimensionsSelector(state),\nforeground: state.foreground,\n+ colors: colorsSelector(state),\n+ styles: stylesSelector(state),\n}),\n)(ImageGalleryKeyboard);\n@@ -571,5 +586,4 @@ KeyboardRegistry.registerKeyboard(\nexport {\nimageGalleryKeyboardName,\n- imageGalleryBackgroundColor,\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Dark mode for ImageGalleryKeyboard
129,187
27.10.2019 22:23:47
14,400
3b594e70713c84333d066c3cf31cc1460f90466a
[native] Dark mode for ComposeSubthreadModal
[ { "change_type": "MODIFY", "old_path": "native/chat/settings/compose-subthread-modal.react.js", "new_path": "native/chat/settings/compose-subthread-modal.react.js", "diff": "@@ -9,14 +9,18 @@ import type {\nNavigationScreenProp,\nNavigationLeafRoute,\n} from 'react-navigation';\n+import type { AppState } from '../../redux/redux-setup';\n+import { type Colors, colorsPropType } from '../../themes/colors';\n+import type { Styles } from '../../types/styles';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n-import { StyleSheet, Text } from 'react-native';\n+import { Text } from 'react-native';\nimport Icon from 'react-native-vector-icons/MaterialIcons';\nimport IonIcon from 'react-native-vector-icons/Ionicons';\nimport { threadTypeDescriptions } from 'lib/shared/thread-utils';\n+import { connect } from 'lib/utils/redux-utils';\nimport Button from '../../components/button.react';\nimport {\n@@ -24,6 +28,7 @@ import {\nComposeThreadRouteName,\n} from '../../navigation/route-names';\nimport { createModal } from '../../components/modal.react';\n+import { colorsSelector, styleSelector } from '../../themes/colors';\nconst Modal = createModal(ComposeSubthreadModalRouteName);\ntype NavProp = NavigationScreenProp<{|\n@@ -35,6 +40,9 @@ type NavProp = NavigationScreenProp<{|\ntype Props = {|\nnavigation: NavProp,\n+ // Redux state\n+ colors: Colors,\n+ styles: Styles,\n|};\nclass ComposeSubthreadModal extends React.PureComponent<Props> {\n@@ -47,39 +55,47 @@ class ComposeSubthreadModal extends React.PureComponent<Props> {\n}).isRequired,\nnavigate: PropTypes.func.isRequired,\n}).isRequired,\n+ colors: colorsPropType.isRequired,\n+ styles: PropTypes.objectOf(PropTypes.object).isRequired,\n};\nrender() {\nreturn (\n<Modal\nnavigation={this.props.navigation}\n- modalStyle={styles.modal}\n+ modalStyle={this.props.styles.modal}\n>\n- <Text style={styles.visibility}>Thread type</Text>\n- <Button style={styles.option} onPress={this.onPressOpen}>\n- <Icon name=\"public\" size={32} color=\"black\" />\n- <Text style={styles.optionText}>Open</Text>\n- <Text style={styles.optionExplanation}>\n+ <Text style={this.props.styles.visibility}>Thread type</Text>\n+ <Button style={this.props.styles.option} onPress={this.onPressOpen}>\n+ <Icon\n+ name=\"public\"\n+ size={32}\n+ style={this.props.styles.visibilityIcon}\n+ />\n+ <Text style={this.props.styles.optionText}>Open</Text>\n+ <Text style={this.props.styles.optionExplanation}>\n{threadTypeDescriptions[threadTypes.CHAT_NESTED_OPEN]}\n</Text>\n<IonIcon\nname=\"ios-arrow-forward\"\nsize={20}\n- color=\"#036AFF\"\n- style={styles.forwardIcon}\n+ style={this.props.styles.forwardIcon}\n/>\n</Button>\n- <Button style={styles.option} onPress={this.onPressSecret}>\n- <Icon name=\"lock-outline\" size={32} color=\"black\" />\n- <Text style={styles.optionText}>Secret</Text>\n- <Text style={styles.optionExplanation}>\n+ <Button style={this.props.styles.option} onPress={this.onPressSecret}>\n+ <Icon\n+ name=\"lock-outline\"\n+ size={32}\n+ style={this.props.styles.visibilityIcon}\n+ />\n+ <Text style={this.props.styles.optionText}>Secret</Text>\n+ <Text style={this.props.styles.optionExplanation}>\n{threadTypeDescriptions[threadTypes.CHAT_SECRET]}\n</Text>\n<IonIcon\nname=\"ios-arrow-forward\"\nsize={20}\n- color=\"#036AFF\"\n- style={styles.forwardIcon}\n+ style={this.props.styles.forwardIcon}\n/>\n</Button>\n</Modal>\n@@ -113,14 +129,14 @@ class ComposeSubthreadModal extends React.PureComponent<Props> {\n}\n-const styles = StyleSheet.create({\n+const styles = {\nmodal: {\nflex: 0,\n},\nvisibility: {\nfontSize: 24,\ntextAlign: 'center',\n- color: \"black\",\n+ color: 'modalBackgroundLabel',\n},\noption: {\nflexDirection: 'row',\n@@ -131,18 +147,27 @@ const styles = StyleSheet.create({\noptionText: {\nfontSize: 20,\npaddingLeft: 5,\n- color: \"black\",\n+ color: 'modalBackgroundLabel',\n},\noptionExplanation: {\nflex: 1,\nfontSize: 14,\n- paddingLeft: 10,\n+ paddingLeft: 20,\ntextAlign: 'center',\n- color: \"black\",\n+ color: 'modalBackgroundLabel',\n},\nforwardIcon: {\npaddingLeft: 10,\n+ color: 'link',\n},\n-});\n+ visibilityIcon: {\n+ color: 'modalBackgroundLabel',\n+ paddingRight: 3,\n+ },\n+};\n+const stylesSelector = styleSelector(styles);\n-export default ComposeSubthreadModal;\n+export default connect((state: AppState) => ({\n+ colors: colorsSelector(state),\n+ styles: stylesSelector(state),\n+}))(ComposeSubthreadModal);\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/tooltip.react.js", "new_path": "native/navigation/tooltip.react.js", "diff": "@@ -509,6 +509,7 @@ const styles = StyleSheet.create({\nborderTopColor: 'transparent',\nborderRightColor: 'transparent',\nborderLeftColor: 'transparent',\n+ bottom: Platform.OS === \"android\" ? -1 : 0,\n},\n});\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Dark mode for ComposeSubthreadModal
129,187
27.10.2019 23:35:54
14,400
f99a3561fca3f3bdb01563f6df21f73947b9c60a
[native] Clean up chat message focus animation
[ { "change_type": "MODIFY", "old_path": "native/chat/composed-message.react.js", "new_path": "native/chat/composed-message.react.js", "diff": "@@ -82,7 +82,7 @@ class ComposedMessage extends React.PureComponent<Props> {\nreturn (\n<View {...viewProps}>\n- <MessageHeader item={item} focused={focused} contrast=\"low\" />\n+ <MessageHeader item={item} focused={focused} display=\"lowContrast\" />\n<View style={containerStyle}>\n<View style={[ styles.content, alignStyle ]}>\n<View style={[ styles.messageBox, messageBoxStyle, alignStyle ]}>\n" }, { "change_type": "MODIFY", "old_path": "native/chat/message-header.react.js", "new_path": "native/chat/message-header.react.js", "diff": "import type { ChatMessageInfoItemWithHeight } from './message.react';\nimport type { AppState } from '../redux/redux-setup';\nimport type { Styles } from '../types/styles';\n+import type { DisplayType } from './timestamp.react';\nimport * as React from 'react';\nimport { View, Text } from 'react-native';\n@@ -10,26 +11,28 @@ import { View, Text } from 'react-native';\nimport { stringForUser } from 'lib/shared/user-utils';\nimport { connect } from 'lib/utils/redux-utils';\n-import Timestamp from './timestamp.react';\n+import { Timestamp, timestampHeight } from './timestamp.react';\nimport { styleSelector } from '../themes/colors';\ntype Props = {|\nitem: ChatMessageInfoItemWithHeight,\nfocused: bool,\n- contrast: 'high' | 'low',\n+ display: DisplayType,\n// Redux state\nstyles: Styles,\n|};\nfunction MessageHeader(props: Props) {\n- const { item, focused, contrast } = props;\n+ const { item, focused, display } = props;\nconst { creator, time } = item.messageInfo;\nconst { isViewer } = creator;\n+ const modalDisplay = display === 'modal';\nlet authorName = null;\n- if (!isViewer && (item.startsCluster || focused)) {\n- const style = contrast === 'high' || !item.startsCluster\n- ? [ props.styles.authorName, props.styles.highContrast ]\n- : [ props.styles.authorName, props.styles.lowContrast ];\n+ if (!isViewer && (modalDisplay || item.startsCluster)) {\n+ const style = [ props.styles.authorName ];\n+ if (modalDisplay) {\n+ style.push(props.styles.modal);\n+ }\nauthorName = (\n<Text style={style} numberOfLines={1}>\n{stringForUser(creator)}\n@@ -37,18 +40,23 @@ function MessageHeader(props: Props) {\n);\n}\n- const timestampContrast = contrast === 'high' || !item.startsConversation\n- ? 'high'\n- : 'low';\n- const timestamp = focused || item.startsConversation\n- ? <Timestamp time={time} contrast={timestampContrast} />\n+ const timestamp = modalDisplay || item.startsConversation\n+ ? <Timestamp time={time} display={display} />\n: null;\n- if (!timestamp && !authorName) {\n- return null;\n+\n+ let topMargin = 0;\n+ if (!item.startsCluster) {\n+ topMargin += 7;\n+ }\n+ if (focused && !modalDisplay && !item.startsCluster) {\n+ topMargin += authorNameHeight;\n+ }\n+ if (focused && !modalDisplay && !item.startsConversation) {\n+ topMargin += timestampHeight;\n}\n- const style = !item.startsCluster\n- ? props.styles.clusterMargin\n+ const style = topMargin\n+ ? { marginTop: topMargin }\n: null;\nreturn (\n<View style={style}>\n@@ -58,22 +66,20 @@ function MessageHeader(props: Props) {\n);\n}\n+const authorNameHeight = 25;\n+\nconst styles = {\n- clusterMargin: {\n- marginTop: 7,\n- },\nauthorName: {\nfontSize: 14,\nmarginLeft: 12,\nmarginRight: 7,\npaddingHorizontal: 12,\npaddingVertical: 4,\n- height: 25,\n- },\n- lowContrast: {\n+ height: authorNameHeight,\ncolor: 'listBackgroundSecondaryLabel',\n+ bottom: 0,\n},\n- highContrast: {\n+ modal: {\n// high contrast framed against LightboxNavigator-dimmed background\ncolor: 'white',\n},\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-tooltip-button.react.js", "new_path": "native/chat/multimedia-tooltip-button.react.js", "diff": "@@ -123,7 +123,7 @@ class MultimediaTooltipButton extends React.PureComponent<Props> {\nreturn (\n<React.Fragment>\n<Animated.View style={this.headerStyle}>\n- <MessageHeader item={item} focused={true} contrast=\"high\" />\n+ <MessageHeader item={item} focused={true} display=\"modal\" />\n</Animated.View>\n<View style={[ styles.media, roundedStyle ]}>\n<InlineMultimedia\n" }, { "change_type": "MODIFY", "old_path": "native/chat/robotext-message.react.js", "new_path": "native/chat/robotext-message.react.js", "diff": "@@ -29,7 +29,7 @@ import { threadInfoSelector } from 'lib/selectors/thread-selectors';\nimport { connect } from 'lib/utils/redux-utils';\nimport { MessageListRouteName } from '../navigation/route-names';\n-import Timestamp from './timestamp.react';\n+import { Timestamp } from './timestamp.react';\nimport { styleSelector } from '../themes/colors';\nexport type ChatRobotextMessageInfoItemWithHeight = {|\n@@ -82,7 +82,7 @@ class RobotextMessage extends React.PureComponent<Props> {\nlet timestamp = null;\nif (focused || item.startsConversation) {\ntimestamp = (\n- <Timestamp time={item.messageInfo.time} contrast=\"low\" />\n+ <Timestamp time={item.messageInfo.time} display=\"lowContrast\" />\n);\n}\nreturn (\n" }, { "change_type": "MODIFY", "old_path": "native/chat/text-message-tooltip-button.react.js", "new_path": "native/chat/text-message-tooltip-button.react.js", "diff": "@@ -94,7 +94,7 @@ class TextMessageTooltipButton extends React.PureComponent<Props> {\nreturn (\n<React.Fragment>\n<Animated.View style={this.headerStyle}>\n- <MessageHeader item={item} focused={true} contrast=\"high\" />\n+ <MessageHeader item={item} focused={true} display=\"modal\" />\n</Animated.View>\n<InnerTextMessage\nitem={item}\n" }, { "change_type": "MODIFY", "old_path": "native/chat/timestamp.react.js", "new_path": "native/chat/timestamp.react.js", "diff": "@@ -11,16 +11,19 @@ import { connect } from 'lib/utils/redux-utils';\nimport { styleSelector } from '../themes/colors';\n+export type DisplayType = 'lowContrast' | 'modal';\n+\ntype Props = {|\ntime: number,\n- contrast: 'high' | 'low',\n+ display: DisplayType,\n// Redux state\nstyles: Styles,\n|};\nfunction Timestamp(props: Props) {\n- const style = props.contrast === 'high'\n- ? [ props.styles.timestamp, props.styles.highContrast ]\n- : [ props.styles.timestamp, props.styles.lowContrast ];\n+ const style = [ props.styles.timestamp ];\n+ if (props.display === 'modal') {\n+ style.push(props.styles.modal);\n+ }\nreturn (\n<Text style={style} numberOfLines={1}>\n{longAbsoluteDate(props.time).toUpperCase()}\n@@ -28,23 +31,29 @@ function Timestamp(props: Props) {\n);\n}\n+const timestampHeight = 26;\n+\nconst styles = {\ntimestamp: {\nfontSize: 14,\npaddingVertical: 3,\nalignSelf: 'center',\n- height: 26,\n- },\n- lowContrast: {\n+ height: timestampHeight,\ncolor: 'listBackgroundTernaryLabel',\n+ bottom: 0,\n},\n- highContrast: {\n+ modal: {\n// high contrast framed against LightboxNavigator-dimmed background\ncolor: 'white',\n},\n};\nconst stylesSelector = styleSelector(styles);\n-export default connect((state: AppState) => ({\n+const WrappedTimestamp = connect((state: AppState) => ({\nstyles: stylesSelector(state),\n}))(Timestamp);\n+\n+export {\n+ WrappedTimestamp as Timestamp,\n+ timestampHeight,\n+};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Clean up chat message focus animation
129,187
27.10.2019 23:53:38
14,400
bdc6fc081da7b060f16c2943e76e8c744fb6c804
[native] Dark mode for OnePasswordButton
[ { "change_type": "MODIFY", "old_path": "native/account/panel-components.react.js", "new_path": "native/account/panel-components.react.js", "diff": "@@ -82,6 +82,7 @@ function PanelOnePasswordButton(props: {| onPress: () => Promise<void> |}) {\nreturn (\n<OnePasswordButton\nonPress={props.onPress}\n+ theme=\"light\"\nstyle={styles.onePasswordImage}\n/>\n);\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/delete-thread.react.js", "new_path": "native/chat/settings/delete-thread.react.js", "diff": "@@ -10,10 +10,11 @@ import {\nthreadInfoPropType,\ntype LeaveThreadPayload,\n} from 'lib/types/thread-types';\n+import { type GlobalTheme, globalThemePropType } from '../../types/themes';\nimport type { Styles } from '../../types/styles';\nimport { type Colors, colorsPropType } from '../../themes/colors';\n-import React from 'react';\n+import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport {\nText,\n@@ -49,6 +50,7 @@ type Props = {|\n// Redux state\nthreadInfo: ?ThreadInfo,\nloadingStatus: LoadingStatus,\n+ activeTheme: ?GlobalTheme,\ncolors: Colors,\nstyles: Styles,\n// Redux dispatch functions\n@@ -77,6 +79,7 @@ class InnerDeleteThread extends React.PureComponent<Props, State> {\n}).isRequired,\nthreadInfo: threadInfoPropType,\nloadingStatus: loadingStatusPropType.isRequired,\n+ activeTheme: globalThemePropType,\ncolors: colorsPropType.isRequired,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\ndispatchActionPromise: PropTypes.func.isRequired,\n@@ -137,9 +140,11 @@ class InnerDeleteThread extends React.PureComponent<Props, State> {\nrender() {\nlet onePasswordButton = null;\nif (this.state.onePasswordSupported) {\n+ const theme = this.props.activeTheme ? this.props.activeTheme : 'light';\nonePasswordButton = (\n<OnePasswordButton\nonPress={this.onPressOnePassword}\n+ theme={theme}\nstyle={this.props.styles.onePasswordButton}\n/>\n);\n@@ -323,6 +328,7 @@ const DeleteThread = connect(\nreturn {\nthreadInfo: threadInfoSelector(state)[threadID],\nloadingStatus: loadingStatusSelector(state),\n+ activeTheme: state.globalThemeInfo.activeTheme,\ncolors: colorsSelector(state),\nstyles: stylesSelector(state),\n};\n" }, { "change_type": "MODIFY", "old_path": "native/components/one-password-button.react.js", "new_path": "native/components/one-password-button.react.js", "diff": "// @flow\nimport type { ImageStyle } from '../types/styles';\n+import type { GlobalTheme } from '../types/themes';\nimport * as React from 'react';\nimport { TouchableWithoutFeedback, Image, StyleSheet } from 'react-native';\ntype Props = {|\nonPress: () => Promise<void>,\n+ theme: GlobalTheme,\nstyle?: ImageStyle,\n|};\nfunction OnePasswordButton(props: Props) {\n+ let source;\n+ if (props.theme === 'dark') {\n+ source = require('../img/onepassword-light.png');\n+ } else {\n+ source = require('../img/onepassword-dark.png');\n+ }\nreturn (\n<TouchableWithoutFeedback onPress={props.onPress}>\n<Image\n- source={require(\"../img/onepassword.png\")}\n+ source={source}\nstyle={[ styles.image, props.style ]}\n/>\n</TouchableWithoutFeedback>\n" }, { "change_type": "RENAME", "old_path": "native/img/onepassword@2x.png", "new_path": "native/img/onepassword-dark@2x.png", "diff": "" }, { "change_type": "RENAME", "old_path": "native/img/onepassword@3x.png", "new_path": "native/img/onepassword-dark@3x.png", "diff": "" }, { "change_type": "ADD", "old_path": "native/img/onepassword-light@2x.png", "new_path": "native/img/onepassword-light@2x.png", "diff": "Binary files /dev/null and b/native/img/onepassword-light@2x.png differ\n" }, { "change_type": "ADD", "old_path": "native/img/onepassword-light@3x.png", "new_path": "native/img/onepassword-light@3x.png", "diff": "Binary files /dev/null and b/native/img/onepassword-light@3x.png differ\n" }, { "change_type": "MODIFY", "old_path": "native/more/delete-account.react.js", "new_path": "native/more/delete-account.react.js", "diff": "@@ -6,6 +6,7 @@ import type { NavigationScreenProp } from 'react-navigation';\nimport type { LoadingStatus } from 'lib/types/loading-types';\nimport { loadingStatusPropType } from 'lib/types/loading-types';\nimport type { LogOutResult } from 'lib/types/account-types';\n+import { type GlobalTheme, globalThemePropType } from '../types/themes';\nimport type { Styles } from '../types/styles';\nimport * as React from 'react';\n@@ -39,6 +40,7 @@ type Props = {|\n// Redux state\nloadingStatus: LoadingStatus,\nusername: ?string,\n+ activeTheme: ?GlobalTheme,\nstyles: Styles,\n// Redux dispatch functions\ndispatchActionPromise: DispatchActionPromise,\n@@ -57,6 +59,7 @@ class DeleteAccount extends React.PureComponent<Props, State> {\n}).isRequired,\nloadingStatus: loadingStatusPropType.isRequired,\nusername: PropTypes.string,\n+ activeTheme: globalThemePropType,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\ndispatchActionPromise: PropTypes.func.isRequired,\ndeleteAccount: PropTypes.func.isRequired,\n@@ -99,9 +102,11 @@ class DeleteAccount extends React.PureComponent<Props, State> {\nrender() {\nlet onePasswordButton = null;\nif (this.state.onePasswordSupported) {\n+ const theme = this.props.activeTheme ? this.props.activeTheme : 'light';\nonePasswordButton = (\n<OnePasswordButton\nonPress={this.onPressOnePassword}\n+ theme={theme}\nstyle={this.props.styles.onePasswordButton}\n/>\n);\n@@ -291,6 +296,7 @@ export default connect(\nusername: state.currentUserInfo && !state.currentUserInfo.anonymous\n? state.currentUserInfo.username\n: undefined,\n+ activeTheme: state.globalThemeInfo.activeTheme,\nstyles: stylesSelector(state),\n}),\n{ deleteAccount },\n" }, { "change_type": "MODIFY", "old_path": "native/more/edit-email.react.js", "new_path": "native/more/edit-email.react.js", "diff": "@@ -7,6 +7,7 @@ import type { LoadingStatus } from 'lib/types/loading-types';\nimport { loadingStatusPropType } from 'lib/types/loading-types';\nimport type { AccountUpdate } from 'lib/types/user-types';\nimport type { ChangeUserSettingsResult } from 'lib/types/account-types';\n+import { type GlobalTheme, globalThemePropType } from '../types/themes';\nimport type { Styles } from '../types/styles';\nimport * as React from 'react';\n@@ -40,6 +41,7 @@ type Props = {|\n// Redux state\nemail: ?string,\nloadingStatus: LoadingStatus,\n+ activeTheme: ?GlobalTheme,\nstyles: Styles,\n// Redux dispatch functions\ndispatchActionPromise: DispatchActionPromise,\n@@ -61,6 +63,7 @@ class EditEmail extends React.PureComponent<Props, State> {\n}).isRequired,\nemail: PropTypes.string,\nloadingStatus: loadingStatusPropType.isRequired,\n+ activeTheme: globalThemePropType,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\ndispatchActionPromise: PropTypes.func.isRequired,\nchangeUserSettings: PropTypes.func.isRequired,\n@@ -105,9 +108,11 @@ class EditEmail extends React.PureComponent<Props, State> {\nrender() {\nlet onePasswordButton = null;\nif (this.state.onePasswordSupported) {\n+ const theme = this.props.activeTheme ? this.props.activeTheme : 'light';\nonePasswordButton = (\n<OnePasswordButton\nonPress={this.onPressOnePassword}\n+ theme={theme}\nstyle={this.props.styles.onePasswordButton}\n/>\n);\n@@ -356,6 +361,7 @@ export default connect(\n? state.currentUserInfo.email\n: undefined,\nloadingStatus: loadingStatusSelector(state),\n+ activeTheme: state.globalThemeInfo.activeTheme,\nstyles: stylesSelector(state),\n}),\n{ changeUserSettings },\n" }, { "change_type": "MODIFY", "old_path": "native/more/edit-password.react.js", "new_path": "native/more/edit-password.react.js", "diff": "@@ -7,6 +7,7 @@ import type { LoadingStatus } from 'lib/types/loading-types';\nimport { loadingStatusPropType } from 'lib/types/loading-types';\nimport type { AccountUpdate } from 'lib/types/user-types';\nimport type { ChangeUserSettingsResult } from 'lib/types/account-types';\n+import { type GlobalTheme, globalThemePropType } from '../types/themes';\nimport type { Styles } from '../types/styles';\nimport * as React from 'react';\n@@ -39,6 +40,7 @@ type Props = {\nnavigation: NavigationScreenProp<*>,\n// Redux state\nloadingStatus: LoadingStatus,\n+ activeTheme: ?GlobalTheme,\nstyles: Styles,\n// Redux dispatch functions\ndispatchActionPromise: DispatchActionPromise,\n@@ -60,6 +62,7 @@ class EditPassword extends React.PureComponent<Props, State> {\nnavigate: PropTypes.func.isRequired,\n}).isRequired,\nloadingStatus: loadingStatusPropType.isRequired,\n+ activeTheme: globalThemePropType,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\ndispatchActionPromise: PropTypes.func.isRequired,\nchangeUserSettings: PropTypes.func.isRequired,\n@@ -107,15 +110,18 @@ class EditPassword extends React.PureComponent<Props, State> {\nlet onePasswordCurrentPasswordButton = null;\nlet onePasswordNewPasswordButton = null;\nif (this.state.onePasswordSupported) {\n+ const theme = this.props.activeTheme ? this.props.activeTheme : 'light';\nonePasswordCurrentPasswordButton = (\n<OnePasswordButton\nonPress={this.onPressOnePasswordCurrentPassword}\n+ theme={theme}\nstyle={this.props.styles.onePasswordButton}\n/>\n);\nonePasswordNewPasswordButton = (\n<OnePasswordButton\nonPress={this.onPressOnePasswordNewPassword}\n+ theme={theme}\nstyle={this.props.styles.onePasswordButton}\n/>\n);\n@@ -420,6 +426,7 @@ const loadingStatusSelector = createLoadingStatusSelector(\nexport default connect(\n(state: AppState) => ({\nloadingStatus: loadingStatusSelector(state),\n+ activeTheme: state.globalThemeInfo.activeTheme,\nstyles: stylesSelector(state),\n}),\n{ changeUserSettings },\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Dark mode for OnePasswordButton
129,187
27.10.2019 23:59:28
14,400
cba17c2222139e2e4330c226a2a0f32aca3c356d
[native] codeVersion -> 39
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -131,8 +131,8 @@ android {\napplicationId \"org.squadcal\"\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 38\n- versionName \"0.0.38\"\n+ versionCode 39\n+ versionName \"0.0.39\"\n}\nsplits {\nabi {\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal/Info.debug.plist", "new_path": "native/ios/SquadCal/Info.debug.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.38</string>\n+ <string>0.0.39</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>38</string>\n+ <string>39</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal/Info.release.plist", "new_path": "native/ios/SquadCal/Info.release.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.38</string>\n+ <string>0.0.39</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>38</string>\n+ <string>39</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/redux/persist.js", "new_path": "native/redux/persist.js", "diff": "@@ -148,7 +148,7 @@ const persistConfig = {\ntimeout: __DEV__ ? 0 : undefined,\n};\n-const codeVersion = 38;\n+const codeVersion = 39;\n// This local exists to avoid a circular dependency where redux-setup needs to\n// import all the navigation and screen stuff, but some of those screens want to\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] codeVersion -> 39
129,187
28.10.2019 17:25:10
14,400
8d19b534a62d748f5db01d9801d125bc73705e46
[native] Save button in MultimediaModal
[ { "change_type": "MODIFY", "old_path": "native/utils/animation-utils.js", "new_path": "native/utils/animation-utils.js", "diff": "@@ -7,6 +7,9 @@ const {\nClock,\ncond,\ngreaterThan,\n+ eq,\n+ sub,\n+ set,\n} = Animated;\nfunction clamp(value: Value, minValue: Value, maxValue: Value): Value {\n@@ -21,6 +24,24 @@ function clamp(value: Value, minValue: Value, maxValue: Value): Value {\n);\n}\n+function delta(value: Value) {\n+ const prevValue = new Value(0);\n+ const deltaValue = new Value(0);\n+ return [\n+ set(\n+ deltaValue,\n+ cond(\n+ eq(prevValue, 0),\n+ 0,\n+ sub(value, prevValue),\n+ ),\n+ ),\n+ set(prevValue, value),\n+ deltaValue,\n+ ];\n+}\n+\nexport {\nclamp,\n+ delta,\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Save button in MultimediaModal
129,187
29.10.2019 19:08:05
14,400
64dff933f0952ed06eda7738d2fcf716b41062bf
[native] Use dark mode ActionResultModal against MultimediaModal
[ { "change_type": "MODIFY", "old_path": "native/navigation/action-result-modal.react.js", "new_path": "native/navigation/action-result-modal.react.js", "diff": "@@ -16,7 +16,7 @@ import Animated from 'react-native-reanimated';\nimport { connect } from 'lib/utils/redux-utils';\nimport { contentBottomOffset } from '../selectors/dimension-selectors';\n-import { styleSelector } from '../themes/colors';\n+import { overlayStyleSelector } from '../themes/colors';\nconst {\nValue,\n@@ -125,7 +125,7 @@ const styles = {\ncolor: 'modalContrastForegroundLabel',\n},\n};\n-const stylesSelector = styleSelector(styles);\n+const stylesSelector = overlayStyleSelector(styles);\nexport default connect((state: AppState) => ({\nstyles: stylesSelector(state),\n" }, { "change_type": "MODIFY", "old_path": "native/selectors/nav-selectors.js", "new_path": "native/selectors/nav-selectors.js", "diff": "@@ -4,6 +4,7 @@ import type { AppState } from '../redux/redux-setup';\nimport type { NavigationState } from 'react-navigation';\nimport type { CalendarFilter } from 'lib/types/filter-types';\nimport type { CalendarQuery } from 'lib/types/entry-types';\n+import type { GlobalTheme } from '../types/themes';\nimport { createSelector } from 'reselect';\nimport invariant from 'invariant';\n@@ -22,6 +23,7 @@ import {\nChatRouteName,\nCalendarRouteName,\nThreadPickerModalRouteName,\n+ ActionResultModalRouteName,\naccountModals,\nscrollBlockingChatModals,\n} from '../navigation/route-names';\n@@ -87,6 +89,29 @@ const scrollBlockingChatModalsClosedSelector: (\n},\n);\n+const backgroundIsDarkSelector: (state: AppState) => bool = createSelector(\n+ (state: AppState) => state.navInfo.navigationState,\n+ (state: AppState) => state.globalThemeInfo.activeTheme,\n+ (navigationState: NavigationState, theme: ?GlobalTheme) => {\n+ const currentRootSubroute = navigationState.routes[navigationState.index];\n+ if (currentRootSubroute.routeName !== AppRouteName) {\n+ // Very bright... we'll call it non-dark. Doesn't matter right now since\n+ // we only use this selector for determining ActionResultModal appearance\n+ return false;\n+ }\n+ const appRoute = assertNavigationRouteNotLeafNode(currentRootSubroute);\n+ let currentAppSubroute = appRoute.routes[appRoute.index];\n+ if (currentAppSubroute.routeName === ActionResultModalRouteName) {\n+ currentAppSubroute = appRoute.routes[appRoute.index - 1];\n+ }\n+ if (scrollBlockingChatModals.includes(currentAppSubroute.routeName)) {\n+ // All the scroll-blocking chat modals have a dark background\n+ return true;\n+ }\n+ return theme === 'dark';\n+ },\n+);\n+\nconst lightboxTransitioningSelector: (state: AppState) => bool = createSelector(\n(state: AppState) => state.navInfo.navigationState,\n(navigationState: NavigationState) => {\n@@ -197,6 +222,7 @@ export {\nforegroundKeySelector,\ncreateActiveTabSelector,\nscrollBlockingChatModalsClosedSelector,\n+ backgroundIsDarkSelector,\nlightboxTransitioningSelector,\nactiveThreadSelector,\nappCanRespondToBackButtonSelector,\n" }, { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -8,6 +8,8 @@ import { StyleSheet } from 'react-native';\nimport { createSelector } from 'reselect';\nimport PropTypes from 'prop-types';\n+import { backgroundIsDarkSelector } from '../selectors/nav-selectors';\n+\nconst light = Object.freeze({\nredButton: '#BB8888',\ngreenButton: '#88BB88',\n@@ -126,6 +128,14 @@ const colorsSelector: (state: AppState) => Colors = createSelector(\n},\n);\n+const overlayColorsSelector: (state: AppState) => Colors = createSelector(\n+ backgroundIsDarkSelector,\n+ (backgroundIsDark: bool) => {\n+ const syntheticTheme = backgroundIsDark ? 'dark' : 'light';\n+ return colors[syntheticTheme];\n+ },\n+);\n+\nconst magicStrings = new Set();\nfor (let theme in colors) {\nfor (let magicString in colors[theme]) {\n@@ -136,13 +146,10 @@ for (let theme in colors) {\n// Distinct type needed here because we replace type of some fields with strings\ntype InStyles = { [name: string]: { [field: string]: number | string } };\n-function styleSelector<\n+function stylesFromColors<\nIS: InStyles,\n+OS: Styles,\n->(obj: IS): (state: AppState) => OS {\n- return createSelector(\n- colorsSelector,\n- (themeColors: Colors) => {\n+>(obj: IS, themeColors: Colors): OS {\nconst result = {};\nfor (let key in obj) {\nconst style = obj[key];\n@@ -159,7 +166,25 @@ function styleSelector<\nresult[key] = filledInStyle;\n}\nreturn StyleSheet.create(result);\n- },\n+}\n+\n+function styleSelector<\n+ IS: InStyles,\n+ +OS: Styles,\n+>(obj: IS): (state: AppState) => OS {\n+ return createSelector(\n+ colorsSelector,\n+ (themeColors: Colors) => stylesFromColors(obj, themeColors),\n+ );\n+}\n+\n+function overlayStyleSelector<\n+ IS: InStyles,\n+ +OS: Styles,\n+>(obj: IS): (state: AppState) => OS {\n+ return createSelector(\n+ overlayColorsSelector,\n+ (themeColors: Colors) => stylesFromColors(obj, themeColors),\n);\n}\n@@ -167,5 +192,7 @@ export {\ncolorsPropType,\ncolors,\ncolorsSelector,\n+ overlayColorsSelector,\nstyleSelector,\n+ overlayStyleSelector,\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use dark mode ActionResultModal against MultimediaModal
129,187
30.10.2019 00:56:31
14,400
45443f1b06da4b9e49e9bb5987665128197f3cfe
[native] Hide StatusBar in MultimediaModal
[ { "change_type": "MODIFY", "old_path": "native/media/multimedia-modal.react.js", "new_path": "native/media/multimedia-modal.react.js", "diff": "@@ -1153,7 +1153,7 @@ class MultimediaModal extends React.PureComponent<Props, State> {\nrender() {\nconst { mediaInfo } = this.props.navigation.state.params;\nconst statusBar = MultimediaModal.isActive(this.props)\n- ? <ConnectedStatusBar barStyle=\"light-content\" />\n+ ? <ConnectedStatusBar hidden />\n: null;\nconst backdropStyle = { opacity: this.backdropOpacity };\nconst closeButtonStyle = {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Hide StatusBar in MultimediaModal
129,187
30.10.2019 00:58:32
14,400
aa0585867ee8e23006404b7a2dd27163fc12896c
[native] Increase dark listBackgroundTernaryLabel contrast
[ { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -106,7 +106,7 @@ const dark: Colors = Object.freeze({\nlistBackground: '#1C1C1E',\nlistBackgroundLabel: '#C7C7CC',\nlistBackgroundSecondaryLabel: '#BBBBBB',\n- listBackgroundTernaryLabel: '#555555',\n+ listBackgroundTernaryLabel: '#888888',\nlistSeparator: '#3A3A3C',\nlistSeparatorLabel: '#EEEEEE',\nlistInputBar: '#555555',\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Increase dark listBackgroundTernaryLabel contrast
129,187
01.11.2019 00:13:03
14,400
12f7bc423b6f7b31b33a048db2c4ce1afe217786
[native] Android multidex support
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -133,6 +133,7 @@ android {\ntargetSdkVersion rootProject.ext.targetSdkVersion\nversionCode 39\nversionName \"0.0.39\"\n+ multiDexEnabled true\n}\nsplits {\nabi {\n@@ -190,6 +191,7 @@ dependencies {\nimplementation project(':reactnativekeyboardinput')\nimplementation fileTree(dir: \"libs\", include: [\"*.jar\"])\nimplementation \"com.facebook.react:react-native:+\" // From node_modules\n+ implementation \"androidx.multidex:multidex:2.0.1\"\nif (enableHermes) {\ndef hermesPath = \"../../../node_modules/hermesvm/android/\";\n" }, { "change_type": "MODIFY", "old_path": "native/android/app/src/main/java/org/squadcal/MainApplication.java", "new_path": "native/android/app/src/main/java/org/squadcal/MainApplication.java", "diff": "package org.squadcal;\n-import android.app.Application;\n+import androidx.multidex.MultiDexApplication;\nimport android.util.Log;\nimport com.facebook.react.PackageList;\n@@ -18,7 +18,7 @@ import com.facebook.soloader.SoLoader;\nimport java.util.Arrays;\nimport java.util.List;\n-public class MainApplication extends Application implements ReactApplication {\n+public class MainApplication extends MultiDexApplication implements ReactApplication {\nprivate final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {\n@Override\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Android multidex support
129,187
01.11.2019 00:14:01
14,400
7d01fd600cb8fa699648ab3080b0319fb8ff1890
[native] react-native-camera
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -133,6 +133,7 @@ android {\ntargetSdkVersion rootProject.ext.targetSdkVersion\nversionCode 39\nversionName \"0.0.39\"\n+ missingDimensionStrategy 'react-native-camera', 'general'\nmultiDexEnabled true\n}\nsplits {\n" }, { "change_type": "MODIFY", "old_path": "native/android/app/src/main/AndroidManifest.xml", "new_path": "native/android/app/src/main/AndroidManifest.xml", "diff": "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\n<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" />\n<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />\n+ <uses-permission android:name=\"android.permission.CAMERA\" />\n<application\nandroid:name=\".MainApplication\"\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/flow-typed/npm/react-native-camera_vx.x.x.js", "diff": "+// flow-typed signature: bd83f63588175bf0a42daf36a1857554\n+// flow-typed version: <<STUB>>/react-native-camera_v3.8.0/flow_v0.98.0\n+\n+/**\n+ * This is an autogenerated libdef stub for:\n+ *\n+ * 'react-native-camera'\n+ *\n+ * Fill this stub out by replacing all the `any` types.\n+ *\n+ * Once filled out, we encourage you to share your work with the\n+ * community by sending a pull request to:\n+ * https://github.com/flowtype/flow-typed\n+ */\n+\n+declare module 'react-native-camera' {\n+ declare module.exports: any;\n+}\n+\n+/**\n+ * We include stubs for each file inside this npm package in case you need to\n+ * require those files directly. Feel free to delete any files that aren't\n+ * needed.\n+ */\n+declare module 'react-native-camera/src/FaceDetector' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-camera/src' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-camera/src/RNCamera' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-camera/website/core/Footer' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-camera/website/pages/en/help' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-camera/website/pages/en' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-camera/website/pages/en/users' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-camera/website/siteConfig' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'react-native-camera/website/static/js/code-blocks-buttons' {\n+ declare module.exports: any;\n+}\n+\n+// Filename aliases\n+declare module 'react-native-camera/src/FaceDetector.js' {\n+ declare module.exports: $Exports<'react-native-camera/src/FaceDetector'>;\n+}\n+declare module 'react-native-camera/src/index' {\n+ declare module.exports: $Exports<'react-native-camera/src'>;\n+}\n+declare module 'react-native-camera/src/index.js' {\n+ declare module.exports: $Exports<'react-native-camera/src'>;\n+}\n+declare module 'react-native-camera/src/RNCamera.js' {\n+ declare module.exports: $Exports<'react-native-camera/src/RNCamera'>;\n+}\n+declare module 'react-native-camera/website/core/Footer.js' {\n+ declare module.exports: $Exports<'react-native-camera/website/core/Footer'>;\n+}\n+declare module 'react-native-camera/website/pages/en/help.js' {\n+ declare module.exports: $Exports<'react-native-camera/website/pages/en/help'>;\n+}\n+declare module 'react-native-camera/website/pages/en/index' {\n+ declare module.exports: $Exports<'react-native-camera/website/pages/en'>;\n+}\n+declare module 'react-native-camera/website/pages/en/index.js' {\n+ declare module.exports: $Exports<'react-native-camera/website/pages/en'>;\n+}\n+declare module 'react-native-camera/website/pages/en/users.js' {\n+ declare module.exports: $Exports<'react-native-camera/website/pages/en/users'>;\n+}\n+declare module 'react-native-camera/website/siteConfig.js' {\n+ declare module.exports: $Exports<'react-native-camera/website/siteConfig'>;\n+}\n+declare module 'react-native-camera/website/static/js/code-blocks-buttons.js' {\n+ declare module.exports: $Exports<'react-native-camera/website/static/js/code-blocks-buttons'>;\n+}\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -70,6 +70,14 @@ PODS:\n- React-cxxreact (= 0.60.6)\n- React-jsi (= 0.60.6)\n- React-jsinspector (0.60.6)\n+ - react-native-camera (3.8.0):\n+ - React\n+ - react-native-camera/RCT (= 3.8.0)\n+ - react-native-camera/RN (= 3.8.0)\n+ - react-native-camera/RCT (3.8.0):\n+ - React\n+ - react-native-camera/RN (3.8.0):\n+ - React\n- react-native-cameraroll (1.2.1):\n- React\n- react-native-image-resizer (1.0.1):\n@@ -160,6 +168,7 @@ DEPENDENCIES:\n- React-jsi (from `../../node_modules/react-native/ReactCommon/jsi`)\n- React-jsiexecutor (from `../../node_modules/react-native/ReactCommon/jsiexecutor`)\n- React-jsinspector (from `../../node_modules/react-native/ReactCommon/jsinspector`)\n+ - react-native-camera (from `../../node_modules/react-native-camera`)\n- \"react-native-cameraroll (from `../../node_modules/@react-native-community/cameraroll`)\"\n- react-native-image-resizer (from `../../node_modules/react-native-image-resizer`)\n- react-native-in-app-message (from `../../node_modules/react-native-in-app-message`)\n@@ -226,6 +235,8 @@ EXTERNAL SOURCES:\n:path: \"../../node_modules/react-native/ReactCommon/jsiexecutor\"\nReact-jsinspector:\n:path: \"../../node_modules/react-native/ReactCommon/jsinspector\"\n+ react-native-camera:\n+ :path: \"../../node_modules/react-native-camera\"\nreact-native-cameraroll:\n:path: \"../../node_modules/@react-native-community/cameraroll\"\nreact-native-image-resizer:\n@@ -307,6 +318,7 @@ SPEC CHECKSUMS:\nReact-jsi: 1a4248256b96fa453536a8dafe11b784e24e789d\nReact-jsiexecutor: 2279e559b921d02dfc6253ebef3dcb3a9dc6c07e\nReact-jsinspector: a58b86545a0185f69768e78ac96ca9fe43fa3694\n+ react-native-camera: 21cf4ed26cf432ceb1fae959aa6924943fd6f714\nreact-native-cameraroll: 3e5e34d36d93548ae7770ee8ab7b2ae9e778f571\nreact-native-image-resizer: 48eb06a18a6d0a632ffa162a51ca61a68fb5322f\nreact-native-in-app-message: f91de5009620af01456531118264c93e249b83ec\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal/Info.debug.plist", "new_path": "native/ios/SquadCal/Info.debug.plist", "diff": "<string>Give $(PRODUCT_NAME) permission to access your photos</string>\n<key>NSPhotoLibraryAddUsageDescription</key>\n<string>Give $(PRODUCT_NAME) permission to save photos to your camera roll</string>\n+ <key>NSCameraUsageDescription</key>\n+ <string>Give $(PRODUCT_NAME) permission to access the camera</string>\n<key>UIAppFonts</key>\n<array>\n<string>OpenSans-Semibold.ttf</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal/Info.release.plist", "new_path": "native/ios/SquadCal/Info.release.plist", "diff": "<string>Give $(PRODUCT_NAME) permission to access your photos</string>\n<key>NSPhotoLibraryAddUsageDescription</key>\n<string>Give $(PRODUCT_NAME) permission to save photos to your camera roll</string>\n+ <key>NSCameraUsageDescription</key>\n+ <string>Give $(PRODUCT_NAME) permission to access the camera</string>\n<key>UIAppFonts</key>\n<array>\n<string>OpenSans-Semibold.ttf</string>\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"lottie-react-native\": \"^3.2.1\",\n\"react\": \"16.8.6\",\n\"react-native\": \"0.60.6\",\n+ \"react-native-camera\": \"^3.8.0\",\n\"react-native-dark-mode\": \"^0.2.0-rc.1\",\n\"react-native-exit-app\": \"^1.1.0\",\n\"react-native-fast-image\": \"^7.0.2\",\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -10046,6 +10046,13 @@ react-linkify@^1.0.0-alpha:\nlinkify-it \"^2.0.3\"\ntlds \"^1.199.0\"\n+react-native-camera@^3.8.0:\n+ version \"3.8.0\"\n+ resolved \"https://registry.yarnpkg.com/react-native-camera/-/react-native-camera-3.8.0.tgz#c2e6aaa62dc84e07180c3ea29a5bfc4d24b188a7\"\n+ integrity sha512-8haG+GONkMaZPtGZcVy2gALn87vOZiPaWZ7I7V6H81WnVBy00Hcd9w1T8T1gdmxuVSFgV5gFKNjnYRc+xMe5pg==\n+ dependencies:\n+ prop-types \"^15.6.2\"\n+\nreact-native-dark-mode@^0.2.0-rc.1:\nversion \"0.2.0-rc.1\"\nresolved \"https://registry.yarnpkg.com/react-native-dark-mode/-/react-native-dark-mode-0.2.0-rc.1.tgz#fc83f4a6d897613f49b49bde10f9c3d0f8e4ae69\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] react-native-camera
129,187
01.11.2019 00:15:24
14,400
b2cab14780e872b40180175accc01dc4d19b1e0a
[native] Camera button in ChatInputBar
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-input-bar.react.js", "new_path": "native/chat/chat-input-bar.react.js", "diff": "@@ -29,6 +29,10 @@ import {\n} from '../navigation/keyboard-state';\nimport type { Styles } from '../types/styles';\nimport { type Colors, colorsPropType } from '../themes/colors';\n+import {\n+ type MessageListNavProp,\n+ messageListNavPropType,\n+} from './message-list-types';\nimport * as React from 'react';\nimport {\n@@ -72,12 +76,14 @@ import {\n} from '../media/image-gallery-keyboard.react';\nimport { ChatInputStateContext } from './chat-input-state';\nimport { colorsSelector, styleSelector } from '../themes/colors';\n+import { CameraModalRouteName } from '../navigation/route-names';\nconst draftKeyFromThreadID =\n(threadID: string) => `${threadID}/message_composer`;\ntype Props = {|\nthreadInfo: ThreadInfo,\n+ navigation: MessageListNavProp,\n// Redux state\nviewerID: ?string,\ndraft: string,\n@@ -108,6 +114,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nstatic propTypes = {\nthreadInfo: threadInfoPropType.isRequired,\n+ navigation: messageListNavPropType.isRequired,\nviewerID: PropTypes.string,\ndraft: PropTypes.string.isRequired,\njoinThreadLoadingStatus: loadingStatusPropType.isRequired,\n@@ -123,8 +130,8 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n};\nstatic contextType = ChatInputStateContext;\ntextInput: ?TextInput;\n- cameraRollOpacity: Animated.Value;\nexpandOpacity: Animated.Value;\n+ expandoButtonsOpacity: Animated.Value;\nexpandoButtonsWidth: Animated.Value;\nconstructor(props: Props) {\n@@ -134,13 +141,13 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nheight: 0,\nbuttonsExpanded: true,\n};\n- this.cameraRollOpacity = new Animated.Value(1);\n- this.expandOpacity = Animated.sub(1, this.cameraRollOpacity);\n+ this.expandoButtonsOpacity = new Animated.Value(1);\n+ this.expandOpacity = Animated.sub(1, this.expandoButtonsOpacity);\nthis.expandoButtonsWidth = Animated.interpolate(\n- this.cameraRollOpacity,\n+ this.expandoButtonsOpacity,\n{\ninputRange: [ 0, 1 ],\n- outputRange: [ 22, 28 ],\n+ outputRange: [ 22, 58 ],\n},\n);\n}\n@@ -218,7 +225,14 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nget cameraRollIconStyle() {\nreturn {\n...this.props.styles.cameraRollIcon,\n- opacity: this.cameraRollOpacity,\n+ opacity: this.expandoButtonsOpacity,\n+ };\n+ }\n+\n+ get cameraIconStyle() {\n+ return {\n+ ...this.props.styles.cameraIcon,\n+ opacity: this.expandoButtonsOpacity,\n};\n}\n@@ -282,14 +296,11 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n</TouchableOpacity>\n);\n}\n- content = (\n- <TouchableWithoutFeedback onPress={this.dismissKeyboard}>\n- <View style={this.props.styles.inputContainer}>\n- <Animated.View style={this.expandoButtonsStyle}>\n+ const expandoButton = (\n<TouchableOpacity\n- onPress={this.onRightmostButtonPress}\n+ onPress={this.expandButtons}\nactiveOpacity={0.4}\n- style={this.props.styles.expandoButtons}\n+ style={this.props.styles.expandButton}\n>\n<Animated.View style={this.expandIconStyle}>\n<FAIcon\n@@ -298,6 +309,18 @@ class ChatInputBar extends React.PureComponent<Props, State> {\ncolor={this.props.colors.listInputButton}\n/>\n</Animated.View>\n+ </TouchableOpacity>\n+ );\n+ content = (\n+ <TouchableWithoutFeedback onPress={this.dismissKeyboard}>\n+ <View style={this.props.styles.inputContainer}>\n+ <Animated.View style={this.expandoButtonsStyle}>\n+ <View style={this.props.styles.innerExpandoButtons}>\n+ {this.state.buttonsExpanded ? expandoButton : null}\n+ <TouchableOpacity\n+ onPress={this.openImageGallery}\n+ activeOpacity={0.4}\n+ >\n<Animated.View style={this.cameraRollIconStyle}>\n<Icon\nname=\"md-image\"\n@@ -306,6 +329,22 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n/>\n</Animated.View>\n</TouchableOpacity>\n+ <TouchableOpacity\n+ onPress={this.openCamera}\n+ activeOpacity={0.4}\n+ disabled={!this.state.buttonsExpanded}\n+ pointerEvents={this.state.buttonsExpanded ? 'auto' : 'none'}\n+ >\n+ <Animated.View style={this.cameraIconStyle}>\n+ <FAIcon\n+ name=\"camera\"\n+ size={19}\n+ color={this.props.colors.listInputButton}\n+ />\n+ </Animated.View>\n+ </TouchableOpacity>\n+ {this.state.buttonsExpanded ? null : expandoButton}\n+ </View>\n</Animated.View>\n<View style={this.props.styles.textInputContainer}>\n<TextInput\n@@ -365,7 +404,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nkbComponent={kbComponent}\nkbInitialProps={this.props.styles.kbInitialProps}\nonItemSelected={this.onImageGalleryItemSelected}\n- onKeyboardResigned={this.hideCustomKeyboard}\n+ onKeyboardResigned={this.hideImageGallery}\nmanageScrollView={false}\n/>\n);\n@@ -471,12 +510,12 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n});\n}\n- expandButtons() {\n+ expandButtons = () => {\nif (this.state.buttonsExpanded) {\nreturn;\n}\nAnimated.timing(\n- this.cameraRollOpacity,\n+ this.expandoButtonsOpacity,\n{ duration: 500, toValue: 1, easing: Easing.inOut(Easing.ease) },\n).start();\nthis.setState({ buttonsExpanded: true });\n@@ -491,21 +530,20 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nreturn;\n}\nAnimated.timing(\n- this.cameraRollOpacity,\n+ this.expandoButtonsOpacity,\n{ duration: 500, toValue: 0, easing: Easing.inOut(Easing.ease) },\n).start();\nthis.setState({ buttonsExpanded: false });\n}\n- onRightmostButtonPress = () => {\n- if (!this.state.buttonsExpanded) {\n- this.expandButtons();\n- } else {\n- this.setImageGalleryOpen(true);\n+ openCamera = () => {\n}\n+\n+ openImageGallery = () => {\n+ this.setImageGalleryOpen(true);\n}\n- hideCustomKeyboard = () => {\n+ hideImageGallery = () => {\nthis.setImageGalleryOpen(false);\n}\n@@ -559,19 +597,31 @@ const styles = {\nexpandoButtons: {\nalignSelf: 'flex-end',\n},\n+ innerExpandoButtons: {\n+ alignSelf: 'flex-end',\n+ flexDirection: 'row',\n+ alignItems: 'flex-end',\n+ },\nsendIcon: {\npaddingLeft: 5,\npaddingRight: 8,\n},\n- expandIcon: {\n+ expandButton: {\nposition: 'absolute',\nright: 0,\n- bottom: Platform.OS === \"ios\" ? 10 : 12,\n+ bottom: 0,\n+ },\n+ expandIcon: {\n+ paddingBottom: Platform.OS === \"ios\" ? 10 : 12,\n},\ncameraRollIcon: {\n- paddingRight: 2,\n+ paddingRight: 7,\npaddingBottom: Platform.OS === \"ios\" ? 5 : 8,\n},\n+ cameraIcon: {\n+ paddingRight: 3,\n+ paddingBottom: Platform.OS === \"ios\" ? 10 : 12,\n+ },\nexplanation: {\ncolor: 'listBackgroundSecondaryLabel',\ntextAlign: 'center',\n" }, { "change_type": "MODIFY", "old_path": "native/chat/message-list-container.react.js", "new_path": "native/chat/message-list-container.react.js", "diff": "@@ -234,7 +234,10 @@ class MessageListContainer extends React.PureComponent<Props, State> {\nallHeightsMeasuredCallback={this.allHeightsMeasured}\n/>\n{messageList}\n- <ChatInputBar threadInfo={threadInfo} />\n+ <ChatInputBar\n+ threadInfo={threadInfo}\n+ navigation={this.props.navigation}\n+ />\n</View>\n);\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Camera button in ChatInputBar
129,187
01.11.2019 00:15:48
14,400
0006afe8d6c540e4bb8307329216d4d458909d50
[native] CameraModal
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-input-bar.react.js", "new_path": "native/chat/chat-input-bar.react.js", "diff": "@@ -537,6 +537,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n}\nopenCamera = () => {\n+ this.props.navigation.navigate({ routeName: CameraModalRouteName });\n}\nopenImageGallery = () => {\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/media/camera-modal.react.js", "diff": "+// @flow\n+\n+import type {\n+ NavigationStackProp,\n+ NavigationLeafRoute,\n+ NavigationStackScene,\n+} from 'react-navigation';\n+import type { AppState } from '../redux/redux-setup';\n+import { type Dimensions, dimensionsPropType } from 'lib/types/media-types';\n+\n+import * as React from 'react';\n+import { View, StyleSheet } from 'react-native';\n+import PropTypes from 'prop-types';\n+import Animated from 'react-native-reanimated';\n+import { RNCamera } from 'react-native-camera';\n+\n+import { connect } from 'lib/utils/redux-utils';\n+\n+import {\n+ contentBottomOffset,\n+ dimensionsSelector,\n+ contentVerticalOffsetSelector,\n+} from '../selectors/dimension-selectors';\n+\n+const {\n+ Value,\n+} = Animated;\n+\n+type Props = {|\n+ navigation: NavigationStackProp<NavigationLeafRoute>,\n+ scene: NavigationStackScene,\n+ position: Value,\n+ // Redux state\n+ screenDimensions: Dimensions,\n+ contentVerticalOffset: number,\n+|};\n+class CameraModal extends React.PureComponent<Props> {\n+\n+ static propTypes = {\n+ navigation: PropTypes.shape({\n+ goBack: PropTypes.func.isRequired,\n+ }).isRequired,\n+ scene: PropTypes.object.isRequired,\n+ position: PropTypes.instanceOf(Value).isRequired,\n+ screenDimensions: dimensionsPropType.isRequired,\n+ contentVerticalOffset: PropTypes.number.isRequired,\n+ };\n+\n+ render() {\n+ return (\n+ <View style={styles.container}>\n+ <RNCamera\n+ captureAudio={false}\n+ style={styles.preview}\n+ />\n+ </View>\n+ );\n+ }\n+\n+}\n+\n+const styles = StyleSheet.create({\n+ container: {\n+ flex: 1,\n+ },\n+ preview: {\n+ flex: 1,\n+ },\n+});\n+\n+export default connect(\n+ (state: AppState) => ({\n+ screenDimensions: dimensionsSelector(state),\n+ contentVerticalOffset: contentVerticalOffsetSelector(state),\n+ }),\n+)(CameraModal);\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/navigation-setup.js", "new_path": "native/navigation/navigation-setup.js", "diff": "@@ -91,6 +91,7 @@ import {\nActionResultModalRouteName,\nTextMessageTooltipModalRouteName,\nThreadSettingsMemberTooltipModalRouteName,\n+ CameraModalRouteName,\naccountModals,\n} from './route-names';\nimport {\n@@ -116,6 +117,7 @@ import {\n} from '../chat/text-message-tooltip-modal.react';\nimport ThreadSettingsMemberTooltipModal\nfrom '../chat/settings/thread-settings-member-tooltip-modal.react';\n+import CameraModal from '../media/camera-modal.react';\nimport TabBar from './tab-bar.react';\nuseScreens();\n@@ -169,6 +171,7 @@ const AppNavigator = createLightboxNavigator(\n[ActionResultModalRouteName]: ActionResultModal,\n[TextMessageTooltipModalRouteName]: TextMessageTooltipModal,\n[ThreadSettingsMemberTooltipModalRouteName]: ThreadSettingsMemberTooltipModal,\n+ [CameraModalRouteName]: CameraModal,\n},\n);\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/route-names.js", "new_path": "native/navigation/route-names.js", "diff": "@@ -42,6 +42,7 @@ export const ActionResultModalRouteName = 'ActionResultModal';\nexport const TextMessageTooltipModalRouteName = 'TextMessageTooltipModal';\nexport const ThreadSettingsMemberTooltipModalRouteName =\n'ThreadSettingsMemberTooltipModal';\n+export const CameraModalRouteName = 'CameraModal';\nexport const accountModals = [\nLoggedOutModalRouteName,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] CameraModal
129,187
01.11.2019 00:19:34
14,400
595ce7107a5bb93bc3ee0e69eb058af9b242ac38
[native] Animate CameraModal background opacity
[ { "change_type": "MODIFY", "old_path": "native/media/camera-modal.react.js", "new_path": "native/media/camera-modal.react.js", "diff": "@@ -24,6 +24,8 @@ import {\nconst {\nValue,\n+ Extrapolate,\n+ interpolate,\n} = Animated;\ntype Props = {|\n@@ -45,15 +47,38 @@ class CameraModal extends React.PureComponent<Props> {\nscreenDimensions: dimensionsPropType.isRequired,\ncontentVerticalOffset: PropTypes.number.isRequired,\n};\n+ progress: Value;\n+\n+ constructor(props: Props) {\n+ super(props);\n+\n+ const { position } = props;\n+ const { index } = props.scene;\n+ this.progress = interpolate(\n+ position,\n+ {\n+ inputRange: [ index - 1, index ],\n+ outputRange: [ 0, 1 ],\n+ extrapolate: Extrapolate.CLAMP,\n+ },\n+ );\n+ }\n+\n+ get containerStyle() {\n+ return {\n+ ...styles.container,\n+ opacity: this.progress,\n+ };\n+ }\nrender() {\nreturn (\n- <View style={styles.container}>\n+ <Animated.View style={this.containerStyle}>\n<RNCamera\ncaptureAudio={false}\nstyle={styles.preview}\n/>\n- </View>\n+ </Animated.View>\n);\n}\n@@ -62,6 +87,7 @@ class CameraModal extends React.PureComponent<Props> {\nconst styles = StyleSheet.create({\ncontainer: {\nflex: 1,\n+ backgroundColor: 'black',\n},\npreview: {\nflex: 1,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Animate CameraModal background opacity
129,187
02.11.2019 00:00:25
14,400
fcab4b345cbe0e6f5593e967a938fb5f713841ee
[native] Extract gestureJustStarted & gestureJustEnded
[ { "change_type": "MODIFY", "old_path": "native/media/multimedia-modal.react.js", "new_path": "native/media/multimedia-modal.react.js", "diff": "@@ -48,7 +48,11 @@ import {\n} from '../selectors/dimension-selectors';\nimport Multimedia from './multimedia.react';\nimport ConnectedStatusBar from '../connected-status-bar.react';\n-import { clamp } from '../utils/animation-utils';\n+import {\n+ clamp,\n+ gestureJustStarted,\n+ gestureJustEnded,\n+} from '../utils/animation-utils';\nimport { saveImage } from './save-image';\nconst {\n@@ -111,30 +115,6 @@ function panDelta(value: Value, gestureActive: Value) {\n);\n}\n-function gestureJustStarted(state: Value) {\n- const prevValue = new Value(-1);\n- return cond(\n- eq(prevValue, state),\n- 0,\n- [\n- set(prevValue, state),\n- eq(state, GestureState.ACTIVE),\n- ],\n- );\n-}\n-\n-function gestureJustEnded(state: Value) {\n- const prevValue = new Value(-1);\n- return cond(\n- eq(prevValue, state),\n- 0,\n- [\n- set(prevValue, state),\n- eq(state, GestureState.END),\n- ],\n- );\n-}\n-\nfunction runTiming(\nclock: Clock,\ninitialValue: Value | number,\n" }, { "change_type": "MODIFY", "old_path": "native/utils/animation-utils.js", "new_path": "native/utils/animation-utils.js", "diff": "// @flow\nimport Animated from 'react-native-reanimated';\n+import { State as GestureState } from 'react-native-gesture-handler';\nconst {\nValue,\n@@ -41,7 +42,33 @@ function delta(value: Value) {\n];\n}\n+function gestureJustStarted(state: Value) {\n+ const prevValue = new Value(-1);\n+ return cond(\n+ eq(prevValue, state),\n+ 0,\n+ [\n+ set(prevValue, state),\n+ eq(state, GestureState.ACTIVE),\n+ ],\n+ );\n+}\n+\n+function gestureJustEnded(state: Value) {\n+ const prevValue = new Value(-1);\n+ return cond(\n+ eq(prevValue, state),\n+ 0,\n+ [\n+ set(prevValue, state),\n+ eq(state, GestureState.END),\n+ ],\n+ );\n+}\n+\nexport {\nclamp,\ndelta,\n+ gestureJustStarted,\n+ gestureJustEnded,\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Extract gestureJustStarted & gestureJustEnded
129,187
04.11.2019 14:58:29
18,000
89fb5660db54776e56b902001c773f51668153c7
[native] Fix spacing between messages in same cluster
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-input-bar.react.js", "new_path": "native/chat/chat-input-bar.react.js", "diff": "@@ -621,7 +621,7 @@ const styles = {\n},\ncameraIcon: {\npaddingRight: 3,\n- paddingBottom: Platform.OS === \"ios\" ? 10 : 12,\n+ paddingBottom: Platform.OS === \"ios\" ? 10 : 11,\n},\nexplanation: {\ncolor: 'listBackgroundSecondaryLabel',\n" }, { "change_type": "MODIFY", "old_path": "native/chat/message-header.react.js", "new_path": "native/chat/message-header.react.js", "diff": "@@ -44,20 +44,18 @@ function MessageHeader(props: Props) {\n? <Timestamp time={time} display={display} />\n: null;\n+ let style = null;\n+ if (focused && !modalDisplay) {\nlet topMargin = 0;\n- if (!item.startsCluster) {\n- topMargin += 7;\n- }\n- if (focused && !modalDisplay && !item.startsCluster) {\n+ if (!item.startsCluster && !item.messageInfo.creator.isViewer) {\ntopMargin += authorNameHeight;\n}\n- if (focused && !modalDisplay && !item.startsConversation) {\n+ if (!item.startsConversation) {\ntopMargin += timestampHeight;\n}\n+ style = { marginTop: topMargin };\n+ }\n- const style = topMargin\n- ? { marginTop: topMargin }\n- : null;\nreturn (\n<View style={style}>\n{timestamp}\n" }, { "change_type": "MODIFY", "old_path": "native/chat/message.react.js", "new_path": "native/chat/message.react.js", "diff": "@@ -42,6 +42,7 @@ import {\nMultimediaMessage,\nmultimediaMessageItemHeight,\n} from './multimedia-message.react';\n+import { timestampHeight } from './timestamp.react';\nexport type ChatMessageInfoItemWithHeight =\n| ChatRobotextMessageInfoItemWithHeight\n@@ -61,7 +62,7 @@ function messageItemHeight(\nheight += robotextMessageItemHeight(item, viewerID);\n}\nif (item.startsConversation) {\n- height += 27; // for time bar\n+ height += timestampHeight + 1;\n}\nreturn height;\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Fix spacing between messages in same cluster
129,187
04.11.2019 15:09:27
18,000
2b77841e0bffd8a62172fb8fd12b966c2b8c958b
[native] Include clusterEndHeight on focused message
[ { "change_type": "MODIFY", "old_path": "native/chat/composed-message.react.js", "new_path": "native/chat/composed-message.react.js", "diff": "@@ -18,6 +18,8 @@ import { composedMessageMaxWidthSelector } from './composed-message-width';\nimport MessageHeader from './message-header.react';\nimport { colorsSelector } from '../themes/colors';\n+const clusterEndHeight = 7;\n+\ntype Props = {|\nitem: ChatMessageInfoItemWithHeight,\nsendFailed: bool,\n@@ -50,7 +52,7 @@ class ComposedMessage extends React.PureComponent<Props> {\n: styles.leftChatBubble;\nconst containerStyle = [\nstyles.alignment,\n- { marginBottom: item.endsCluster ? 12 : 5 },\n+ { marginBottom: 5 + (item.endsCluster ? clusterEndHeight : 0) },\n];\nconst messageBoxStyle = {\nmaxWidth: this.props.composedMessageMaxWidth,\n@@ -129,9 +131,14 @@ const styles = StyleSheet.create({\n},\n});\n-export default connect(\n+const ConnectedComposedMessage = connect(\n(state: AppState) => ({\ncomposedMessageMaxWidth: composedMessageMaxWidthSelector(state),\ncolors: colorsSelector(state),\n}),\n)(ComposedMessage);\n+\n+export {\n+ ConnectedComposedMessage as ComposedMessage,\n+ clusterEndHeight,\n+};\n" }, { "change_type": "MODIFY", "old_path": "native/chat/message-header.react.js", "new_path": "native/chat/message-header.react.js", "diff": "@@ -13,6 +13,7 @@ import { connect } from 'lib/utils/redux-utils';\nimport { Timestamp, timestampHeight } from './timestamp.react';\nimport { styleSelector } from '../themes/colors';\n+import { clusterEndHeight } from './composed-message.react';\ntype Props = {|\nitem: ChatMessageInfoItemWithHeight,\n@@ -48,7 +49,7 @@ function MessageHeader(props: Props) {\nif (focused && !modalDisplay) {\nlet topMargin = 0;\nif (!item.startsCluster && !item.messageInfo.creator.isViewer) {\n- topMargin += authorNameHeight;\n+ topMargin += authorNameHeight + clusterEndHeight;\n}\nif (!item.startsConversation) {\ntopMargin += timestampHeight;\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-message.react.js", "new_path": "native/chat/multimedia-message.react.js", "diff": "@@ -24,7 +24,7 @@ import PropTypes from 'prop-types';\nimport invariant from 'invariant';\nimport Animated from 'react-native-reanimated';\n-import ComposedMessage from './composed-message.react';\n+import { ComposedMessage } from './composed-message.react';\nimport MultimediaMessageMultimedia from './multimedia-message-multimedia.react';\nimport {\nwithLightboxPositionContext,\n" }, { "change_type": "MODIFY", "old_path": "native/chat/text-message.react.js", "new_path": "native/chat/text-message.react.js", "diff": "@@ -34,7 +34,7 @@ import { messageKey } from 'lib/shared/message-utils';\nimport InnerTextMessage from './inner-text-message.react';\nimport { textMessageTooltipHeight } from './text-message-tooltip-modal.react';\nimport { TextMessageTooltipModalRouteName } from '../navigation/route-names';\n-import ComposedMessage from './composed-message.react';\n+import { ComposedMessage } from './composed-message.react';\nexport type ChatTextMessageInfoItemWithHeight = {|\nitemType: \"message\",\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Include clusterEndHeight on focused message
129,187
04.11.2019 15:17:53
18,000
fc6d93eeeecf2f0325032ea8d6ab075cbee83829
[native] Use constants for chat message height calculation
[ { "change_type": "MODIFY", "old_path": "native/chat/composed-message.react.js", "new_path": "native/chat/composed-message.react.js", "diff": "@@ -13,9 +13,9 @@ import Icon from 'react-native-vector-icons/Feather';\nimport { connect } from 'lib/utils/redux-utils';\n-import FailedSend from './failed-send.react';\n+import { FailedSend } from './failed-send.react';\nimport { composedMessageMaxWidthSelector } from './composed-message-width';\n-import MessageHeader from './message-header.react';\n+import { MessageHeader } from './message-header.react';\nimport { colorsSelector } from '../themes/colors';\nconst clusterEndHeight = 7;\n" }, { "change_type": "MODIFY", "old_path": "native/chat/failed-send.react.js", "new_path": "native/chat/failed-send.react.js", "diff": "@@ -32,6 +32,8 @@ import {\nimport Button from '../components/button.react';\nimport { styleSelector } from '../themes/colors';\n+const failedSendHeight = 22;\n+\ntype Props = {|\nitem: ChatMessageInfoItemWithHeight,\n// Redux state\n@@ -151,7 +153,7 @@ const styles = {\n};\nconst stylesSelector = styleSelector(styles);\n-export default connect(\n+const ConnectedFailedSend = connect(\n(state: AppState, ownProps: { item: ChatMessageInfoItemWithHeight }) => {\nconst id = messageID(ownProps.item.messageInfo);\nreturn {\n@@ -161,3 +163,8 @@ export default connect(\n},\n{ sendTextMessage },\n)(withChatInputState(FailedSend));\n+\n+export {\n+ ConnectedFailedSend as FailedSend,\n+ failedSendHeight,\n+};\n" }, { "change_type": "MODIFY", "old_path": "native/chat/message-header.react.js", "new_path": "native/chat/message-header.react.js", "diff": "@@ -85,6 +85,11 @@ const styles = {\n};\nconst stylesSelector = styleSelector(styles);\n-export default connect((state: AppState) => ({\n+const ConnectedMessageHeader = connect((state: AppState) => ({\nstyles: stylesSelector(state),\n}))(MessageHeader);\n+\n+export {\n+ ConnectedMessageHeader as MessageHeader,\n+ authorNameHeight,\n+};\n" }, { "change_type": "MODIFY", "old_path": "native/chat/message.react.js", "new_path": "native/chat/message.react.js", "diff": "@@ -62,7 +62,7 @@ function messageItemHeight(\nheight += robotextMessageItemHeight(item, viewerID);\n}\nif (item.startsConversation) {\n- height += timestampHeight + 1;\n+ height += timestampHeight;\n}\nreturn height;\n}\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-message.react.js", "new_path": "native/chat/multimedia-message.react.js", "diff": "@@ -24,7 +24,7 @@ import PropTypes from 'prop-types';\nimport invariant from 'invariant';\nimport Animated from 'react-native-reanimated';\n-import { ComposedMessage } from './composed-message.react';\n+import { ComposedMessage, clusterEndHeight } from './composed-message.react';\nimport MultimediaMessageMultimedia from './multimedia-message-multimedia.react';\nimport {\nwithLightboxPositionContext,\n@@ -34,6 +34,8 @@ import {\nfilterCorners,\ngetRoundedContainerStyle,\n} from './rounded-message-container.react';\n+import { authorNameHeight } from './message-header.react';\n+import { failedSendHeight } from './failed-send.react';\ntype ContentHeights = {|\nimageHeight: number,\n@@ -135,13 +137,13 @@ function multimediaMessageItemHeight(\nconst { isViewer } = creator;\nlet height = 5 + contentHeight; // for margin and images\nif (!isViewer && startsCluster) {\n- height += 25; // for username\n+ height += authorNameHeight;\n}\nif (endsCluster) {\n- height += 7; // extra padding at the end of a cluster\n+ height += clusterEndHeight;\n}\nif (sendFailed(item)) {\n- height += 22; // extra padding for sendFailed\n+ height += failedSendHeight;\n}\nreturn height;\n}\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-tooltip-button.react.js", "new_path": "native/chat/multimedia-tooltip-button.react.js", "diff": "@@ -38,7 +38,7 @@ import {\nimport InlineMultimedia from './inline-multimedia.react';\nimport { multimediaMessageBorderRadius } from './multimedia-message.react';\nimport { getRoundedContainerStyle } from './rounded-message-container.react';\n-import MessageHeader from './message-header.react';\n+import { MessageHeader } from './message-header.react';\nimport { dimensionsSelector } from '../selectors/dimension-selectors';\nconst { Value } = Animated;\n" }, { "change_type": "MODIFY", "old_path": "native/chat/text-message-tooltip-button.react.js", "new_path": "native/chat/text-message-tooltip-button.react.js", "diff": "@@ -24,7 +24,7 @@ import { connect } from 'lib/utils/redux-utils';\nimport { dimensionsSelector } from '../selectors/dimension-selectors';\nimport InnerTextMessage from './inner-text-message.react';\n-import MessageHeader from './message-header.react';\n+import { MessageHeader } from './message-header.react';\nconst { Value } = Animated;\n" }, { "change_type": "MODIFY", "old_path": "native/chat/text-message.react.js", "new_path": "native/chat/text-message.react.js", "diff": "@@ -34,7 +34,9 @@ import { messageKey } from 'lib/shared/message-utils';\nimport InnerTextMessage from './inner-text-message.react';\nimport { textMessageTooltipHeight } from './text-message-tooltip-modal.react';\nimport { TextMessageTooltipModalRouteName } from '../navigation/route-names';\n-import { ComposedMessage } from './composed-message.react';\n+import { ComposedMessage, clusterEndHeight } from './composed-message.react';\n+import { authorNameHeight } from './message-header.react';\n+import { failedSendHeight } from './failed-send.react';\nexport type ChatTextMessageInfoItemWithHeight = {|\nitemType: \"message\",\n@@ -57,10 +59,10 @@ function textMessageItemHeight(\nconst { isViewer } = creator;\nlet height = 17 + contentHeight; // for padding, margin, and text\nif (!isViewer && startsCluster) {\n- height += 25; // for username\n+ height += authorNameHeight;\n}\nif (endsCluster) {\n- height += 7; // extra padding at the end of a cluster\n+ height += clusterEndHeight;\n}\nif (\nisViewer &&\n@@ -68,7 +70,7 @@ function textMessageItemHeight(\nitem.localMessageInfo &&\nitem.localMessageInfo.sendFailed\n) {\n- height += 22; // extra padding for sendFailed\n+ height += failedSendHeight;\n}\nreturn height;\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use constants for chat message height calculation
129,187
04.11.2019 16:05:26
18,000
f0d47bee04b5e1fc523d87bde7f51978bf07bb1a
[native] Dark mode for Multimedia spinner color
[ { "change_type": "MODIFY", "old_path": "native/chat/inline-multimedia.react.js", "new_path": "native/chat/inline-multimedia.react.js", "diff": "@@ -21,6 +21,7 @@ type Props = {|\nonLongPress: () => void,\npostInProgress: bool,\npendingUpload: ?PendingMultimediaUpload,\n+ spinnerColor: string,\n|};\nclass InlineMultimedia extends React.PureComponent<Props> {\n@@ -30,6 +31,7 @@ class InlineMultimedia extends React.PureComponent<Props> {\nonLongPress: PropTypes.func.isRequired,\npostInProgress: PropTypes.bool.isRequired,\npendingUpload: pendingMultimediaUploadPropType,\n+ spinnerColor: PropTypes.string.isRequired,\n};\nrender() {\n@@ -79,7 +81,10 @@ class InlineMultimedia extends React.PureComponent<Props> {\nstyle={styles.expand}\n>\n<View style={styles.expand}>\n- <Multimedia mediaInfo={mediaInfo} />\n+ <Multimedia\n+ mediaInfo={mediaInfo}\n+ spinnerColor={this.props.spinnerColor}\n+ />\n{progressIndicator}\n</View>\n</TouchableOpacity>\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-message-multimedia.react.js", "new_path": "native/chat/multimedia-message-multimedia.react.js", "diff": "@@ -31,6 +31,8 @@ import {\nkeyboardStatePropType,\nwithKeyboardState,\n} from '../navigation/keyboard-state';\n+import type { AppState } from '../redux/redux-setup';\n+import { type Colors, colorsPropType } from '../themes/colors';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n@@ -40,9 +42,11 @@ import invariant from 'invariant';\nimport { messageKey } from 'lib/shared/message-utils';\nimport { chatMessageItemPropType } from 'lib/selectors/chat-selectors';\n+import { connect } from 'lib/utils/redux-utils';\nimport InlineMultimedia from './inline-multimedia.react';\nimport { multimediaTooltipHeight } from './multimedia-tooltip-modal.react';\n+import { colorsSelector } from '../themes/colors';\ntype Props = {|\nmediaInfo: MediaInfo,\n@@ -56,6 +60,8 @@ type Props = {|\npendingUpload: ?PendingMultimediaUpload,\nmessageFocused: bool,\ntoggleMessageFocus: (messageKey: string) => void,\n+ // Redux state\n+ colors: Colors,\n// withOverlayableScrollViewState\noverlayableScrollViewState: ?OverlayableScrollViewState,\n// withKeyboardState\n@@ -78,6 +84,7 @@ class MultimediaMessageMultimedia extends React.PureComponent<Props, State> {\npendingUpload: pendingMultimediaUploadPropType,\nmessageFocused: PropTypes.bool.isRequired,\ntoggleMessageFocus: PropTypes.func.isRequired,\n+ colors: colorsPropType.isRequired,\noverlayableScrollViewState: overlayableScrollViewStatePropType,\nkeyboardState: keyboardStatePropType,\n};\n@@ -152,6 +159,7 @@ class MultimediaMessageMultimedia extends React.PureComponent<Props, State> {\nonLongPress={this.onLongPress}\npostInProgress={this.props.postInProgress}\npendingUpload={this.props.pendingUpload}\n+ spinnerColor={this.props.colors.listSeparatorLabel}\n/>\n</View>\n</Animated.View>\n@@ -281,6 +289,12 @@ const styles = StyleSheet.create({\n},\n});\n-export default withKeyboardState(\n- withOverlayableScrollViewState(MultimediaMessageMultimedia),\n+export default connect((state: AppState) => ({\n+ colors: colorsSelector(state),\n+}))(\n+ withKeyboardState(\n+ withOverlayableScrollViewState(\n+ MultimediaMessageMultimedia,\n+ ),\n+ ),\n);\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-tooltip-button.react.js", "new_path": "native/chat/multimedia-tooltip-button.react.js", "diff": "@@ -132,6 +132,7 @@ class MultimediaTooltipButton extends React.PureComponent<Props> {\nonLongPress={this.onPress}\npostInProgress={postInProgress}\npendingUpload={pendingUpload}\n+ spinnerColor=\"white\"\n/>\n</View>\n</React.Fragment>\n" }, { "change_type": "MODIFY", "old_path": "native/media/multimedia.react.js", "new_path": "native/media/multimedia.react.js", "diff": "@@ -10,7 +10,7 @@ import RemoteImage from './remote-image.react';\ntype Props = {|\nmediaInfo: MediaInfo,\n- spinnerColor: \"black\" | \"white\",\n+ spinnerColor: string,\n|};\ntype State = {|\ncurrentURI: string,\n@@ -20,7 +20,7 @@ class Multimedia extends React.PureComponent<Props, State> {\nstatic propTypes = {\nmediaInfo: mediaInfoPropType.isRequired,\n- spinnerColor: PropTypes.oneOf([ \"black\", \"white\" ]).isRequired,\n+ spinnerColor: PropTypes.string.isRequired,\n};\nstatic defaultProps = {\nspinnerColor: \"black\",\n" }, { "change_type": "MODIFY", "old_path": "native/media/remote-image.react.js", "new_path": "native/media/remote-image.react.js", "diff": "@@ -17,7 +17,7 @@ import { connect } from 'lib/utils/redux-utils';\ntype Props = {|\nuri: string,\nonLoad: (uri: string) => void,\n- spinnerColor: \"black\" | \"white\",\n+ spinnerColor: string,\nstyle: ImageStyle,\ninvisibleLoad: bool,\n// Redux state\n@@ -32,7 +32,7 @@ class RemoteImage extends React.PureComponent<Props, State> {\nstatic propTypes = {\nuri: PropTypes.string.isRequired,\nonLoad: PropTypes.func.isRequired,\n- spinnerColor: PropTypes.oneOf([ \"black\", \"white\" ]).isRequired,\n+ spinnerColor: PropTypes.string.isRequired,\ninvisibleLoad: PropTypes.bool.isRequired,\nconnectionStatus: connectionStatusPropType.isRequired,\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Dark mode for Multimedia spinner color
129,187
04.11.2019 16:08:34
18,000
2913a093b3bd7a05c21c8aff7df638a6e8532c0e
[native] Make AddUsersModal ActivityIndicator match text
[ { "change_type": "MODIFY", "old_path": "native/chat/settings/add-users-modal.react.js", "new_path": "native/chat/settings/add-users-modal.react.js", "diff": "@@ -173,7 +173,7 @@ class AddUsersModal extends React.PureComponent<Props, State> {\nif (this.props.changeThreadSettingsLoadingStatus === \"loading\") {\nactivityIndicator = (\n<View style={this.props.styles.activityIndicator}>\n- <ActivityIndicator color=\"#555\" />\n+ <ActivityIndicator color=\"white\" />\n</View>\n);\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Make AddUsersModal ActivityIndicator match text
129,187
04.11.2019 17:40:30
18,000
2ecf356fd0b79e36f759c0739d2a86f313c82faa
[server] Specify apns-push-type header for iOS push notifs
[ { "change_type": "MODIFY", "old_path": "server/package.json", "new_path": "server/package.json", "diff": "},\n\"dependencies\": {\n\"JSONStream\": \"^1.3.5\",\n- \"apn\": \"^2.2.0\",\n+ \"apn\": \"git+https://github.com/node-apn/node-apn.git#3.0.0\",\n\"buffer-image-size\": \"^0.6.4\",\n\"common-tags\": \"^1.7.2\",\n\"cookie-parser\": \"^1.4.3\",\n" }, { "change_type": "MODIFY", "old_path": "server/src/push/send.js", "new_path": "server/src/push/send.js", "diff": "@@ -480,6 +480,7 @@ function prepareIOSNotification(\nnotification.badge = unreadCount;\nnotification.threadId = threadInfo.id;\nnotification.id = uniqueID;\n+ notification.pushType = \"alert\";\nnotification.payload.id = uniqueID;\nnotification.payload.threadID = threadInfo.id;\nnotification.payload.messageInfos = JSON.stringify(newRawMessageInfos);\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -2094,6 +2094,16 @@ apn@^2.2.0:\nnode-forge \"^0.7.1\"\nverror \"^1.10.0\"\n+\"apn@git+https://github.com/node-apn/node-apn.git#3.0.0\":\n+ version \"3.0.0\"\n+ resolved \"git+https://github.com/node-apn/node-apn.git#38a357ed0c153aad09c2857e48a710527e685bfc\"\n+ dependencies:\n+ debug \"^3.1.0\"\n+ http2 \"https://github.com/node-apn/node-http2/archive/apn-2.1.4.tar.gz\"\n+ jsonwebtoken \"^8.1.0\"\n+ node-forge \"^0.7.1\"\n+ verror \"^1.10.0\"\n+\nappend-field@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/append-field/-/append-field-1.0.0.tgz#1e3440e915f0b1203d23748e78edd7b9b5b43e56\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Specify apns-push-type header for iOS push notifs
129,187
05.11.2019 11:38:22
18,000
8ce2917e5c6a14f1dd022ba5d04c2d4d09c909dc
[server] Add support for Android smart lock
[ { "change_type": "MODIFY", "old_path": "server/.well-known/assetlinks.json", "new_path": "server/.well-known/assetlinks.json", "diff": "\"78:8A:30:DF:7E:1F:AB:0E:F6:2B:69:8B:98:21:00:FE:97:E7:EB:34:AD:21:45:50:7D:A1:EE:CF:74:C8:FD:0D\"\n]\n}\n+ },\n+ {\n+ \"relation\": [\"delegate_permission/common.get_login_creds\"],\n+ \"target\": {\n+ \"namespace\": \"web\",\n+ \"site\": \"https://squadcal.org\"\n+ }\n+ },\n+ {\n+ \"relation\": [\"delegate_permission/common.get_login_creds\"],\n+ \"target\": {\n+ \"namespace\": \"android_app\",\n+ \"package_name\": \"org.squadcal\",\n+ \"sha256_cert_fingerprints\": [\n+ \"A8:81:32:91:5C:9A:D9:9E:14:68:1B:10:EA:5D:4E:D0:62:D0:BF:13:15:77:AA:BF:1D:C9:E6:67:ED:AD:E7:6F\",\n+ \"78:8A:30:DF:7E:1F:AB:0E:F6:2B:69:8B:98:21:00:FE:97:E7:EB:34:AD:21:45:50:7D:A1:EE:CF:74:C8:FD:0D\"\n+ ]\n+ }\n}\n]\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Add support for Android smart lock