mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
chore(profile): generating menu buttons from object
This commit is contained in:
@@ -93,12 +93,13 @@
|
|||||||
<h3 class="main-header">OSTATNIA AKTYWNOŚĆ GRACZA</h3>
|
<h3 class="main-header">OSTATNIA AKTYWNOŚĆ GRACZA</h3>
|
||||||
|
|
||||||
<div class="history-menu">
|
<div class="history-menu">
|
||||||
<button class="history-menu-button" @click="toggleFilter('Timetable')">
|
<button
|
||||||
ROZKŁADY JAZDY
|
v-for="(filterState, filterKey) in activeFilterTypes"
|
||||||
</button>
|
class="menu-btn"
|
||||||
<button class="history-menu-button" @click="toggleFilter('Dispatcher')">SŁUŻBY DR</button>
|
:data-active="filterState"
|
||||||
<button class="history-menu-button" @click="toggleFilter('IssuedTimetable')">
|
@click="toggleFilter(filterKey)"
|
||||||
WYSTAWIONE RJ
|
>
|
||||||
|
{{ t(`profile.filters.${filterKey}`) }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -163,6 +164,7 @@ import { useRoute } from 'vue-router';
|
|||||||
import { useApiStore } from '../store/apiStore';
|
import { useApiStore } from '../store/apiStore';
|
||||||
import { API } from '../typings/api';
|
import { API } from '../typings/api';
|
||||||
import { humanizeDuration } from '../composables/time';
|
import { humanizeDuration } from '../composables/time';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
type JournalEntryType = 'Timetable' | 'Dispatcher' | 'IssuedTimetable';
|
type JournalEntryType = 'Timetable' | 'Dispatcher' | 'IssuedTimetable';
|
||||||
|
|
||||||
@@ -172,6 +174,7 @@ interface JournalEntry {
|
|||||||
value: API.TimetableHistory.DataShort | API.DispatcherHistory.Data;
|
value: API.TimetableHistory.DataShort | API.DispatcherHistory.Data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
const apiStore = useApiStore();
|
const apiStore = useApiStore();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
@@ -371,10 +374,20 @@ $tileColor: #181818;
|
|||||||
grid-template-columns: repeat(3, 1fr);
|
grid-template-columns: repeat(3, 1fr);
|
||||||
gap: 1em;
|
gap: 1em;
|
||||||
padding: 0 1px;
|
padding: 0 1px;
|
||||||
|
}
|
||||||
|
|
||||||
& > button {
|
.menu-btn {
|
||||||
background-color: $tileColor;
|
background-color: $tileColor;
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #aaa;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: #2b2b2b;
|
||||||
|
}
|
||||||
|
|
||||||
|
&[data-active='true'] {
|
||||||
|
color: var(--clr-primary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -407,7 +420,4 @@ $tileColor: #181818;
|
|||||||
grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
|
grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@include responsive.smallScreen {
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user