Skip to content

Commit 2061eac

Browse files
committed
Magazin: mobile.
1 parent 9f76456 commit 2061eac

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

packages/magazin/components/star-wouter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function StarWouter() {
2020
return (
2121
<a
2222
href="https://github.com/molefrog/wouter"
23-
className="inline-flex items-center gap-2 px-3 h-9 border border-neutral-200 rounded-xl hover:bg-neutral-50 transition-colors select-none"
23+
className="inline-flex items-center gap-2 px-3 h-9 border border-neutral-200 rounded-xl hover:bg-neutral-50 transition-colors select-none whitespace-nowrap flex-shrink-0"
2424
>
2525
<i className="iconoir-star-solid text-base text-yellow-500" />
2626
<span className="text-sm font-medium">Star Wouter</span>

packages/magazin/routes/home.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ function ProductCard({ slug, brand, category, name, price, image }: Product) {
1111
className="overflow-hidden group flex flex-col h-full"
1212
>
1313
<div
14-
className="aspect-square p-12 bg-stone-100/75 group-hover:bg-stone-200/75 transition-colors rounded-t-lg"
14+
className="w-full aspect-square p-12 bg-stone-100/75 group-hover:bg-stone-200/75 transition-colors rounded-t-lg"
1515
style={{ viewTransitionName: `product-image-${slug}` }}
1616
>
17-
<img src={image} alt={name} className="object-cover w-full h-full" />
17+
<img src={image} alt={name} className="object-contain w-full h-full" />
1818
</div>
1919
<div className="p-4 bg-stone-100/75 rounded-b-lg group-hover:bg-stone-200/75 transition-colors flex-1 flex flex-col justify-between">
2020
<div className="text-sm text-neutral-400/75">
@@ -78,11 +78,11 @@ function SortSelect({
7878
onChange: (value: string) => void;
7979
}) {
8080
return (
81-
<div className="relative inline-flex items-center cursor-pointer">
81+
<div className="relative flex md:inline-flex items-center cursor-pointer w-full md:w-auto">
8282
<select
8383
value={value}
8484
onChange={(e) => onChange(e.target.value)}
85-
className="appearance-none bg-transparent text-sm text-neutral-500 pr-4 cursor-pointer hover:text-neutral-900 focus:outline-none text-right"
85+
className="appearance-none bg-transparent text-sm text-neutral-500 pr-4 cursor-pointer hover:text-neutral-900 focus:outline-none text-left md:text-right w-full md:w-auto"
8686
>
8787
{sortOptions.map((opt) => (
8888
<option key={opt.value} value={opt.value}>
@@ -150,14 +150,14 @@ export function HomePage() {
150150
go star the repo to increase our chances of becoming a billion dollar
151151
company.
152152
</p>
153-
<div className="flex items-center gap-3">
153+
<div className="flex items-center gap-3 overflow-x-auto flex-nowrap -mx-6 px-6 md:mx-0 md:px-0">
154154
<button
155155
onClick={() =>
156156
document
157157
.getElementById("products")
158158
?.scrollIntoView({ behavior: "smooth" })
159159
}
160-
className="bg-black text-white px-3 text-sm font-medium py-2 rounded-xl hover:bg-neutral-800 transition-colors shadow-sm cursor-pointer"
160+
className="bg-black text-white px-3 text-sm font-medium py-2 rounded-xl hover:bg-neutral-800 transition-colors shadow-sm cursor-pointer whitespace-nowrap flex-shrink-0"
161161
>
162162
Start shopping →
163163
</button>
@@ -166,7 +166,7 @@ export function HomePage() {
166166
</div>
167167

168168
<div
169-
className="flex items-center justify-between py-6 scroll-mt-16"
169+
className="flex flex-col md:flex-row md:items-center md:justify-between gap-4 py-6 scroll-mt-16"
170170
id="products"
171171
>
172172
<CategoryFilter

packages/magazin/routes/products/[slug].tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ export function ProductPage({ slug }: { slug: string }) {
3333
>
3434
<i className="iconoir-reply text-base" />
3535
</Link>
36-
<div className="grid grid-cols-3 gap-12">
36+
<div className="grid grid-cols-2 md:grid-cols-3 md:gap-12 gap-6">
3737
<div
38-
className="bg-stone-100/75 rounded-lg aspect-square col-span-2 p-12"
38+
className="bg-stone-100/75 rounded-lg aspect-square md:col-span-2 p-12"
3939
style={{ viewTransitionName: `product-image-${product.slug}` }}
4040
>
4141
<img
4242
src={product.image}
4343
alt={product.name}
44-
className="object-cover w-full h-full"
44+
className="object-contain w-full h-full"
4545
/>
4646
</div>
4747
<div className="pt-4">

0 commit comments

Comments
 (0)