Skip to content

Commit cb3d968

Browse files
committed
fix: changelogs mobile
1 parent 12ec1d2 commit cb3d968

6 files changed

Lines changed: 51 additions & 26 deletions

File tree

apps/changelog-app/src/components/changelog-header.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export function ChangelogHeader({
7070
</Dialog>
7171

7272
<motion.div
73-
className="fixed top-0 w-full max-w-3xl left-0 right-0 mx-auto z-50 rounded-3xl border border-border bg-white/70 backdrop-blur-sm shadow-2xl/10"
73+
className="fixed top-0 w-full max-w-3xl will-change-auto left-0 right-0 mx-auto z-50 rounded-3xl border border-border bg-white/70 backdrop-blur-sm shadow-2xl/10"
7474
style={{ top: fixedHeaderTop }}
7575
>
7676
<div className="flex items-center justify-between w-full h-full px-3.5 py-2">
@@ -117,7 +117,7 @@ export function ChangelogHeader({
117117

118118
<div className="flex items-center gap-2">
119119
{filters && (
120-
<p className="text-xs">
120+
<p className="text-xs max-sm:hidden">
121121
{dateRange &&
122122
`${dateRange.start.format("MMM D, YYYY")} - ${dateRange.end.format("MMM D, YYYY")}`}
123123
{commitRange && `${commitRange.start}..${commitRange.end}`}
@@ -171,7 +171,7 @@ export function ChangelogHeader({
171171
{showBigHeader && (
172172
<motion.header
173173
style={{ opacity: headerOpacity, scale: headerScale }}
174-
className="relative text-center flex flex-col gap-0.5 items-center justify-center min-h-64 mx-auto max-w-3xl backdrop-blur-sm border border-blue-300/30 rounded-3xl bg-background/10 p-8 py-12 mb-12 mt-12 shadow-2xl/25"
174+
className="relative text-center flex will-change-auto flex-col gap-0.5 items-center justify-center min-h-64 mx-auto max-w-3xl backdrop-blur-sm border border-blue-300/30 rounded-3xl bg-background/10 p-8 py-12 mb-12 mt-12 max-sm:m-1 max-sm:mb-12 shadow-2xl/25"
175175
>
176176
<div className="absolute left-4 top-4">
177177
<Link
@@ -185,7 +185,12 @@ export function ChangelogHeader({
185185

186186
<button
187187
className="absolute right-0 top-0 p-4"
188-
onClick={() => setHelpDialogOpen(true)}
188+
onClick={() => {
189+
setHelpDialogOpen(true);
190+
if (window.scrollY < 250) {
191+
window.scrollTo({ top: 250, behavior: "smooth" });
192+
}
193+
}}
189194
type="button"
190195
>
191196
<HelpCircle className="size-4 text-white/70 hover:text-white/50 active:text-white/50 focus:text-white/50 transition-colors duration-75" />
@@ -216,7 +221,7 @@ export function ChangelogHeader({
216221
<motion.h1
217222
layout="position"
218223
layoutId="changelog-header"
219-
className="text-3xl font-bold text-white text-shadow-xs"
224+
className="text-3xl max-sm:text-2xl font-bold text-white text-shadow-xs"
220225
>
221226
<Link
222227
to="/$owner"
@@ -234,7 +239,7 @@ export function ChangelogHeader({
234239
layoutId={`${repo}-header`}
235240
to="/$owner/$repo"
236241
params={{ owner, repo }}
237-
className="text-white hover:text-white/70 active:text-white/70 focus:text-white/70 transition-colors duration-75"
242+
className="text-white max-sm:break-all hover:text-white/70 active:text-white/70 focus:text-white/70 transition-colors duration-75"
238243
>
239244
{repo}
240245
</MotionLink>{" "}
@@ -247,7 +252,7 @@ export function ChangelogHeader({
247252
<motion.h2
248253
layout="position"
249254
layoutId={`changelog-${slug}-subheader`}
250-
className="text-lg text-white/70"
255+
className="text-lg text-white/70 max-sm:text-base max-sm:mt-1"
251256
>
252257
{dateRange &&
253258
`${dateRange.start.format("MMM D, YYYY")} - ${dateRange.end.format("MMM D, YYYY")}`}

apps/changelog-app/src/components/footer.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function Footer() {
1616
<div className="max-w-3xl mx-auto pb-12">
1717
<motion.footer
1818
style={{ opacity: footerOpacity, scale: footerScale }}
19-
className="relative border border-border rounded-3xl shadow-2xl/25"
19+
className="relative will-change-auto border border-border rounded-3xl shadow-2xl/25"
2020
>
2121
<BlueprintBackground4 />
2222
<DustOverlay className="opacity-10 absolute inset-0 rounded-xl overflow-hidden" />
@@ -26,7 +26,7 @@ export function Footer() {
2626

2727
<div className="flex items-start justify-between p-4">
2828
<div className="flex flex-col">
29-
<p className="text-2xl font-medium text-white">Changelogs.ai</p>
29+
<p className="text-2xl font-medium text-white">Changelogs AI</p>
3030
<p className="text-white/70 text-base">Generate changelogs for your projects.</p>
3131
</div>
3232

@@ -60,7 +60,7 @@ export function Footer() {
6060
</div>
6161
</div>
6262

63-
<div className="flex flex-col items-center justify-center gap-1 mt-24 pb-2">
63+
<div className="flex flex-col items-center justify-center text-center gap-1 mt-24 pb-2 px-2">
6464
<a
6565
href="https://asyncstatus.com"
6666
target="_blank"

apps/changelog-app/src/components/help-dialog-content.tsx

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
11
import { SiGithub } from "@asyncstatus/ui/brand-icons";
22
import { AsyncStatusLogo } from "@asyncstatus/ui/components/async-status-logo";
3-
import { DialogContent, DialogHeader, DialogTitle } from "@asyncstatus/ui/components/dialog";
3+
import { Button } from "@asyncstatus/ui/components/button";
4+
import {
5+
DialogClose,
6+
DialogContent,
7+
DialogFooter,
8+
DialogHeader,
9+
DialogTitle,
10+
} from "@asyncstatus/ui/components/dialog";
411

512
export function HelpDialogContent() {
613
return (
7-
<DialogContent className="sm:max-w-xl w-full rounded-3xl p-12" hideCloseButton>
8-
<DialogHeader className="text-center items-center">
9-
<DialogTitle className="text-3xl font-bold mb-6">What is Changelogs.ai?</DialogTitle>
14+
<DialogContent
15+
className="sm:max-w-xl w-full overflow-y-auto rounded-3xl p-12 max-sm:py-4 max-sm:px-4 max-sm:inset-0 max-sm:translate-0 max-sm:max-w-none m-0 max-sm:w-full max-sm:h-[calc(100vh-2rem)]"
16+
hideCloseButton
17+
>
18+
<DialogHeader className="text-center items-center max-sm:m-0! max-sm:p-0!">
19+
<DialogTitle className="text-3xl font-bold mb-6 max-sm:my-4">
20+
What is Changelogs AI?
21+
</DialogTitle>
1022
</DialogHeader>
1123

1224
<div className="prose prose-neutral">
1325
<p className="text-pretty text-xl text-black/80">
14-
<span className="text-black">Changelogs.ai</span> is a tool that generates changelogs for
26+
<span className="text-black">Changelogs AI</span> is a tool that generates changelogs for
1527
your projects, based on your commit messages, pull requests, issues and more.
1628
</p>
1729

18-
<p className="text-pretty text-xl text-black/80 mt-10!">
30+
<p className="text-pretty text-xl text-black/80 mt-10! max-sm:mt-18!">
1931
It's <span className="text-black">open-source</span>,{" "}
2032
<span className="text-black">mostly free to use</span> and powered by{" "}
2133
<a
@@ -40,7 +52,7 @@ export function HelpDialogContent() {
4052
.
4153
</p>
4254

43-
<p className="text-pretty text-xl text-black/80 mt-10!">
55+
<p className="text-pretty text-xl text-black/80 mt-10! max-sm:mt-18!">
4456
We're a team of 2 people (
4557
<a href="mailto:kacper@asyncstatus.com" className="text-blue-500">
4658
Kacper
@@ -54,9 +66,17 @@ export function HelpDialogContent() {
5466
that.
5567
</p>
5668

57-
<p className="text-pretty text-xl text-black/80 mt-10!">No standup. Just progress.</p>
69+
<p className="text-pretty text-xl text-black/80 mt-10! max-sm:mt-18!">
70+
No standup. Just progress.
71+
</p>
5872
<Handwriting />
5973
</div>
74+
75+
<DialogFooter>
76+
<DialogClose asChild>
77+
<Button variant="outline">Close</Button>
78+
</DialogClose>
79+
</DialogFooter>
6080
</DialogContent>
6181
);
6282
}

apps/changelog-app/src/routes/$owner/$repo/$filters/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ function RouteComponent() {
167167
)}
168168

169169
{mostRecentChangelog && (
170-
<motion.div className="prose prose-neutral dark:prose-invert prose-base mx-auto pb-24">
170+
<motion.div className="prose prose-neutral dark:prose-invert prose-base mx-auto pb-24 max-sm:px-4">
171171
<Markdown>{mostRecentChangelog?.content}</Markdown>
172172
</motion.div>
173173
)}

apps/changelog-app/src/routes/$owner/$repo/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function RouteComponent() {
124124
</div>
125125
)}
126126

127-
<div className="grid grid-cols-1 gap-4 max-w-3xl mx-auto">
127+
<div className="grid grid-cols-1 gap-4 max-w-3xl mx-auto max-sm:px-4">
128128
{changelogsByRepo?.data?.changelogs.map((changelog, index) => {
129129
const rangeStart = changelog.rangeStart ? dayjs(changelog.rangeStart) : undefined;
130130
const rangeEnd = changelog.rangeEnd ? dayjs(changelog.rangeEnd) : undefined;
@@ -158,13 +158,13 @@ function RouteComponent() {
158158
{commitStart} - {commitEnd}
159159
</motion.p>
160160
)}
161-
<div className="relative text-muted-foreground my-1 mb-2 line-clamp-7">
161+
<div className="relative text-muted-foreground my-1 mb-2 line-clamp-7 max-sm:mt-4">
162162
<Markdown size="sm" variant="primary">
163163
{tldr}
164164
</Markdown>
165165
<div className="absolute bottom-0 left-0 w-full h-full bg-gradient-to-t from-background to-transparent" />
166166
</div>
167-
<div className="text-xl text-muted-foreground">
167+
<div className="text-xl text-muted-foreground max-sm:mt-4">
168168
<Button asChild variant={index === 0 ? "default" : "outline"} className="w-full">
169169
<Link
170170
to="/$owner/$repo/$filters"

apps/changelog-app/src/routes/$owner/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function RouteComponent() {
5252
<ChangelogHeader owner={owner} showBigHeader={Boolean(repos.data?.length > 0)} />
5353

5454
<div className="min-h-[100dvh]">
55-
<main className="grid grid-cols-1 gap-4 md:grid-cols-2 max-w-3xl mx-auto">
55+
<main className="grid grid-cols-1 gap-4 md:grid-cols-2 max-w-3xl mx-auto max-sm:px-4">
5656
{repos.data?.map((repo) => (
5757
<div
5858
key={repo.id}
@@ -67,8 +67,8 @@ function RouteComponent() {
6767
{repo.repoName}
6868
</motion.p>
6969

70-
<div className="flex-1 flex flex-col gap-1 text-muted-foreground">
71-
<p className="text-sm truncate" title={repo.description}>
70+
<div className="flex-1 flex flex-col gap-1 text-muted-foreground max-sm:gap-4">
71+
<p className="text-sm line-clamp-2" title={repo.description}>
7272
{repo.description}
7373
</p>
7474

@@ -112,7 +112,7 @@ function RouteComponent() {
112112
</div>
113113
</div>
114114

115-
<Button asChild variant="outline" className="w-full">
115+
<Button asChild variant="outline" className="w-full max-sm:mt-4">
116116
<Link to="/$owner/$repo" params={{ owner, repo: repo.repoName }}>
117117
See changelogs
118118
<ArrowRightIcon className="size-4" />

0 commit comments

Comments
 (0)