Skip to content

Commit

Permalink
rename night mode to dark theme
Browse files Browse the repository at this point in the history
  • Loading branch information
aritroCoder committed Dec 14, 2022
1 parent 082b202 commit cd6f88e
Show file tree
Hide file tree
Showing 60 changed files with 81 additions and 61 deletions.
2 changes: 1 addition & 1 deletion src/reduxTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ export type ThemeName = 'light' | 'dark';
* To determine the actual theme to show the user, use a ThemeName;
* see there for details.
*/
export type ThemeSetting = 'default' | 'night';
export type ThemeSetting = 'default' | 'dark';

/** What browser the user has set to use for opening links in messages.
*
Expand Down
4 changes: 2 additions & 2 deletions src/settings/SettingsScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ export default function SettingsScreen(props: Props): Node {
const { navigation } = props;

const handleThemeChange = useCallback(() => {
dispatch(setGlobalSettings({ theme: theme === 'default' ? 'night' : 'default' }));
dispatch(setGlobalSettings({ theme: theme === 'default' ? 'dark' : 'default' }));
}, [theme, dispatch]);

return (
<Screen title="Settings">
<SwitchRow label="Dark theme" value={theme === 'night'} onValueChange={handleThemeChange} />
<SwitchRow label="Dark theme" value={theme === 'dark'} onValueChange={handleThemeChange} />
<SwitchRow
label="Open links with in-app browser"
value={shouldUseInAppBrowser(browser)}
Expand Down
4 changes: 2 additions & 2 deletions src/settings/__tests__/settingsReducer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ describe('settingsReducer', () => {
test('changes value of a key', () => {
const action = deepFreeze({
type: SET_GLOBAL_SETTINGS,
update: { theme: 'night' },
update: { theme: 'dark' },
});

const expectedState = {
...baseState,
theme: 'night',
theme: 'dark',
};

const actualState = settingsReducer(baseState, action);
Expand Down
16 changes: 15 additions & 1 deletion src/storage/__tests__/migrations-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe('migrations', () => {
// What `base` becomes after all migrations.
const endBase = {
...base52,
migrations: { version: 56 },
migrations: { version: 57 },
};

for (const [desc, before, after] of [
Expand Down Expand Up @@ -278,6 +278,20 @@ describe('migrations', () => {
},
{ ...endBase, settings: { ...endBase.settings, markMessagesReadOnScroll: 'never' } },
],
[
"check 57 with 'night'",
{ ...base52, migrations: { version: 56 }, settings: { ...base52.settings, theme: 'night' } },
{ ...endBase, settings: { ...endBase.settings, theme: 'dark' } },
],
[
"check 57 with 'default'",
{
...base52,
migrations: { version: 56 },
settings: { ...base52.settings, theme: 'default' },
},
{ ...endBase, settings: { ...endBase.settings, theme: 'default' } },
],
]) {
/* eslint-disable no-loop-func */
test(desc, async () => {
Expand Down
6 changes: 6 additions & 0 deletions src/storage/migrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,12 @@ const migrationsInner: {| [string]: (LessPartialState) => LessPartialState |} =
// Add presenceEnabled to state.realm.
'56': dropCache,

// Rename 'night' to 'dark' in state.settings.theme
'57': state => ({
...state,
settings: { ...state.settings, theme: state.settings.theme === 'night' ? 'dark' : 'default' },
}),

// TIP: When adding a migration, consider just using `dropCache`.
// (See its jsdoc for guidance on when that's the right answer.)
};
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "تعرف على المزيد",
"Full profile": "Full profile",
"Settings": "Settings",
"Dark theme": "الوضع الليلي",
"Night mode": "الوضع الليلي",
"Open links with in-app browser": "افتح الروابط باستخدام متصفح داخل التطبيق",
"Language": "لغة",
"Arabic": "عربي",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Learn more",
"Full profile": "Full profile",
"Settings": "Настройки",
"Dark theme": "Нощен режим",
"Night mode": "Нощен режим",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "Език",
"Arabic": "Arabic",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Learn more",
"Full profile": "Full profile",
"Settings": "সেটিংস",
"Dark theme": "Dark theme",
"Night mode": "Night mode",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "Language",
"Arabic": "Arabic",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Més informació",
"Full profile": "Full profile",
"Settings": "Configuració",
"Dark theme": "Mode nocturn",
"Night mode": "Mode nocturn",
"Open links with in-app browser": "Obre els enllaços en el navegador intern",
"Language": "Llengua",
"Arabic": "Àrab",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Dozvědět se více",
"Full profile": "Celý profil",
"Settings": "Nastavení",
"Dark theme": "Noční režim",
"Night mode": "Noční režim",
"Open links with in-app browser": "Otevírat odkazy v zabudovaném prohlížeči",
"Language": "Jazyk",
"Arabic": "Arabština",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_cy.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Dysgu mwy",
"Full profile": "Full profile",
"Settings": "Gosodiadau",
"Dark theme": "Modd nos",
"Night mode": "Modd nos",
"Open links with in-app browser": "Agor dolenni gyda porwr mewn-app",
"Language": "Iaith",
"Arabic": "Arabeg",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_da.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Learn more",
"Full profile": "Full profile",
"Settings": "Settings",
"Dark theme": "Dark theme",
"Night mode": "Night mode",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "Sprog",
"Arabic": "Arabisk",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_de.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Mehr erfahren",
"Full profile": "Vollständiges Profil",
"Settings": "Einstellungen",
"Dark theme": "Nachtmodus",
"Night mode": "Nachtmodus",
"Open links with in-app browser": "Links mit in-app Browser öffnen",
"Language": "Sprache",
"Arabic": "Arabisch",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_el.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Learn more",
"Full profile": "Full profile",
"Settings": "Settings",
"Dark theme": "Dark theme",
"Night mode": "Night mode",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "Language",
"Arabic": "Arabic",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_el_GR.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Learn more",
"Full profile": "Full profile",
"Settings": "Settings",
"Dark theme": "Dark theme",
"Night mode": "Night mode",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "Language",
"Arabic": "Arabic",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_en_GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Learn more",
"Full profile": "Full profile",
"Settings": "Settings",
"Dark theme": "Dark theme",
"Night mode": "Night mode",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "Language",
"Arabic": "Arabic",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_en_NG.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"Learn more": "Learn more",
"Full profile": "Full profile",
"Settings": "Settings",
"Dark theme": "Dark theme",
"Night mode": "Night mode",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "Language",
"Arabic": "Arabic",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_eo.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Learn more",
"Full profile": "Full profile",
"Settings": "Settings",
"Dark theme": "Dark theme",
"Night mode": "Night mode",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "Language",
"Arabic": "Arabic",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_es.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Aprender más",
"Full profile": "Full profile",
"Settings": "Ajustes",
"Dark theme": "Modo noche",
"Night mode": "Modo noche",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "Idioma",
"Arabic": "Árabe",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Learn more",
"Full profile": "Full profile",
"Settings": "تنظیمات",
"Dark theme": "حالت شبانه",
"Night mode": "حالت شبانه",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "زبان",
"Arabic": "عربی",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Lisätietoja",
"Full profile": "Täysi profiili",
"Settings": "Asetukset",
"Dark theme": "Yötila",
"Night mode": "Yötila",
"Open links with in-app browser": "Avaa linkit sovelluksen sisäisellä selaimella",
"Language": "Kieli",
"Arabic": "Arabia",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "En apprendre plus",
"Full profile": "Profil complet",
"Settings": "Paramètres",
"Dark theme": "Mode nuit",
"Night mode": "Mode nuit",
"Open links with in-app browser": "Ouvrir les liens avec le navigateur intégré",
"Language": "Langue",
"Arabic": "Arabe",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_gl.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Learn more",
"Full profile": "Full profile",
"Settings": "Configuración",
"Dark theme": "Modo nocturno",
"Night mode": "Modo nocturno",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "Lingua",
"Arabic": "Arabic",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_gu.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Learn more",
"Full profile": "Full profile",
"Settings": "Settings",
"Dark theme": "Dark theme",
"Night mode": "Night mode",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "Language",
"Arabic": "Arabic",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Learn more",
"Full profile": "Full profile",
"Settings": "सेटिंग्स",
"Dark theme": "रात्री स्वरुप",
"Night mode": "रात्री स्वरुप",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "भाषा",
"Arabic": "अरबी",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_hr.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Learn more",
"Full profile": "Full profile",
"Settings": "Settings",
"Dark theme": "Dark theme",
"Night mode": "Night mode",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "Language",
"Arabic": "Arabic",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Tudj meg többet",
"Full profile": "Teljes profil",
"Settings": "Beállítások",
"Dark theme": "Éjszakai mód",
"Night mode": "Éjszakai mód",
"Open links with in-app browser": "A linkek appon belüli böngészővel nyíljanak meg",
"Language": "Nyelv",
"Arabic": "Arab",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_id.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Learn more",
"Full profile": "Full profile",
"Settings": "Pengaturan",
"Dark theme": "Mode malam",
"Night mode": "Mode malam",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "Bahasa",
"Arabic": "Arabic",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_it.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Per saperne di più.",
"Full profile": "Profilo completo",
"Settings": "Impostazioni",
"Dark theme": "Modalità notturna",
"Night mode": "Modalità notturna",
"Open links with in-app browser": "Apri i link con il browser dell'app",
"Language": "Lingua",
"Arabic": "Arabo",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "詳細",
"Full profile": "全てのプロフィール",
"Settings": "設定",
"Dark theme": "夜間モード",
"Night mode": "夜間モード",
"Open links with in-app browser": "リンクをアプリ内ブラウザで開く",
"Language": "言語",
"Arabic": "アラビア語",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "좀 더 알아보기",
"Full profile": "Full profile",
"Settings": "설정",
"Dark theme": "야간모드",
"Night mode": "야간모드",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "언어",
"Arabic": "Arabic",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_lt.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Learn more",
"Full profile": "Full profile",
"Settings": "Nustatymai",
"Dark theme": "Dark theme",
"Night mode": "Night mode",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "Language",
"Arabic": "Arabic",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_ml.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Learn more",
"Full profile": "Full profile",
"Settings": "സജ്ജീകരണങ്ങൾ",
"Dark theme": "Dark theme",
"Night mode": "Night mode",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "Language",
"Arabic": "Arabic",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_mn.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Илүү ихийг харах",
"Full profile": "Full profile",
"Settings": "Тохиргоо",
"Dark theme": "Хар төлөв",
"Night mode": "Хар төлөв",
"Open links with in-app browser": "Өөр browser дээр холбоосыг нээх",
"Language": "Хэл",
"Arabic": "Arabic",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_my.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Learn more",
"Full profile": "Full profile",
"Settings": "Settings",
"Dark theme": "Dark theme",
"Night mode": "Night mode",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "Language",
"Arabic": "Arabic",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Learn more",
"Full profile": "Full profile",
"Settings": "Instellingen",
"Dark theme": "Nachtstand",
"Night mode": "Nachtstand",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "Taal",
"Arabic": "Arabisch",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_no.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Learn more",
"Full profile": "Full profile",
"Settings": "Innstillinger",
"Dark theme": "Dark theme",
"Night mode": "Night mode",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "Language",
"Arabic": "Arabic",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_pa.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Learn more",
"Full profile": "Full profile",
"Settings": "Settings",
"Dark theme": "Dark theme",
"Night mode": "Night mode",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "Language",
"Arabic": "Arabic",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_pcm.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Learn more",
"Full profile": "Full profile",
"Settings": "Settings",
"Dark theme": "Dark theme",
"Night mode": "Night mode",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "Language",
"Arabic": "Arabic",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/messages_pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"Learn more": "Learn more",
"Full profile": "Full profile",
"Settings": "Ustawienia",
"Dark theme": "Tryb nocny",
"Night mode": "Tryb nocny",
"Open links with in-app browser": "Open links with in-app browser",
"Language": "Język",
"Arabic": "Arabski",
Expand Down
Loading

0 comments on commit cd6f88e

Please sign in to comment.