Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename generic indicator "Templates" to "Presets" #484

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/components/mini-widgets/VeryGenericIndicator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
<div class="flex items-center mb-3 justify-evenly">
<div
class="px-3 py-1 transition-all rounded-md cursor-pointer select-none text-slate-100 hover:bg-slate-400"
:class="{ 'bg-slate-400': currentTab === 'templates' }"
@click="currentTab = 'templates'"
:class="{ 'bg-slate-400': currentTab === 'presets' }"
@click="currentTab = 'presets'"
>
Templates
Presets
</div>
<div
class="px-3 py-1 transition-all rounded-md cursor-pointer select-none text-slate-100 hover:bg-slate-400"
Expand Down Expand Up @@ -93,9 +93,9 @@
/>
</div>
</div>
<div v-if="currentTab === 'templates'" class="flex flex-wrap items-center justify-around">
<div v-if="currentTab === 'presets'" class="flex flex-wrap items-center justify-around">
<div
v-for="(template, i) in veryGenericIndicatorTemplates"
v-for="(template, i) in veryGenericIndicatorPresets"
:key="i"
class="flex items-center w-[6.25rem] h-12 py-1 pl-6 pr-1 rounded-md text-white justify-center cursor-pointer hover:bg-slate-100/20 transition-all"
@click="setIndicatorFromTemplate(template)"
Expand All @@ -121,7 +121,7 @@ import { computed, onBeforeMount, onMounted, ref, toRefs, watch } from 'vue'
import Dropdown from '@/components/Dropdown.vue'
import { round } from '@/libs/utils'
import { useMainVehicleStore } from '@/stores/mainVehicle'
import { type VeryGenericIndicatorTemplate, veryGenericIndicatorTemplates } from '@/types/genericIndicator'
import { type VeryGenericIndicatorPreset, veryGenericIndicatorPresets } from '@/types/genericIndicator'

import Dialog from '../Dialog.vue'

Expand Down Expand Up @@ -175,9 +175,9 @@ let iconsNames: string[] = []

const showConfigurationMenu = ref(false)
const iconSearchString = ref('')
const currentTab = ref('templates')
const currentTab = ref('presets')

const setIndicatorFromTemplate = (template: VeryGenericIndicatorTemplate): void => {
const setIndicatorFromTemplate = (template: VeryGenericIndicatorPreset): void => {
options.displayName = template.displayName
options.variableName = template.variableName
options.iconName = template.iconName
Expand Down
4 changes: 2 additions & 2 deletions src/types/genericIndicator.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Variables that define generic indicator
*/
export interface VeryGenericIndicatorTemplate {
export interface VeryGenericIndicatorPreset {
/**
* Name to be displayed on the widget
*/
Expand All @@ -28,7 +28,7 @@ export interface VeryGenericIndicatorTemplate {
variableMultiplier: number
}

export const veryGenericIndicatorTemplates: VeryGenericIndicatorTemplate[] = [
export const veryGenericIndicatorPresets: VeryGenericIndicatorPreset[] = [
{
displayName: 'Cam Tilt',
variableName: 'CamTilt',
Expand Down