Skip to content

Commit

Permalink
feat: apply design with line-clamp
Browse files Browse the repository at this point in the history
  • Loading branch information
annacv committed Oct 25, 2023
1 parent 7a5e686 commit a2e2555
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 69 deletions.
37 changes: 0 additions & 37 deletions src/components/my-history/custom-my-history.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,6 @@

<div class="x-flex x-flex-col x-gap-2">
<p>{{ suggestion.query }}</p>
<template v-if="suggestion.selectedFilters.length > 0">
<p
v-if="suggestion.selectedFilters.length < 4"
class="x-text1-sm x-text-lead-50 x-line-clamp-1"
>
<span
v-for="filter in suggestion.selectedFilters"
:key="filter.id"
class="x-history-filters x-pr-[4px]"
>
{{ filter.label }}
</span>
</p>
<i18n
v-else-if="suggestion.selectedFilters.length >= 4"
tag="p"
path="myHistory.filters"
class="x-text1-sm x-text-lead-50"
>
<template #totalFilters>{{ suggestion.selectedFilters.length - 1 }}</template>
</i18n>
</template>

<MyHistoryFilters :suggestion="suggestion" />

<p class="x-text1 x-text1-sm x-text-neutral-75">
Expand Down Expand Up @@ -95,17 +72,3 @@
}
});
</script>

<style lang="scss">
.x-history-filters {
&:after {
content: '·';
padding-left: 4px;
}
&:last-child {
&:after {
content: '';
}
}
}
</style>
32 changes: 11 additions & 21 deletions src/components/my-history/my-history-filters.vue
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
<template v-if="suggestion.selectedFilters.length > 0">
<p
v-if="suggestion.selectedFilters.length < 4"
class="x-text1-sm x-text-neutral-75 x-line-clamp-1"
>
<span
v-for="filter in suggestion.selectedFilters"
:key="filter.id"
class="x-mr-8 x-rounded-full x-bg-neutral-10 x-px-8 x-py-2"
>
{{ filter.label }}
</span>
</p>
<i18n
v-else-if="suggestion.selectedFilters.length >= 4"
tag="p"
path="myHistory.filters"
class="x-text1-sm x-text-lead-50"
>
<template #firstFilter>{{ suggestion.selectedFilters[0].label }}</template>
<template #totalFilters>+{{ suggestion.selectedFilters.length - 1 }}</template>
</i18n>
<div>
<p class="x-text1-sm x-text-lead-50 x-line-clamp-1">
<span
v-for="filter in suggestion.selectedFilters"
:key="filter.id"
class="x-history-filters x-pr-8"
>
{{ filter.label ?? filter.id }}
</span>
</p>
</div>
</template>

<script lang="ts">
Expand Down
1 change: 0 additions & 1 deletion src/i18n/messages.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export interface Messages {
dismiss: string;
confirm: string;
};
filters: string;
};
nextQueries: {
title: string;
Expand Down
3 changes: 1 addition & 2 deletions src/i18n/messages/en.messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
"message": "Disabling History Queries you also clear all the history list.",
"dismiss": "Cancel",
"confirm": "Disable"
},
"filters": "{firstFilter} {totalFilters} filters applied"
}
},
"nextQueries": {
"title": "What's Next"
Expand Down
3 changes: 1 addition & 2 deletions src/i18n/messages/es.messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
"message": "Si desactivas el historial de búsqueda, las búsquedas de tu historial serán eliminadas.",
"dismiss": "Cancelar",
"confirm": "Desactivar"
},
"filters": "{totalFilters} filtros aplicados"
}
},
"nextQueries": {
"title": "Quizás te Interese"
Expand Down
3 changes: 1 addition & 2 deletions src/i18n/messages/fr.messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
"message": "En désactivant les requêtes d'historique, vous effacez également toute la liste d'historique.",
"dismiss": "Annuler",
"confirm": "Désactiver"
},
"filters": "{totalFilters} filtres appliqués"
}
},
"nextQueries": {
"title": "Et Après"
Expand Down
3 changes: 1 addition & 2 deletions src/i18n/messages/it.messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
"message": "Se disattivi la cronologia ricerche, le ricerche nella cronologia verranno eliminate.",
"dismiss": "Cancella",
"confirm": "Disattiva"
},
"filters": "{totalFilters} filtri applicati"
}
},
"nextQueries": {
"title": "Potrebbe interessarti"
Expand Down
3 changes: 1 addition & 2 deletions src/i18n/messages/pt.messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
"message": "Desabilitando o histórico de buscas, você também limpará toda a lista de buscas",
"dismiss": "Cancelar",
"confirm": "Desativar"
},
"filters": "{totalFilters} filtros aplicados"
}
},
"nextQueries": {
"title": "Você Pode se Interessar"
Expand Down

0 comments on commit a2e2555

Please sign in to comment.