Skip to content

Commit cd6f88e

Browse files
committed
rename night mode to dark theme
1 parent 082b202 commit cd6f88e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+81
-61
lines changed

src/reduxTypes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ export type ThemeName = 'light' | 'dark';
372372
* To determine the actual theme to show the user, use a ThemeName;
373373
* see there for details.
374374
*/
375-
export type ThemeSetting = 'default' | 'night';
375+
export type ThemeSetting = 'default' | 'dark';
376376

377377
/** What browser the user has set to use for opening links in messages.
378378
*

src/settings/SettingsScreen.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ export default function SettingsScreen(props: Props): Node {
3535
const { navigation } = props;
3636

3737
const handleThemeChange = useCallback(() => {
38-
dispatch(setGlobalSettings({ theme: theme === 'default' ? 'night' : 'default' }));
38+
dispatch(setGlobalSettings({ theme: theme === 'default' ? 'dark' : 'default' }));
3939
}, [theme, dispatch]);
4040

4141
return (
4242
<Screen title="Settings">
43-
<SwitchRow label="Dark theme" value={theme === 'night'} onValueChange={handleThemeChange} />
43+
<SwitchRow label="Dark theme" value={theme === 'dark'} onValueChange={handleThemeChange} />
4444
<SwitchRow
4545
label="Open links with in-app browser"
4646
value={shouldUseInAppBrowser(browser)}

src/settings/__tests__/settingsReducer-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ describe('settingsReducer', () => {
7979
test('changes value of a key', () => {
8080
const action = deepFreeze({
8181
type: SET_GLOBAL_SETTINGS,
82-
update: { theme: 'night' },
82+
update: { theme: 'dark' },
8383
});
8484

8585
const expectedState = {
8686
...baseState,
87-
theme: 'night',
87+
theme: 'dark',
8888
};
8989

9090
const actualState = settingsReducer(baseState, action);

src/storage/__tests__/migrations-test.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ describe('migrations', () => {
104104
// What `base` becomes after all migrations.
105105
const endBase = {
106106
...base52,
107-
migrations: { version: 56 },
107+
migrations: { version: 57 },
108108
};
109109

110110
for (const [desc, before, after] of [
@@ -278,6 +278,20 @@ describe('migrations', () => {
278278
},
279279
{ ...endBase, settings: { ...endBase.settings, markMessagesReadOnScroll: 'never' } },
280280
],
281+
[
282+
"check 57 with 'night'",
283+
{ ...base52, migrations: { version: 56 }, settings: { ...base52.settings, theme: 'night' } },
284+
{ ...endBase, settings: { ...endBase.settings, theme: 'dark' } },
285+
],
286+
[
287+
"check 57 with 'default'",
288+
{
289+
...base52,
290+
migrations: { version: 56 },
291+
settings: { ...base52.settings, theme: 'default' },
292+
},
293+
{ ...endBase, settings: { ...endBase.settings, theme: 'default' } },
294+
],
281295
]) {
282296
/* eslint-disable no-loop-func */
283297
test(desc, async () => {

src/storage/migrations.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,12 @@ const migrationsInner: {| [string]: (LessPartialState) => LessPartialState |} =
472472
// Add presenceEnabled to state.realm.
473473
'56': dropCache,
474474

475+
// Rename 'night' to 'dark' in state.settings.theme
476+
'57': state => ({
477+
...state,
478+
settings: { ...state.settings, theme: state.settings.theme === 'night' ? 'dark' : 'default' },
479+
}),
480+
475481
// TIP: When adding a migration, consider just using `dropCache`.
476482
// (See its jsdoc for guidance on when that's the right answer.)
477483
};

static/translations/messages_ar.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
"Learn more": "تعرف على المزيد",
158158
"Full profile": "Full profile",
159159
"Settings": "Settings",
160-
"Dark theme": "الوضع الليلي",
160+
"Night mode": "الوضع الليلي",
161161
"Open links with in-app browser": "افتح الروابط باستخدام متصفح داخل التطبيق",
162162
"Language": "لغة",
163163
"Arabic": "عربي",

static/translations/messages_bg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
"Learn more": "Learn more",
158158
"Full profile": "Full profile",
159159
"Settings": "Настройки",
160-
"Dark theme": "Нощен режим",
160+
"Night mode": "Нощен режим",
161161
"Open links with in-app browser": "Open links with in-app browser",
162162
"Language": "Език",
163163
"Arabic": "Arabic",

static/translations/messages_bn.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
"Learn more": "Learn more",
158158
"Full profile": "Full profile",
159159
"Settings": "সেটিংস",
160-
"Dark theme": "Dark theme",
160+
"Night mode": "Night mode",
161161
"Open links with in-app browser": "Open links with in-app browser",
162162
"Language": "Language",
163163
"Arabic": "Arabic",

static/translations/messages_ca.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
"Learn more": "Més informació",
158158
"Full profile": "Full profile",
159159
"Settings": "Configuració",
160-
"Dark theme": "Mode nocturn",
160+
"Night mode": "Mode nocturn",
161161
"Open links with in-app browser": "Obre els enllaços en el navegador intern",
162162
"Language": "Llengua",
163163
"Arabic": "Àrab",

static/translations/messages_cs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
"Learn more": "Dozvědět se více",
158158
"Full profile": "Celý profil",
159159
"Settings": "Nastavení",
160-
"Dark theme": "Noční režim",
160+
"Night mode": "Noční režim",
161161
"Open links with in-app browser": "Otevírat odkazy v zabudovaném prohlížeči",
162162
"Language": "Jazyk",
163163
"Arabic": "Arabština",

0 commit comments

Comments
 (0)