mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
chore(app): added button for manual migration info card toggle
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
>
|
||||||
|
<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" />
|
||||||
|
<path d="M12 9v4" />
|
||||||
|
<path d="M12 17h.01" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 345 B |
+4
-5
@@ -8,7 +8,7 @@
|
|||||||
<AppWelcomeCard :is-card-open="isWelcomeCardOpen" @toggle-card="closeWelcomeCard" />
|
<AppWelcomeCard :is-card-open="isWelcomeCardOpen" @toggle-card="closeWelcomeCard" />
|
||||||
|
|
||||||
<MigrateInfoCard
|
<MigrateInfoCard
|
||||||
:is-open="isMigrateInfoCardOpen"
|
:is-open="store.isMigrateInfoCardOpen"
|
||||||
@toggle-card="closeMigrateInfoCard"
|
@toggle-card="closeMigrateInfoCard"
|
||||||
></MigrateInfoCard>
|
></MigrateInfoCard>
|
||||||
|
|
||||||
@@ -78,7 +78,6 @@ export default defineComponent({
|
|||||||
|
|
||||||
isUpdateCardOpen: false,
|
isUpdateCardOpen: false,
|
||||||
isWelcomeCardOpen: false,
|
isWelcomeCardOpen: false,
|
||||||
isMigrateInfoCardOpen: false,
|
|
||||||
|
|
||||||
isOnProductionHost: /(stacjownik-td2)(\.web\.app|\.spythere\.eu)/.test(location.hostname)
|
isOnProductionHost: /(stacjownik-td2)(\.web\.app|\.spythere\.eu)/.test(location.hostname)
|
||||||
}),
|
}),
|
||||||
@@ -113,7 +112,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (query.get('migrateCard') == '1') {
|
if (query.get('migrateCard') == '1') {
|
||||||
this.isMigrateInfoCardOpen = true;
|
this.store.isMigrateInfoCardOpen = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -177,7 +176,7 @@ export default defineComponent({
|
|||||||
if (location.hostname != 'stacjownik-td2.web.app') return;
|
if (location.hostname != 'stacjownik-td2.web.app') return;
|
||||||
if (StorageManager.getBooleanValue(MIGRATE_INFO_CARD_SEEN_KEY) === true) return;
|
if (StorageManager.getBooleanValue(MIGRATE_INFO_CARD_SEEN_KEY) === true) return;
|
||||||
|
|
||||||
this.isMigrateInfoCardOpen = true;
|
this.store.isMigrateInfoCardOpen = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
loadLang() {
|
loadLang() {
|
||||||
@@ -204,7 +203,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
closeMigrateInfoCard() {
|
closeMigrateInfoCard() {
|
||||||
this.isMigrateInfoCardOpen = false;
|
this.store.isMigrateInfoCardOpen = false;
|
||||||
StorageManager.setBooleanValue(MIGRATE_INFO_CARD_SEEN_KEY, true);
|
StorageManager.setBooleanValue(MIGRATE_INFO_CARD_SEEN_KEY, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,9 @@ export const useMainStore = defineStore('mainStore', {
|
|||||||
chosenModalTrainId: undefined,
|
chosenModalTrainId: undefined,
|
||||||
|
|
||||||
modalLastClickedTarget: null,
|
modalLastClickedTarget: null,
|
||||||
currentLocale: 'pl'
|
currentLocale: 'pl',
|
||||||
|
|
||||||
|
isMigrateInfoCardOpen: false
|
||||||
}) as MainStoreState,
|
}) as MainStoreState,
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export interface MainStoreState {
|
|||||||
chosenModalTrainId?: string;
|
chosenModalTrainId?: string;
|
||||||
modalLastClickedTarget: EventTarget | null;
|
modalLastClickedTarget: EventTarget | null;
|
||||||
currentLocale: string;
|
currentLocale: string;
|
||||||
|
isMigrateInfoCardOpen: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface StationJSONData {
|
export interface StationJSONData {
|
||||||
|
|||||||
@@ -13,6 +13,15 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="topbar-links">
|
<div class="topbar-links">
|
||||||
|
<button
|
||||||
|
class="btn--image migrate-info-button"
|
||||||
|
@click="toggleMigrateInfoCard(true)"
|
||||||
|
data-tooltip-type="HtmlTooltip"
|
||||||
|
:data-tooltip-content="`<b>${$t('migrate-info.tooltip-content')}</b>`"
|
||||||
|
>
|
||||||
|
<img :src="`/images/icon-alert-triangle.svg`" alt="show migrate info card" />
|
||||||
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
class="btn--image lang-button"
|
class="btn--image lang-button"
|
||||||
@click="toggleLocales()"
|
@click="toggleLocales()"
|
||||||
@@ -110,6 +119,10 @@ export default defineComponent({
|
|||||||
this.isDonationCardOpen = value;
|
this.isDonationCardOpen = value;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
toggleMigrateInfoCard(value: boolean) {
|
||||||
|
this.mainStore.isMigrateInfoCardOpen = value;
|
||||||
|
},
|
||||||
|
|
||||||
toggleLocales() {
|
toggleLocales() {
|
||||||
this.mainStore.changeLocale(this.mainStore.currentLocale == 'pl' ? 'en' : 'pl');
|
this.mainStore.changeLocale(this.mainStore.currentLocale == 'pl' ? 'en' : 'pl');
|
||||||
}
|
}
|
||||||
@@ -138,6 +151,7 @@ export default defineComponent({
|
|||||||
display: flex;
|
display: flex;
|
||||||
gap: 0.5em;
|
gap: 0.5em;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
overflow-x: auto;
|
||||||
|
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-bottom: 0.5em;
|
margin-bottom: 0.5em;
|
||||||
@@ -170,6 +184,11 @@ button.lang-button {
|
|||||||
background-color: #111;
|
background-color: #111;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
button.migrate-info-button {
|
||||||
|
padding: 0 0.5em;
|
||||||
|
background-color: var(--clr-primary);
|
||||||
|
}
|
||||||
|
|
||||||
a.pojazdownik-link {
|
a.pojazdownik-link {
|
||||||
background-color: #1f263b;
|
background-color: #1f263b;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user