mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-23 05:21:15 +00:00
feat(vacay): thin the mobile person card down to the number you act on
Used, carried over, comp days and remaining all fit a desktop sidebar; on a phone they collapsed into four scraps of 9px text fighting for one row. Only the balance is left, as a pill tinted by how much of it there is — the rest is still a tap away in the entitlement view. The toolbar chip says "Company" rather than "Company Holiday": it sits beside two other buttons and the building icon already carries the meaning. The allowance stepper reads "Days" instead of "days / year", reusing the label the desktop entitlement tile has always used — the year is on the pill above it.
This commit is contained in:
@@ -11,6 +11,9 @@ import MVacaySettingsSheet from './MVacaySettingsSheet'
|
||||
import MVacayShareSheet from './MVacayShareSheet'
|
||||
import { FALLBACK_PERSON_COLOR } from './vacayDayModel'
|
||||
|
||||
/** Half days (#552) make the balance fractional; one decimal is exact and never drifts. */
|
||||
const fmtDays = (n: number) => (Number.isInteger(n) ? String(n) : n.toFixed(1))
|
||||
|
||||
const WEEKDAY_KEYS_MONDAY = ['vacay.mon', 'vacay.tue', 'vacay.wed', 'vacay.thu', 'vacay.fri', 'vacay.sat', 'vacay.sun'] as const
|
||||
const WEEKDAY_KEYS_SUNDAY = ['vacay.sun', 'vacay.mon', 'vacay.tue', 'vacay.wed', 'vacay.thu', 'vacay.fri', 'vacay.sat'] as const
|
||||
|
||||
@@ -78,23 +81,16 @@ export default function MVacay() {
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="text-[0.875rem] font-extrabold">{v.selectedUser.username}</div>
|
||||
<MProgress value={pct} color={v.selectedColor} className="mt-[6px]" />
|
||||
<div className="mt-[5px] flex items-center justify-between">
|
||||
<span className="font-geist text-[0.5625rem] font-bold text-m-muted">
|
||||
{t('mobileVacay.usedCount', { count: stat.used })}
|
||||
</span>
|
||||
{stat.carried_over > 0 && (
|
||||
<span className="font-geist text-[0.5625rem] font-bold text-[color:var(--m-st-pending)]">
|
||||
+{stat.carried_over} {v.isShiftedYear ? t('vacay.carriedOverPrevPeriod') : t('vacay.carriedOver', { year: v.selectedYear - 1 })}
|
||||
</span>
|
||||
)}
|
||||
{/* Comp / flex days (#1074) sit outside used/left — they cost nothing. */}
|
||||
{(stat.comp_used ?? 0) > 0 && (
|
||||
<span className="font-geist text-[0.5625rem] font-bold text-m-muted">
|
||||
{t('vacay.compUsedCount', { count: stat.comp_used })}
|
||||
</span>
|
||||
)}
|
||||
<span className="font-geist text-[0.5625rem] font-extrabold" style={{ color: leftColor }}>
|
||||
{t('mobileVacay.leftCount', { count: stat.remaining })}
|
||||
{/* Used, carried over and comp days all fit on a desktop sidebar; on a
|
||||
phone they turn into four scraps of 9px text. Only the number you
|
||||
act on stays — the rest is a tap away in the entitlement view. */}
|
||||
<div className="mt-[6px] flex items-center">
|
||||
<span
|
||||
className="inline-flex items-center gap-[3px] rounded-full px-[8px] py-[2px] font-geist text-[0.625rem] font-bold"
|
||||
style={{ background: `${leftColor}1f`, border: `1px solid ${leftColor}47`, color: leftColor }}
|
||||
>
|
||||
<span className="font-extrabold tabular-nums">{fmtDays(stat.remaining)}</span>
|
||||
{t('mobileVacay.left')}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -110,7 +106,7 @@ export default function MVacay() {
|
||||
<div className="min-w-[40px] text-center">
|
||||
<div className="text-[1.1875rem] font-extrabold leading-none tabular-nums">{stat.vacation_days}</div>
|
||||
<div className="font-geist text-[0.5rem] font-bold uppercase tracking-[.06em] text-m-faint">
|
||||
{t('mobileVacay.daysPerYear')}
|
||||
{t('vacay.entitlementDays')}
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
@@ -266,7 +262,7 @@ export default function MVacay() {
|
||||
}`}
|
||||
>
|
||||
<Building2 size={13} strokeWidth={2.2} />
|
||||
{t('vacay.modeCompany')}
|
||||
{t('mobileVacay.modeCompany')}
|
||||
</button>
|
||||
)}
|
||||
{/* Divider — comp/flex and half-day modify the selected person's logging, they aren't modes. */}
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': 'الشهر التالي',
|
||||
'mobileVacay.usedCount': '{count} مستخدَمة',
|
||||
'mobileVacay.leftCount': '{count} متبقية',
|
||||
'mobileVacay.daysPerYear': 'يوم / سنة',
|
||||
'mobileVacay.left': 'متبقية',
|
||||
'mobileVacay.modeCompany': 'الشركة',
|
||||
'mobileVacay.decreaseAllowance': 'تقليل الرصيد',
|
||||
'mobileVacay.increaseAllowance': 'زيادة الرصيد',
|
||||
'mobileVacay.companyLegend': 'أيام الشركة',
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': 'Próximo mês',
|
||||
'mobileVacay.usedCount': '{count} usados',
|
||||
'mobileVacay.leftCount': '{count} restantes',
|
||||
'mobileVacay.daysPerYear': 'dias / ano',
|
||||
'mobileVacay.left': 'restantes',
|
||||
'mobileVacay.modeCompany': 'Empresa',
|
||||
'mobileVacay.decreaseAllowance': 'Diminuir cota',
|
||||
'mobileVacay.increaseAllowance': 'Aumentar cota',
|
||||
'mobileVacay.companyLegend': 'Férias coletivas',
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': 'Mes següent',
|
||||
'mobileVacay.usedCount': '{count} usats',
|
||||
'mobileVacay.leftCount': '{count} restants',
|
||||
'mobileVacay.daysPerYear': 'dies / any',
|
||||
'mobileVacay.left': 'restants',
|
||||
'mobileVacay.modeCompany': 'Empresa',
|
||||
'mobileVacay.decreaseAllowance': "Redueix l'assignació",
|
||||
'mobileVacay.increaseAllowance': "Augmenta l'assignació",
|
||||
'mobileVacay.companyLegend': "Dies d'empresa",
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': 'Další měsíc',
|
||||
'mobileVacay.usedCount': '{count} využito',
|
||||
'mobileVacay.leftCount': 'Zbývá {count}',
|
||||
'mobileVacay.daysPerYear': 'dní / rok',
|
||||
'mobileVacay.left': 'zbývá',
|
||||
'mobileVacay.modeCompany': 'Firma',
|
||||
'mobileVacay.decreaseAllowance': 'Snížit nárok',
|
||||
'mobileVacay.increaseAllowance': 'Zvýšit nárok',
|
||||
'mobileVacay.companyLegend': 'Firemní dny',
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': 'Nächster Monat',
|
||||
'mobileVacay.usedCount': '{count} genommen',
|
||||
'mobileVacay.leftCount': '{count} übrig',
|
||||
'mobileVacay.daysPerYear': 'Tage / Jahr',
|
||||
'mobileVacay.left': 'übrig',
|
||||
'mobileVacay.modeCompany': 'Betrieb',
|
||||
'mobileVacay.decreaseAllowance': 'Anspruch verringern',
|
||||
'mobileVacay.increaseAllowance': 'Anspruch erhöhen',
|
||||
'mobileVacay.companyLegend': 'Betriebsferien',
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': 'Next month',
|
||||
'mobileVacay.usedCount': '{count} used',
|
||||
'mobileVacay.leftCount': '{count} left',
|
||||
'mobileVacay.daysPerYear': 'days / year',
|
||||
'mobileVacay.left': 'left',
|
||||
'mobileVacay.modeCompany': 'Company',
|
||||
'mobileVacay.decreaseAllowance': 'Decrease allowance',
|
||||
'mobileVacay.increaseAllowance': 'Increase allowance',
|
||||
'mobileVacay.companyLegend': 'Company days',
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': 'Mes siguiente',
|
||||
'mobileVacay.usedCount': '{count} usados',
|
||||
'mobileVacay.leftCount': '{count} restantes',
|
||||
'mobileVacay.daysPerYear': 'días / año',
|
||||
'mobileVacay.left': 'restantes',
|
||||
'mobileVacay.modeCompany': 'Empresa',
|
||||
'mobileVacay.decreaseAllowance': 'Reducir asignación',
|
||||
'mobileVacay.increaseAllowance': 'Aumentar asignación',
|
||||
'mobileVacay.companyLegend': 'Días de empresa',
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': 'Mois suivant',
|
||||
'mobileVacay.usedCount': '{count} pris',
|
||||
'mobileVacay.leftCount': '{count} restants',
|
||||
'mobileVacay.daysPerYear': 'jours / an',
|
||||
'mobileVacay.left': 'restants',
|
||||
'mobileVacay.modeCompany': 'Entreprise',
|
||||
'mobileVacay.decreaseAllowance': 'Diminuer le quota',
|
||||
'mobileVacay.increaseAllowance': 'Augmenter le quota',
|
||||
'mobileVacay.companyLegend': 'Congés d\'entreprise',
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': 'Επόμενος μήνας',
|
||||
'mobileVacay.usedCount': '{count} σε χρήση',
|
||||
'mobileVacay.leftCount': '{count} απομένουν',
|
||||
'mobileVacay.daysPerYear': 'ημέρες / έτος',
|
||||
'mobileVacay.left': 'απομένουν',
|
||||
'mobileVacay.modeCompany': 'Εταιρεία',
|
||||
'mobileVacay.decreaseAllowance': 'Μείωση δικαιώματος',
|
||||
'mobileVacay.increaseAllowance': 'Αύξηση δικαιώματος',
|
||||
'mobileVacay.companyLegend': 'Άδεια εταιρείας',
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': 'Következő hónap',
|
||||
'mobileVacay.usedCount': '{count} felhasználva',
|
||||
'mobileVacay.leftCount': '{count} maradt',
|
||||
'mobileVacay.daysPerYear': 'nap / év',
|
||||
'mobileVacay.left': 'maradt',
|
||||
'mobileVacay.modeCompany': 'Céges',
|
||||
'mobileVacay.decreaseAllowance': 'Keret csökkentése',
|
||||
'mobileVacay.increaseAllowance': 'Keret növelése',
|
||||
'mobileVacay.companyLegend': 'Céges szabadság',
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': 'Bulan berikutnya',
|
||||
'mobileVacay.usedCount': '{count} terpakai',
|
||||
'mobileVacay.leftCount': '{count} tersisa',
|
||||
'mobileVacay.daysPerYear': 'hari / tahun',
|
||||
'mobileVacay.left': 'tersisa',
|
||||
'mobileVacay.modeCompany': 'Perusahaan',
|
||||
'mobileVacay.decreaseAllowance': 'Kurangi jatah',
|
||||
'mobileVacay.increaseAllowance': 'Tambah jatah',
|
||||
'mobileVacay.companyLegend': 'Libur perusahaan',
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': 'Mese successivo',
|
||||
'mobileVacay.usedCount': '{count} usati',
|
||||
'mobileVacay.leftCount': '{count} rimanenti',
|
||||
'mobileVacay.daysPerYear': 'giorni / anno',
|
||||
'mobileVacay.left': 'rimanenti',
|
||||
'mobileVacay.modeCompany': 'Azienda',
|
||||
'mobileVacay.decreaseAllowance': 'Riduci giorni disponibili',
|
||||
'mobileVacay.increaseAllowance': 'Aumenta giorni disponibili',
|
||||
'mobileVacay.companyLegend': 'Ferie aziendali',
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': '次の月',
|
||||
'mobileVacay.usedCount': '{count} 日取得',
|
||||
'mobileVacay.leftCount': '残り {count} 日',
|
||||
'mobileVacay.daysPerYear': '日 / 年',
|
||||
'mobileVacay.left': '残り',
|
||||
'mobileVacay.modeCompany': '会社',
|
||||
'mobileVacay.decreaseAllowance': '付与日数を減らす',
|
||||
'mobileVacay.increaseAllowance': '付与日数を増やす',
|
||||
'mobileVacay.companyLegend': '会社の休業日',
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': '다음 달',
|
||||
'mobileVacay.usedCount': '{count}일 사용',
|
||||
'mobileVacay.leftCount': '{count}일 남음',
|
||||
'mobileVacay.daysPerYear': '일 / 년',
|
||||
'mobileVacay.left': '남음',
|
||||
'mobileVacay.modeCompany': '회사',
|
||||
'mobileVacay.decreaseAllowance': '할당 줄이기',
|
||||
'mobileVacay.increaseAllowance': '할당 늘리기',
|
||||
'mobileVacay.companyLegend': '회사 지정 휴무',
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': 'Volgende maand',
|
||||
'mobileVacay.usedCount': '{count} gebruikt',
|
||||
'mobileVacay.leftCount': '{count} over',
|
||||
'mobileVacay.daysPerYear': 'dagen / jaar',
|
||||
'mobileVacay.left': 'over',
|
||||
'mobileVacay.modeCompany': 'Bedrijf',
|
||||
'mobileVacay.decreaseAllowance': 'Tegoed verlagen',
|
||||
'mobileVacay.increaseAllowance': 'Tegoed verhogen',
|
||||
'mobileVacay.companyLegend': 'Bedrijfsverlof',
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': 'Następny miesiąc',
|
||||
'mobileVacay.usedCount': 'Wykorzystano: {count}',
|
||||
'mobileVacay.leftCount': 'Pozostało: {count}',
|
||||
'mobileVacay.daysPerYear': 'dni / rok',
|
||||
'mobileVacay.left': 'pozostało',
|
||||
'mobileVacay.modeCompany': 'Firma',
|
||||
'mobileVacay.decreaseAllowance': 'Zmniejsz limit',
|
||||
'mobileVacay.increaseAllowance': 'Zwiększ limit',
|
||||
'mobileVacay.companyLegend': 'Dni firmowe',
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': 'Следующий месяц',
|
||||
'mobileVacay.usedCount': 'Использовано: {count}',
|
||||
'mobileVacay.leftCount': 'Осталось: {count}',
|
||||
'mobileVacay.daysPerYear': 'дней / год',
|
||||
'mobileVacay.left': 'осталось',
|
||||
'mobileVacay.modeCompany': 'Компания',
|
||||
'mobileVacay.decreaseAllowance': 'Уменьшить лимит',
|
||||
'mobileVacay.increaseAllowance': 'Увеличить лимит',
|
||||
'mobileVacay.companyLegend': 'Корпоративные дни',
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': 'Nästa månad',
|
||||
'mobileVacay.usedCount': '{count} använda',
|
||||
'mobileVacay.leftCount': '{count} kvar',
|
||||
'mobileVacay.daysPerYear': 'dagar / år',
|
||||
'mobileVacay.left': 'kvar',
|
||||
'mobileVacay.modeCompany': 'Företag',
|
||||
'mobileVacay.decreaseAllowance': 'Minska kvot',
|
||||
'mobileVacay.increaseAllowance': 'Öka kvot',
|
||||
'mobileVacay.companyLegend': 'Företagsledighet',
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': 'Sonraki ay',
|
||||
'mobileVacay.usedCount': '{count} kullanıldı',
|
||||
'mobileVacay.leftCount': '{count} kaldı',
|
||||
'mobileVacay.daysPerYear': 'gün / yıl',
|
||||
'mobileVacay.left': 'kaldı',
|
||||
'mobileVacay.modeCompany': 'Şirket',
|
||||
'mobileVacay.decreaseAllowance': 'Hakkı azalt',
|
||||
'mobileVacay.increaseAllowance': 'Hakkı artır',
|
||||
'mobileVacay.companyLegend': 'Şirket tatili',
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': 'Наступний місяць',
|
||||
'mobileVacay.usedCount': 'Використано: {count}',
|
||||
'mobileVacay.leftCount': 'Залишилось: {count}',
|
||||
'mobileVacay.daysPerYear': 'днів / рік',
|
||||
'mobileVacay.left': 'залишилось',
|
||||
'mobileVacay.modeCompany': 'Компанія',
|
||||
'mobileVacay.decreaseAllowance': 'Зменшити ліміт',
|
||||
'mobileVacay.increaseAllowance': 'Збільшити ліміт',
|
||||
'mobileVacay.companyLegend': 'Корпоративні дні',
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': 'Tháng sau',
|
||||
'mobileVacay.usedCount': 'Đã dùng {count}',
|
||||
'mobileVacay.leftCount': 'Còn {count}',
|
||||
'mobileVacay.daysPerYear': 'ngày / năm',
|
||||
'mobileVacay.left': 'còn',
|
||||
'mobileVacay.modeCompany': 'Công ty',
|
||||
'mobileVacay.decreaseAllowance': 'Giảm hạn mức',
|
||||
'mobileVacay.increaseAllowance': 'Tăng hạn mức',
|
||||
'mobileVacay.companyLegend': 'Ngày nghỉ công ty',
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': '下個月',
|
||||
'mobileVacay.usedCount': '已用 {count}',
|
||||
'mobileVacay.leftCount': '剩餘 {count}',
|
||||
'mobileVacay.daysPerYear': '天 / 年',
|
||||
'mobileVacay.left': '剩餘',
|
||||
'mobileVacay.modeCompany': '公司',
|
||||
'mobileVacay.decreaseAllowance': '減少額度',
|
||||
'mobileVacay.increaseAllowance': '增加額度',
|
||||
'mobileVacay.companyLegend': '公司假期',
|
||||
|
||||
@@ -7,7 +7,8 @@ const mobileVacay: TranslationStrings = {
|
||||
'mobileVacay.nextMonth': '下个月',
|
||||
'mobileVacay.usedCount': '已用 {count}',
|
||||
'mobileVacay.leftCount': '剩余 {count}',
|
||||
'mobileVacay.daysPerYear': '天 / 年',
|
||||
'mobileVacay.left': '剩余',
|
||||
'mobileVacay.modeCompany': '公司',
|
||||
'mobileVacay.decreaseAllowance': '减少额度',
|
||||
'mobileVacay.increaseAllowance': '增加额度',
|
||||
'mobileVacay.companyLegend': '公司假期',
|
||||
|
||||
Reference in New Issue
Block a user