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

Update MessageBase to show date on new line for mobile screens #751

Merged
merged 2 commits into from
Nov 22, 2024
Merged
Changes from all 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
34 changes: 21 additions & 13 deletions src/components/Message/MessageBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -469,20 +469,28 @@ function MessageBase({
<Box>{avatar}</Box>
<Flex direction="column" justify="center">
<Flex h="100%" align="center" gap={2}>
<Heading as="h2" size="xs" minW="fit-content">
{heading}
</Heading>
<Text
as="span"
fontSize="sm"
minW="fit-content"
color="gray.500"
_dark={{ color: "gray.300" }}
<Flex
direction={{ base: "column", sm: "row" }} // Stack on mobile, row on larger screens
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: prefer putting comments above vs. to the right of content, so lines don't extend horizontally. Vertical > horizontal.

align={{ base: "flex-start", sm: "center" }} // Align items properly for both views
justify="space-between"
w="100%"
gap={{ base: 0, sm: 2 }}
>
<Link as={ReactRouterLink} to={`/c/${chatId}#${id}`}>
{formatDate(date, isNarrowScreen)}
</Link>
</Text>
<Heading as="h2" size="xs" minW="fit-content">
{heading}
</Heading>
<Text
as="span"
fontSize="xs"
minW="fit-content"
color="gray.500"
_dark={{ color: "gray.300" }}
>
<Link as={ReactRouterLink} to={`/c/${chatId}#${id}`}>
{formatDate(date, isNarrowScreen)}
</Link>
</Text>
</Flex>
{headingMenu}
{!isLoading && settings.countTokens && !!tokens && (
<Tag size="sm" variant="outline" colorScheme="gray">
Expand Down
Loading