Updated logo API
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<script setup lang="ts">
|
||||
import {Flight, UserActionChange} from "@/Types/types";
|
||||
import AirportToolTip from "@/Components/FlightsGoneBy/AirportToolTip.vue";
|
||||
import {computed} from "vue";
|
||||
import GenericFieldChange from "@/Components/FlightsGoneBy/Feed/FieldChanges/GenericFieldChange.vue";
|
||||
import AirlineLogo from "@/Components/FlightsGoneBy/AirlineLogo.vue";
|
||||
import AircraftToolTip from "@/Components/FlightsGoneBy/AircraftToolTip.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
original: Flight
|
||||
updated: Flight
|
||||
}>()
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<GenericFieldChange label="Aircraft">
|
||||
<template #from>
|
||||
<AircraftToolTip v-if="original.aircraft" :aircraft="original.aircraft">
|
||||
{{ original.aircraft.display_name}}
|
||||
</AircraftToolTip>
|
||||
<span v-else>None</span>
|
||||
</template>
|
||||
<template #to>
|
||||
<AircraftToolTip v-if="updated.aircraft" :aircraft="updated.aircraft">
|
||||
{{ updated.aircraft.display_name}}
|
||||
</AircraftToolTip>
|
||||
<span v-else>None</span>
|
||||
</template>
|
||||
</GenericFieldChange>
|
||||
</template>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,41 @@
|
||||
<script setup lang="ts">
|
||||
import {Flight, UserActionChange} from "@/Types/types";
|
||||
import AirportToolTip from "@/Components/FlightsGoneBy/AirportToolTip.vue";
|
||||
import {computed} from "vue";
|
||||
import GenericFieldChange from "@/Components/FlightsGoneBy/Feed/FieldChanges/GenericFieldChange.vue";
|
||||
import AirlineLogo from "@/Components/FlightsGoneBy/AirlineLogo.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
original: Flight
|
||||
updated: Flight
|
||||
}>()
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<GenericFieldChange label="Airline">
|
||||
<template #from>
|
||||
<span class="airline">
|
||||
<AirlineLogo :airline="original.airline" />
|
||||
{{ original.airline?.display_name ?? 'None' }}
|
||||
</span>
|
||||
</template>
|
||||
<template #to>
|
||||
<span class="airline">
|
||||
<AirlineLogo :airline="updated.airline" />
|
||||
{{ updated.airline?.display_name ?? 'None' }}
|
||||
</span>
|
||||
</template>
|
||||
</GenericFieldChange>
|
||||
</template>
|
||||
<style scoped>
|
||||
.airline {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
}
|
||||
|
||||
.from .airline {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,43 @@
|
||||
<script setup lang="ts">
|
||||
import {Flight, UserActionChange} from "@/Types/types";
|
||||
import AirportToolTip from "@/Components/FlightsGoneBy/AirportToolTip.vue";
|
||||
import {computed} from "vue";
|
||||
import GenericFieldChange from "@/Components/FlightsGoneBy/Feed/FieldChanges/GenericFieldChange.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
change: UserActionChange
|
||||
label: string
|
||||
original: Flight
|
||||
updated: Flight
|
||||
}>()
|
||||
|
||||
const originalAirport = computed(() =>
|
||||
props.change.field === 'departure_airport_id'
|
||||
? props.original.departure_airport
|
||||
: props.original.arrival_airport
|
||||
)
|
||||
|
||||
const updatedAirport = computed(() =>
|
||||
props.change.field === 'departure_airport_id'
|
||||
? props.updated.departure_airport
|
||||
: props.updated.arrival_airport
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<GenericFieldChange :label="label">
|
||||
<template #from>
|
||||
<AirportToolTip :airport="originalAirport">
|
||||
{{ originalAirport.municipality }} ({{originalAirport.display_code}})
|
||||
</AirportToolTip>
|
||||
</template>
|
||||
<template #to>
|
||||
<AirportToolTip :airport="updatedAirport">
|
||||
{{ updatedAirport.municipality }} ({{updatedAirport.display_code}})
|
||||
</AirportToolTip>
|
||||
</template>
|
||||
</GenericFieldChange>
|
||||
</template>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,27 @@
|
||||
<script setup lang="ts">
|
||||
import {Flight, UserActionChange} from "@/Types/types";
|
||||
import GenericFieldChange from "@/Components/FlightsGoneBy/Feed/FieldChanges/GenericFieldChange.vue";
|
||||
import {computed} from "vue";
|
||||
|
||||
const props = defineProps<{
|
||||
change: UserActionChange
|
||||
label: string
|
||||
original: Flight
|
||||
updated: Flight
|
||||
}>()
|
||||
|
||||
const displayField = computed(() =>
|
||||
props.change.field === 'departure_date' ? 'departure_date_display' : 'arrival_date_display'
|
||||
)
|
||||
|
||||
const timeField = computed(() =>
|
||||
props.change.field === 'departure_date' ? 'departure_time_display' : 'arrival_time_display'
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<GenericFieldChange :label="label">
|
||||
<template #from>{{ (original as any)[displayField] }} at {{ (original as any)[timeField] }}</template>
|
||||
<template #to>{{ (updated as any)[displayField] }} at {{ (updated as any)[timeField] }}</template>
|
||||
</GenericFieldChange>
|
||||
</template>
|
||||
@@ -0,0 +1,27 @@
|
||||
<script setup lang="ts">
|
||||
import {Flight, UserActionChange} from "@/Types/types";
|
||||
|
||||
import GenericFieldChange from "@/Components/FlightsGoneBy/Feed/FieldChanges/GenericFieldChange.vue";
|
||||
import FlightClassBadge from "@/Components/FlightsGoneBy/FlightClassBadge.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
original: Flight
|
||||
updated: Flight
|
||||
}>()
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<GenericFieldChange label="Flight Class">
|
||||
<template #from>
|
||||
<span style="display:inline-flex"><FlightClassBadge style="text-decoration:line-through" :flight="original"/></span>
|
||||
</template>
|
||||
<template #to>
|
||||
<span style="display:inline-flex"><FlightClassBadge :flight="updated"/></span>
|
||||
</template>
|
||||
</GenericFieldChange>
|
||||
</template>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,100 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
defineProps<{
|
||||
label: string
|
||||
}>()
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="field-change">
|
||||
<span class="field-label">{{ label }}</span>
|
||||
<div class="field-values">
|
||||
<span class="from">
|
||||
<slot name="from" />
|
||||
</span>
|
||||
<svg class="arrow" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
<path d="M5 12h14M13 6l6 6-6 6"/>
|
||||
</svg>
|
||||
<span class="to">
|
||||
<slot name="to" />
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.field-change {
|
||||
display: grid;
|
||||
grid-template-columns: 180px 1fr;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.6rem 0.75rem;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.field-change:nth-child(odd) {
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
}
|
||||
|
||||
.field-label {
|
||||
font-size: 0.72rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
color: #6b7280;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.field-values {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
font-size: 0.85rem;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.from {
|
||||
color: #6b7280;
|
||||
text-decoration: line-through;
|
||||
word-break: break-word;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.arrow {
|
||||
width: 0.85rem;
|
||||
height: 0.85rem;
|
||||
color: #374151;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.to {
|
||||
color: #f9fafb;
|
||||
font-weight: 500;
|
||||
word-break: break-word;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.field-change {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 0.3rem;
|
||||
}
|
||||
|
||||
.field-values {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1rem 1fr;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
}
|
||||
|
||||
.arrow {
|
||||
justify-self: center;
|
||||
}
|
||||
|
||||
.to {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user