add translate on toggle theme mode (#501)

This commit is contained in:
wengtad 2021-06-13 03:48:09 +08:00 committed by GitHub
parent 7d8e2754d7
commit f0afe67158
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View File

@ -18,9 +18,14 @@
</div> </div>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn icon class="mr-1" small @click="isDark = !isDark"> <v-tooltip bottom>
<v-icon v-text="isDark ? 'mdi-weather-night' : 'mdi-weather-sunny'"> </v-icon> <template v-slot:activator="{ on, attrs }">
</v-btn> <v-btn icon class="mr-1" small v-bind="attrs" v-on="on" @click="isDark = !isDark">
<v-icon v-text="isDark ? 'mdi-weather-sunny' : 'mdi-weather-night'"> </v-icon>
</v-btn>
</template>
<span>{{ isDark ? $t("settings.theme.switch-to-light-mode") : $t("settings.theme.switch-to-dark-mode") }}</span>
</v-tooltip>
<div v-if="!isMobile" style="width: 350px;"> <div v-if="!isMobile" style="width: 350px;">
<SearchBar :show-results="true" @selected="navigateFromSearch" :max-width="isMobile ? '100%' : '450px'" /> <SearchBar :show-results="true" @selected="navigateFromSearch" :max-width="isMobile ? '100%' : '450px'" />
</div> </div>
@ -88,7 +93,6 @@ export default {
this.$router.push(`/recipe/${slug}`); this.$router.push(`/recipe/${slug}`);
}, },
openSidebar() { openSidebar() {
console.log(this.isDarkMode);
this.$refs.theSidebar.toggleSidebar(); this.$refs.theSidebar.toggleSidebar();
}, },
}, },

View File

@ -339,7 +339,9 @@
"theme-saved": "Theme Saved", "theme-saved": "Theme Saved",
"theme-settings": "Theme Settings", "theme-settings": "Theme Settings",
"theme-updated": "Theme updated", "theme-updated": "Theme updated",
"warning": "Warning" "warning": "Warning",
"switch-to-light-mode": "Switch to light mode",
"switch-to-dark-mode": "Switch to dark mode"
}, },
"token": { "token": {
"active-tokens": "ACTIVE TOKENS", "active-tokens": "ACTIVE TOKENS",