Skip to content

Commit bd980a4

Browse files
skeptrunedevfedhacks
authored andcommitted
cleanup: yt button linkls + rec width
1 parent 98ef056 commit bd980a4

File tree

7 files changed

+67
-14
lines changed

7 files changed

+67
-14
lines changed

clients/search-component/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"import": "./dist/vanilla/index.js"
2020
}
2121
},
22-
"version": "0.2.41",
22+
"version": "0.2.43",
2323
"license": "MIT",
2424
"homepage": "https://github.com/devflowinc/trieve/tree/main/clients/search-component",
2525
"scripts": {

clients/search-component/src/TrieveModal/Chat/ChatMessage.tsx

+42-1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,41 @@ export const Message = ({
137137
</a>
138138
));
139139

140+
const youtubeItems = message.additional
141+
?.filter(
142+
(chunk) =>
143+
(chunk.metadata.heading ||
144+
chunk.metadata.title ||
145+
chunk.metadata.page_title) &&
146+
chunk.link &&
147+
chunk.metadata.yt_preview_src
148+
)
149+
.map((chunk) => {
150+
return {
151+
title:
152+
chunk.metadata.heading ||
153+
chunk.metadata.title ||
154+
chunk.metadata.page_title,
155+
link: chunk.link,
156+
metadata: chunk.metadata,
157+
};
158+
})
159+
.map((item, index) => (
160+
<a
161+
className="source-anchor yt-anchor"
162+
key={index}
163+
href={item.link as string}
164+
target="_blank"
165+
>
166+
{item.metadata?.yt_preview_src ? (
167+
<img className="yt-preview" src={item.metadata?.yt_preview_src} />
168+
) : (
169+
<></>
170+
)}
171+
{item.title}
172+
</a>
173+
));
174+
140175
return (
141176
<div>
142177
{message.text === "Loading..." ? (
@@ -155,6 +190,11 @@ export const Message = ({
155190
<Carousel>{ecommerceItems}</Carousel>
156191
</div>
157192
)}
193+
{youtubeItems && youtubeItems.length > 0 && (
194+
<div className="additional-image-links">
195+
<Carousel>{youtubeItems}</Carousel>
196+
</div>
197+
)}
158198
{message.text.length > 0 ? (
159199
<Markdown
160200
components={{
@@ -181,7 +221,8 @@ export const Message = ({
181221
(chunk.metadata.heading ||
182222
chunk.metadata.title ||
183223
chunk.metadata.page_title) &&
184-
chunk.link
224+
chunk.link &&
225+
!chunk.metadata.yt_preview_src
185226
)
186227
.map((chunk) => {
187228
return {

clients/search-component/src/TrieveModal/index.css

+13-1
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,11 @@ body {
352352
box-sizing: border-box;
353353

354354
a {
355-
@apply rounded px-2 text-xs py-1 bg-zinc-200/50;
355+
@apply rounded px-2 text-xs py-1 bg-zinc-200/50 flex flex-col gap-y-1 h-full;
356+
357+
&.yt-anchor {
358+
@apply text-center;
359+
}
356360

357361
&:hover {
358362
background-color: var(--tv-zinc-200);
@@ -394,6 +398,10 @@ body {
394398
.ecommerce-featured-image-chat {
395399
@apply mb-1 max-h-48 aspect-auto mx-auto;
396400
}
401+
402+
.yt-preview {
403+
@apply h-16 w-28 block mx-auto;
404+
}
397405
}
398406

399407
.user {
@@ -437,6 +445,10 @@ body {
437445
@apply list-decimal pl-4 my-4 overflow-hidden;
438446
}
439447

448+
li {
449+
@apply my-2;
450+
}
451+
440452
hr {
441453
@apply mb-4;
442454
}

server/src/public/navbar.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
params.forBrandName) else 'Prospect'|safe}}
1818
</span>
1919
</p>
20-
<p class="signature mt-0.5 pl-0.5 text-right text-sm">
20+
<p class="signature mt-1 pl-0.5 text-right text-sm">
2121
- From
2222
<a
2323
class="creator"

server/src/public/page.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@
157157
font-family: "Maven Pro", sans-serif;
158158
}
159159

160+
.recs-section {
161+
width: 100%;
162+
}
163+
160164
h1,h2,h3,h4,h5,h6,p,pre,button,nav,.paragraph-text {
161165
position: relative;
162166
z-index: 15;
@@ -379,7 +383,7 @@
379383
type: "underline",
380384
animationDuration: 50,
381385
color: window.paramsData.brandColor || "black",
382-
padding: 3,
386+
padding: 2,
383387
});
384388

385389
canvas.style.position = "absolute";

server/src/public/product.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<div class="max-w-full">
22
<div
33
id="product-display"
4-
class="mx-auto py-6 px-4 mt-40 sm:px-6 sm:mt-30 lg:max-w-7xl lg:px-8"
4+
class="mx-auto py-4 px-4 mt-40 sm:px-6 sm:mt-30 lg:max-w-7xl lg:px-8"
55
>
6-
<section class="lg:flex gap-2 lg:gap-x-8 lg:gap-y-10 xl:gap-x-16">
6+
<section class="lg:flex gap-2 lg:gap-x-8 lg:gap-y-10 xl:gap-x-16 py-2">
77
<div class="lg:w-1/2">
88
<img
99
src="{{ params.singleProductOptions.productPrimaryImageUrl }}"

server/static/output.css

+3-7
Original file line numberDiff line numberDiff line change
@@ -584,10 +584,6 @@ video {
584584
margin-right: 1rem;
585585
}
586586

587-
.mt-0\.5 {
588-
margin-top: 0.125rem;
589-
}
590-
591587
.mt-1 {
592588
margin-top: 0.25rem;
593589
}
@@ -844,9 +840,9 @@ video {
844840
padding-bottom: 0.75rem;
845841
}
846842

847-
.py-6 {
848-
padding-top: 1.5rem;
849-
padding-bottom: 1.5rem;
843+
.py-4 {
844+
padding-top: 1rem;
845+
padding-bottom: 1rem;
850846
}
851847

852848
.pl-0\.5 {

0 commit comments

Comments
 (0)