Skip to content

Commit

Permalink
Config to hide chit icon if unclaimed today (#6731)
Browse files Browse the repository at this point in the history
  • Loading branch information
megrogan authored Nov 6, 2024
1 parent c42581c commit 91c3117
Show file tree
Hide file tree
Showing 18 changed files with 30 additions and 4 deletions.
9 changes: 6 additions & 3 deletions frontend/app/src/components/home/nav/LeftNav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import { now } from "../../../stores/time";
import LighteningBolt from "./LighteningBolt.svelte";
import { activityFeedShowing } from "../../../stores/activity";
import { hideChitIcon } from "../../../stores/settings";
import {
AvatarSize,
type CommunitySummary,
Expand Down Expand Up @@ -227,12 +228,14 @@
</LeftNavItem>
{/if}
{#if !$anonUser}
{#if claimChitAvailable}
{#if claimChitAvailable || !$hideChitIcon}
<LeftNavItem
label={i18nKey("dailyChit.extendStreak")}
label={i18nKey(
claimChitAvailable ? "dailyChit.extendStreak" : "dailyChit.viewStreak",
)}
on:click={() => dispatch("claimDailyChit")}>
<div class="hover streak">
<LighteningBolt enabled />
<LighteningBolt enabled={claimChitAvailable} />
</div>
</LeftNavItem>
{/if}
Expand Down
9 changes: 8 additions & 1 deletion frontend/app/src/components/home/profile/ChitEvents.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import ChitBalance from "./ChitBalance.svelte";
import Toggle from "../../Toggle.svelte";
import { i18nKey } from "../../../i18n/i18n";
import { chitPopup, utcMode } from "../../../stores/settings";
import { chitPopup, hideChitIcon, utcMode } from "../../../stores/settings";
import Translatable from "../../Translatable.svelte";
import { menuCloser } from "../../../actions/closeMenu";
Expand Down Expand Up @@ -130,6 +130,13 @@
on:change={() => chitPopup.set(!$chitPopup)}
label={i18nKey("learnToEarn.showChitPopup")}
checked={$chitPopup} />

<Toggle
id={"hide-chit-icon"}
small
on:change={() => hideChitIcon.set(!$hideChitIcon)}
label={i18nKey("dailyChit.hideWhenClaimed")}
checked={$hideChitIcon} />
</div>

<style lang="scss">
Expand Down
1 change: 1 addition & 0 deletions frontend/app/src/i18n/cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
"claim": "索取 CHIT!",
"comeback": "回到 {time}",
"extendStreak": "延长连胜",
"hideWhenClaimed": "每天领取后隐藏领取筹码图标⚡️",
"info": "您维持连续记录的时间越长,您每天可领取的 CHIT 就越多!",
"title": "保持连胜",
"utcInfo": "CHIT 连续性和领取窗口使用 UTC 表示,因此您可能会发现以 UTC 而不是当地时区查看日历更清楚。",
Expand Down
1 change: 1 addition & 0 deletions frontend/app/src/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
"claim": "Fordern Sie CHIT an!",
"comeback": "Kommen Sie in {time} wieder",
"extendStreak": "Serie verlängern",
"hideWhenClaimed": "Anspruchsbeleg-Symbol ⚡️ nach jedem Anspruch ausblenden",
"info": "Je länger Sie Ihre Serie aufrechterhalten, desto mehr CHIT können Sie täglich beanspruchen!",
"title": "Behalten Sie Ihre Serie bei",
"utcInfo": "CHIT-Streaks und Anspruchsfenster werden mithilfe der UTC dargestellt, daher ist es für Sie möglicherweise übersichtlicher, Ihren Kalender in UTC statt in Ihrer lokalen Zeitzone anzuzeigen.",
Expand Down
1 change: 1 addition & 0 deletions frontend/app/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
"claim": "Claim CHIT!",
"comeback": "Come back in {time}",
"extendStreak": "Extend streak",
"hideWhenClaimed": "Hide claim chit icon ⚡️ after claiming each day",
"info": "The longer you maintain your streak the more daily CHIT you can claim!",
"title": "Maintain your streak",
"utcInfo": "CHIT streaks and claim windows are represented using UTC so you may find it clearer to view your calendar in UTC rather than your local timezone.",
Expand Down
1 change: 1 addition & 0 deletions frontend/app/src/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
"claim": "¡Reclama CHIT!",
"comeback": "Vuelve en {time}",
"extendStreak": "Extender racha",
"hideWhenClaimed": "Ocultar el icono de comprobante de reclamo ⚡️ después de reclamar cada día",
"info": "¡Cuanto más tiempo mantengas tu racha, más CHIT diario podrás reclamar!",
"title": "Mantén tu racha",
"utcInfo": "Las rachas de CHIT y las ventanas de reclamo se representan usando UTC, por lo que puede resultarle más claro ver su calendario en UTC en lugar de su zona horaria local.",
Expand Down
1 change: 1 addition & 0 deletions frontend/app/src/i18n/fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
"claim": "ادعای CHIT!",
"comeback": "به {time} برگرد",
"extendStreak": "گسترش خط",
"hideWhenClaimed": "پس از هر روز ادعای ادعا، نماد چیت ادعا را مخفی کنید",
"info": "هرچه مدت طولانی تری رگ خود را حفظ کنید، CHIT روزانه بیشتری می توانید ادعا کنید!",
"title": "خط خود را حفظ کنید",
"utcInfo": "رگه‌های CHIT و پنجره‌های ادعا با استفاده از UTC نشان داده می‌شوند، بنابراین ممکن است مشاهده تقویم خود در UTC به جای منطقه زمانی محلی‌تان واضح‌تر باشد.",
Expand Down
1 change: 1 addition & 0 deletions frontend/app/src/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
"claim": "Réclamez CHIT !",
"comeback": "Revenez dans {time}",
"extendStreak": "Prolonger la séquence",
"hideWhenClaimed": "Masquer l'icône de réclamation ⚡️ après avoir réclamé chaque jour",
"info": "Plus vous maintenez votre séquence longtemps, plus vous pouvez réclamer de CHIT quotidien !",
"title": "Maintenez votre séquence",
"utcInfo": "Les séquences CHIT et les fenêtres de réclamation sont représentées en UTC afin que vous puissiez trouver plus clair d'afficher votre calendrier en UTC plutôt que dans votre fuseau horaire local.",
Expand Down
1 change: 1 addition & 0 deletions frontend/app/src/i18n/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
"claim": "चिट का दावा करें!",
"comeback": "{time} में वापस आ जाओ",
"extendStreak": "लकीर बढ़ाएँ",
"hideWhenClaimed": "प्रत्येक दिन दावा करने के बाद दावा चिट आइकन ⚡️ छिपाएँ",
"info": "आप जितना अधिक समय तक अपना क्रम बनाए रखेंगे, उतना ही अधिक दैनिक CHIT आप प्राप्त कर सकेंगे!",
"title": "अपना क्रम बनाए रखें",
"utcInfo": "CHIT स्ट्रीक्स और दावा विंडो को UTC का उपयोग करके दर्शाया जाता है, इसलिए आपको अपने कैलेंडर को अपने स्थानीय समय क्षेत्र के बजाय UTC में देखना अधिक स्पष्ट लगेगा।",
Expand Down
1 change: 1 addition & 0 deletions frontend/app/src/i18n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
"claim": "Richiedi CHIT!",
"comeback": "Torna tra {time}",
"extendStreak": "Estendi la serie",
"hideWhenClaimed": "Nascondi l'icona del buono di richiesta ⚡️ dopo aver effettuato la richiesta ogni giorno",
"info": "Più a lungo mantieni la tua serie, più CHIT giornalieri puoi richiedere!",
"title": "Mantieni la tua serie",
"utcInfo": "Le serie CHIT e le finestre di reclamo sono rappresentate utilizzando l'UTC, quindi potresti trovare più chiaro visualizzare il tuo calendario in UTC anziché nel fuso orario locale.",
Expand Down
1 change: 1 addition & 0 deletions frontend/app/src/i18n/iw.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
"claim": "טען CHIT!",
"comeback": "חזור ב-{time}",
"extendStreak": "להאריך את הרצף",
"hideWhenClaimed": "הסתר את סמל התביעה ⚡️ לאחר התביעה בכל יום",
"info": "ככל שתשמור על הרצף שלך זמן רב יותר, כך תוכל לתבוע יותר CHIT יומי!",
"title": "שמור על הרצף שלך",
"utcInfo": "פסי CHIT וחלונות תביעה מיוצגים באמצעות UTC כך שייתכן שיהיה ברור יותר להציג את היומן שלך ב-UTC ולא באזור הזמן המקומי שלך.",
Expand Down
1 change: 1 addition & 0 deletions frontend/app/src/i18n/jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
"claim": "CHITを請求してください!",
"comeback": "{time}に戻ってきて",
"extendStreak": "連勝を伸ばす",
"hideWhenClaimed": "毎日請求した後、請求チットアイコン⚡️を非表示にします",
"info": "連続記録を長く維持すればするほど、より多くの CHIT を毎日獲得できます。",
"title": "連勝を維持する",
"utcInfo": "CHIT 連続記録と請求期間は UTC を使用して表されるため、ローカル タイムゾーンではなく UTC でカレンダーを表示する方がわかりやすい場合があります。",
Expand Down
1 change: 1 addition & 0 deletions frontend/app/src/i18n/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
"claim": "Zgłoś CHIT!",
"comeback": "Wróć za {time}",
"extendStreak": "Przedłuż passę",
"hideWhenClaimed": "Ukryj ikonę potwierdzenia odbioru ⚡️ po odebraniu przesyłki każdego dnia",
"info": "Im dłużej utrzymasz swoją passę, tym więcej codziennych CHITów możesz odebrać!",
"title": "Utrzymaj swoją passę",
"utcInfo": "Smugi CHIT i okna roszczeń są reprezentowane przy użyciu czasu UTC, dzięki czemu przeglądanie kalendarza w formacie UTC może być wyraźniejsze, a nie lokalnej strefy czasowej.",
Expand Down
1 change: 1 addition & 0 deletions frontend/app/src/i18n/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
"claim": "Заявите ЧИТ!",
"comeback": "Вернись через {time}",
"extendStreak": "Продлить серию",
"hideWhenClaimed": "Скрыть значок заявки ⚡️ после подачи заявки каждый день",
"info": "Чем дольше вы поддерживаете свою серию, тем больше ежедневных ЧИТов вы можете претендовать!",
"title": "Поддерживайте свою серию",
"utcInfo": "Полосы CHIT и окна претензий представлены в формате UTC, поэтому вам будет удобнее просматривать календарь в формате UTC, а не в местном часовом поясе.",
Expand Down
1 change: 1 addition & 0 deletions frontend/app/src/i18n/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
"claim": "Вимагайте CHIT!",
"comeback": "Повертайтеся через {time}",
"extendStreak": "Подовжити смугу",
"hideWhenClaimed": "Приховувати піктограму заявки ⚡️ щодня після подання претензії",
"info": "Чим довше ви збережете свою серію, тим більше щоденних CHIT ви зможете отримати!",
"title": "Зберігайте свою серію",
"utcInfo": "Смуги CHIT і вікна заявок представлені за UTC, тому вам може бути зрозуміліше переглядати свій календар за UTC, а не за місцевим часовим поясом.",
Expand Down
1 change: 1 addition & 0 deletions frontend/app/src/i18n/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
"claim": "Yêu cầu CHIT!",
"comeback": "Hãy quay lại trong {time}",
"extendStreak": "Kéo dài vệt",
"hideWhenClaimed": "Ẩn biểu tượng yêu cầu ⚡️ sau khi yêu cầu mỗi ngày",
"info": "Bạn duy trì chuỗi của mình càng lâu thì bạn càng có thể yêu cầu nhiều CHIT hàng ngày hơn!",
"title": "Duy trì thành tích của bạn",
"utcInfo": "Các chuỗi CHIT và khoảng thời gian xác nhận quyền sở hữu được thể hiện bằng UTC nên bạn có thể thấy lịch của mình theo UTC rõ ràng hơn thay vì múi giờ địa phương.",
Expand Down
1 change: 1 addition & 0 deletions frontend/app/src/stores/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const showHomeScreenPrompt = createLsBoolStore(
mobileOperatingSystem === "iOS",
);
export const chitPopup = createLsBoolStore(configKeys.chitPopup, true);
export const hideChitIcon = createLsBoolStore(configKeys.hideChitIcon, false);
export const enterSend = createLsBoolStore(configKeys.enterSend, !isTouchDevice);
export const lowBandwidth = createLsBoolStore(configKeys.lowBandwidth, false);
export const renderPreviews = createLsBoolStore(configKeys.renderPreviews, true);
Expand Down
1 change: 1 addition & 0 deletions frontend/app/src/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const configKeys = {
fontSize: "openchat_font_size",
enterSend: "openchat_entersend",
chitPopup: "openchat_chit_popup",
hideChitIcon: "openchat_hide_chit_icon",
showHomeScreenPrompt: "openchat_show_home_screen_prompt",
userInfoSection: "openchat_userinfo_section",
appearanceSection: "openchat_appearance_section",
Expand Down

0 comments on commit 91c3117

Please sign in to comment.