callstack / callstack/react-theme-provider

Preferred light/dark theme?

オープン
#55 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
467
フォーク
53
PR マージ指標
30日以内にマージされた PR はありません

説明

## Describe the feature

It'd be nice to automatically be able to accommodate a user's preferred light/dark theme preferences.

Perhaps, simplifying the check of `uiMode && UI_MODE_NIGHT_MASK` [on Android](https://developer.android.com/reference/android/content/res/Configuration.html#uiMode) and `traitCollection.userInterfaceStyle` [on iOS](https://developer.apple.com/documentation/uikit/uiuserinterfacestyle).

These both have `undefined`/`unspecified`, `light`, and `dark`/`night`.

Unfortunately, the [built-in react-native uiMode](https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoModule.java#L47) doesn't give this information.

## Motivation

With iOS 13 and Android Q making this sort of theming more integrated (and Google and Apple's own apps supporting the ability to switch at the OS level), it'd be nice to automatically detect what theme the user wants.

I'd rather not force a user to fumble through app settings to configure the theme if they've already got an option to specify it at the OS level.

## Related Issues

I didn't see any at first glance, but I may have missed them.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start by reviewing React Native's AndroidInfoModule entry point and the Android uiMode and iOS traitCollection.userInterfaceStyle APIs cited in the issue. The work is done when the theme provider can distinguish unspecified, light, and dark preferences on both platforms, with behavior covered by appropriate tests.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
android, ios, javascript, react-native
領域
mobile
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。