mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-07 06:52:28 +00:00
fix: improve "Load older" button styling and alignment
- Centered button using mx-auto w-fit wrapper (matches SystemMessage pattern) - Changed variant from secondary to outline for subtler appearance - Reduced visual weight with text-xs opacity-80 hover:opacity-100 - Added ↑ arrow icon before the text - Adjusted spacing to py-1 mb-2 and gap-1.5 Fixes alignment issues where button wasn't centered with content below and improves visual consistency with page design.
This commit is contained in:
@@ -267,24 +267,29 @@ export function HappyThread(props: {
|
||||
) : null}
|
||||
|
||||
{props.hasMoreMessages && !props.isLoadingMessages ? (
|
||||
<div className="mb-3">
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
onClick={handleLoadMore}
|
||||
disabled={props.isLoadingMoreMessages || props.isLoadingMessages}
|
||||
aria-busy={props.isLoadingMoreMessages}
|
||||
className="gap-2"
|
||||
>
|
||||
{props.isLoadingMoreMessages ? (
|
||||
<>
|
||||
<Spinner size="sm" label={null} className="text-current" />
|
||||
Loading…
|
||||
</>
|
||||
) : (
|
||||
'Load older'
|
||||
)}
|
||||
</Button>
|
||||
<div className="py-1 mb-2">
|
||||
<div className="mx-auto w-fit">
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={handleLoadMore}
|
||||
disabled={props.isLoadingMoreMessages || props.isLoadingMessages}
|
||||
aria-busy={props.isLoadingMoreMessages}
|
||||
className="gap-1.5 text-xs opacity-80 hover:opacity-100"
|
||||
>
|
||||
{props.isLoadingMoreMessages ? (
|
||||
<>
|
||||
<Spinner size="sm" label={null} className="text-current" />
|
||||
Loading…
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<span aria-hidden="true">↑</span>
|
||||
Load older
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user