Skip to content

Commit 725a5ca

Browse files
authored
Renamed "Night mode" to "Dark theme"
Renamed "Night mode" to "Dark theme" throughout the app.
1 parent b6218db commit 725a5ca

File tree

9 files changed

+36
-11
lines changed

9 files changed

+36
-11
lines changed

docs/changelog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,7 +1900,7 @@ Bugfixes and other improvements for your Zulip experience.
19001900
### Highlights for users (since 26.1.124 / 26.2.125)
19011901

19021902
* Highlight colors for code blocks now match the webapp and
1903-
offer more contrast, especially in night mode.
1903+
offer more contrast, especially in Dark theme.
19041904

19051905
Plus, like every release, many other improvements for your Zulip
19061906
experience.
@@ -1919,7 +1919,7 @@ experience.
19191919
### Highlights for users (since 26.1.124 / 26.2.125)
19201920

19211921
* Highlight colors for code blocks now match the webapp and
1922-
offer more contrast, especially in night mode.
1922+
offer more contrast, especially in Dark theme.
19231923

19241924
Plus, like every release, many other improvements for your Zulip
19251925
experience.

src/emoji/codePointMap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ export const override: {| [code: string]: string |} = {
2020

2121
// Fix the "letter" emoji. The codes in Zulip's emoji database would give
2222
// these a text-style rather than emoji-style presentation; that's subtler
23-
// than we want, plus when not in night mode it's actually invisible.
23+
// than we want, plus when not in Dark theme it's actually invisible.
2424
'1f170': '1f170-fe0f', // :a:
2525
'1f171': '1f171-fe0f', // :b:
2626
'1f17e': '1f17e-fe0f', // :o:
2727
'1f17f': '1f17f-fe0f', // :p:
2828
// (Zulip only actually offers a handful of these letter emoji.)
2929

3030
// :check_mark: -> :check: because the former is invisible on a light
31-
// background, i.e. when not in night mode.
31+
// background, i.e. when not in Dark theme.
3232
'2714': '2705',
3333
};
3434

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="Night mode" 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_en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
"Learn more": "Learn more",
163163
"Full profile": "Full profile",
164164
"Settings": "Settings",
165-
"Night mode": "Night mode",
165+
"Dark theme": "Dark theme",
166166
"Open links with in-app browser": "Open links with in-app browser",
167167
"Language": "Language",
168168
"Arabic": "Arabic",

static/translations/messages_tl.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,13 @@
156156
"{realm} is running Zulip Server {serverVersion}, which is unsupported. Please contact your administrator about upgrading.": "{realm} is running Zulip Server {serverVersion}, which is unsupported. Please contact your administrator about upgrading.",
157157
"Learn more": "Learn more",
158158
"Full profile": "Full profile",
159+
<<<<<<< HEAD
160+
"Settings": "Settings",
161+
"Night mode": "Night mode",
162+
=======
159163
"Settings": "Mga Itinakda",
160164
"Night mode": "Night mode",
165+
>>>>>>> c8af6d69ecbed660643facc1e84b416e3dbff879
161166
"Open links with in-app browser": "Open links with in-app browser",
162167
"Language": "Wika",
163168
"Arabic": "Arabic",

0 commit comments

Comments
 (0)