feat: update live blog UI with chat layout, fix page title and favicon
This commit is contained in:
1 parent
59891b03dc
commit
515c4cacf3
4 files changed
+19
-9
No files matched your search
@@ -223,8 +223,16 @@ export function LiveBlogViewer({ slug, className }: LiveBlogViewerProps) {
|
||||
</div>
|
||||
) : (
|
||||
<div className="space-y-4">
|
||||
{updates.map((update) => (
|
||||
<LiveBlogUpdate key={update.id} update={update} />
|
||||
{updates.map((update, index) => (
|
||||
<div
|
||||
key={update.id}
|
||||
className={cn(
|
||||
'flex',
|
||||
index % 2 === 0 ? 'justify-start' : 'justify-end'
|
||||
)}
|
||||
>
|
||||
<LiveBlogUpdate update={update} alignRight={index % 2 !== 0} />
|
||||
</div>
|
||||
))}
|
||||
{updatesLoading && (
|
||||
<div className="animate-pulse">
|
||||
@@ -255,16 +263,19 @@ export function LiveBlogViewer({ slug, className }: LiveBlogViewerProps) {
|
||||
|
||||
interface LiveBlogUpdateProps {
|
||||
update: ApiLiveBlogUpdate;
|
||||
alignRight?: boolean;
|
||||
}
|
||||
|
||||
function LiveBlogUpdate({ update }: LiveBlogUpdateProps) {
|
||||
function LiveBlogUpdate({ update, alignRight = false }: LiveBlogUpdateProps) {
|
||||
const isPinned = update.isPinned;
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
'relative p-4 rounded-lg border',
|
||||
isPinned && 'border-primary bg-primary/5'
|
||||
'relative p-4 rounded-lg border max-w-[80%]',
|
||||
isPinned && 'border-primary bg-primary/5',
|
||||
!isPinned && alignRight && 'bg-accent/10 border-accent/20',
|
||||
!isPinned && !alignRight && 'bg-muted/50 border-muted'
|
||||
)}
|
||||
>
|
||||
{isPinned && (
|
||||
|
||||
Reference in new issue
Block a user