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

feature: Fix RPs layout for mobile devices #525

Merged
merged 5 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/components/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<LocationProvider location="results">
<Results />
</LocationProvider>
<LocationProvider v-if="showRelatedPrompts" location="related_prompts">
<LocationProvider v-if="showRelatedPrompts" :location="semanticsLocation">
victorcg88 marked this conversation as resolved.
Show resolved Hide resolved
<CustomRelatedPrompts
:related-prompt-list="relatedPrompts"
:class="x.noResults ? 'desktop:x-mt-24' : 'x-mt-24 desktop:x-mt-32'"
:class="x.noResults ? 'desktop:x-mt-24' : 'x-mt-48 desktop:x-mt-32'"
/>
</LocationProvider>
<LocationProvider v-if="!showRelatedPrompts" :location="semanticsLocation">
Expand Down
11 changes: 7 additions & 4 deletions src/components/related-prompts/custom-related-prompts.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<template>
<div class="x-mb-32 x-flex x-flex-col">
<div class="x-mb-64 x-flex x-flex-col">
<i18n-t
class="x-no-results-message x-text1 x-flex x-flex-wrap x-items-center x-justify-center x-break-words x-bg-neutral-10 x-p-24 x-text-center x-text-neutral-90 desktop:x-text1-lg"
class="x-no-results-message x-text1 x-flex x-flex-wrap x-gap-4 x-items-center x-justify-center x-break-words x-bg-neutral-10 x-p-24 x-text-center x-text-neutral-90 desktop:x-text1-lg"
keypath="relatedPrompts.title"
tag="span"
tag="p"
scope="global"
>
<template #query>
<span class="x-title3 x-w-auto">{{ x.query.search }}</span>
<span class="x-title3 x-w-auto">"{{ x.query.search }}"</span>
</template>
<template #message>
<span class="x-w-auto">{{ $t('relatedPrompts.message') }}</span>
</template>
</i18n-t>

Expand Down
10 changes: 4 additions & 6 deletions src/components/related-prompts/related-prompts-tag-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
>
<div
ref="slidingPanelContent"
class="x-flex x-gap-8 x-font-main desktop:x-mx-0 desktop:x-mb-0"
class="x-flex x-gap-16 x-font-main desktop:x-mx-0 desktop:x-mb-0"
:class="{ 'x-w-[calc(100%)]': selectedIndex !== -1 }"
>
<div
Expand All @@ -20,14 +20,14 @@
{ 'x-hidden': shouldHideButton(index) },
isSelected(index)
? 'x-w-full x-rounded-b-none'
: 'x-h-[112px] x-w-[204px] desktop:x-w-[303px]',
: 'x-min-h-[112px] x-h-full x-w-[204px] desktop:x-w-[303px]',
]"
data-test="related-prompt-item"
>
<!-- Suggestion -->
<button
class="x-flex x-flex-row x-items-start x-justify-between x-gap-12 x-px-16 x-pt-8 x-text-start x-transition-all x-duration-500"
:class="isSelected(index) ? 'x-w-full' : 'x-w-[204px] x-grow desktop:x-w-[303px]'"
class="x-flex x-flex-row x-items-start x-justify-between x-gap-12 x-p-16 x-text-start x-transition-all x-duration-500"
:class="[isSelected(index) ? 'x-w-full' : 'x-w-[204px] x-grow desktop:x-w-[303px]']"
@click="toggleSuggestion(index)"
>
<div class="x-flex x-min-h-[32px]">
Expand All @@ -42,10 +42,8 @@
{{ suggestion.suggestionText }}
</span>
</div>
<div :class="{ 'x-mr-8 x-mt-8': !isSelected(index) }">
<CrossTinyIcon v-if="isSelected(index)" class="x-icon-lg" />
<PlusIcon v-else class="x-icon-neutral-80 x-icon-lg" />
</div>
</button>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/i18n/messages.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,6 @@ export interface Messages {
}
relatedPrompts: {
title: string
message: string
}
}
3 changes: 2 additions & 1 deletion src/i18n/messages/de.messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@
"reject": "Nein, ich bleibe hier"
},
"relatedPrompts": {
"title": "Sind Sie an „{query}“ interessiert? Entdecken Sie diese Vorschläge:"
"title": "Sind Sie an {query} interessiert?",
"message": "Entdecken Sie diese Vorschläge:"
}
},
"mobile": {
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/messages/en.messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@
"reject": "No, I'll stay here"
},
"relatedPrompts": {
"title": "Are you interested in \"{query}\"? Explore this suggestions:"
"title": "Are you interested in {query}?",
"message": "Explore this suggestions:"
}
},
"mobile": {
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/messages/es.messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@
"reject": "No, me quedaré aquí"
},
"relatedPrompts": {
"title": "¿Estás interesado en \"{query}\"? Explora estas sugerencias:"
"title": "¿Estás interesado en {query}?",
"message": "Explora estas sugerencias:"
}
},
"mobile": {
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/messages/fr.messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@
"reject": "Non, je reste ici"
},
"relatedPrompts": {
"title": "Êtes-vous intéressé par «{query}»? Explorez ces suggestions:"
"title": "Êtes-vous intéressé par {query}?",
"message": "Explorez ces suggestions:"
}
},
"mobile": {
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/messages/it.messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@
"reject": "No, rimango qui"
},
"relatedPrompts": {
"title": "Ti interessa \"{query}\"? Esplora questi suggerimenti:"
"title": "Ti interessa {query}?",
"message": "Esplora questi suggerimenti:"
}
},
"mobile": {
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/messages/pt.messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@
"reject": "Não, vou ficar aqui"
},
"relatedPrompts": {
"title": "Você está interessado em \"{query}\"? Explore estas sugestões:"
"title": "Você está interessado em {query}?",
"message": "Explore estas sugestões:"
}
},
"mobile": {
Expand Down
Loading