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

Conversation

hpatel292-seneca
Copy link
Collaborator

@hpatel292-seneca hpatel292-seneca commented Nov 21, 2024

This Fixes #747

I added a Flex component around heading and date and set direction of flex to row for sm screens

                 <Flex
                    direction={{ base: "column", sm: "row" }} // Stack on mobile, row on larger screens
                    align={{ base: "flex-start", sm: "center" }} // Align items properly for both views
                    justify="space-between"
                    w="100%"
                    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" }}
                    >
                      <Link as={ReactRouterLink} to={`/c/${chatId}#${id}`}>
                        {formatDate(date, isNarrowScreen)}
                      </Link>
                    </Text>
                  </Flex>

Demo:
image

@hpatel292-seneca
Copy link
Collaborator Author

Hi @humphd @tarasglek, Please review the PR and let me know if any changes are required.

Copy link
Collaborator

@humphd humphd left a comment

Choose a reason for hiding this comment

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

Nice. A few things I notice:

Font Too Large, Vertical Gap Too Large

I think we can reduce the font size of the date, and amount of space between the two stacked divs:

Screenshot 2024-11-21 at 5 20 32 PM

Vertically Centre Star Icon

I wonder if we should vertically centre the star icon on mobile? It seems to be unaligned with anything now

Screenshot 2024-11-21 at 5 21 04 PM

Copy link

cloudflare-workers-and-pages bot commented Nov 22, 2024

Deploying chatcraft-org with  Cloudflare Pages  Cloudflare Pages

Latest commit: cc4f800
Status: ✅  Deploy successful!
Preview URL: https://5e9d33b6.console-overthinker-dev.pages.dev
Branch Preview URL: https://issue-747.console-overthinker-dev.pages.dev

View logs

@hpatel292-seneca
Copy link
Collaborator Author

Hi @humphd ,
I made the changes, Please review.

Demo:
image

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.

Copy link
Collaborator

@humphd humphd left a comment

Choose a reason for hiding this comment

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

This is really nice, great work!

@humphd humphd merged commit 9182252 into main Nov 22, 2024
4 checks passed
@humphd humphd deleted the issue-747 branch November 22, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Date and Message option are overlapping in Mobile view.
2 participants