Skip to content

Commit ba193cb

Browse files
update: blog and case-studies logic in mobile version
1 parent 151466c commit ba193cb

File tree

4 files changed

+3
-141
lines changed

4 files changed

+3
-141
lines changed

src/components/header/popovers/popover-nav-item-ecosystem.tsx

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const PopOverNavItemEcosystem = ({
4444
leaveFrom="transform opacity-100 scale-100"
4545
leaveTo="transform opacity-0 scale-95"
4646
>
47-
<Menu.Items className="absolute left-1/2 z-[35] w-[593px] origin-top-right translate-x-[-40%] pt-4 focus:outline-none 2xl:-translate-x-1/2">
47+
<Menu.Items className="absolute left-1/2 z-[35] w-[303px] origin-top-right translate-x-[-40%] pt-4 focus:outline-none 2xl:-translate-x-1/2">
4848
<div className="flex flex-col overflow-hidden rounded-3xl border bg-background2 shadow-lg">
4949
<div className="flex gap-2.5 p-5 ">
5050
<div className="flex w-full flex-1 flex-col">
@@ -89,53 +89,6 @@ const PopOverNavItemEcosystem = ({
8989
);
9090
})}
9191
</div>
92-
93-
<div className="flex w-full flex-1 flex-col border-l pl-2.5">
94-
<a
95-
href="/case-studies"
96-
className="flex items-center gap-1.5 px-8 py-1.5 text-sm font-medium text-[#939393] transition-all hover:text-foreground dark:text-para"
97-
>
98-
Case Studies{" "}
99-
<svg
100-
width="5"
101-
height="8"
102-
viewBox="0 0 5 8"
103-
fill="none"
104-
xmlns="http://www.w3.org/2000/svg"
105-
>
106-
<path
107-
fill-rule="evenodd"
108-
clip-rule="evenodd"
109-
d="M0.181065 7.8262C0.0706915 7.71148 0.0103791 7.55763 0.0133823 7.39847C0.0163854 7.2393 0.0824583 7.08784 0.197081 6.97736L3.35061 4.00641L0.197081 1.03546C0.137546 0.981454 0.0894565 0.91605 0.0556622 0.843121C0.021868 0.770192 0.00305651 0.691221 0.000342236 0.610888C-0.00237204 0.530555 0.011066 0.450494 0.0398605 0.37545C0.0686551 0.300406 0.11222 0.231906 0.167974 0.174007C0.223728 0.116109 0.290537 0.0699911 0.364441 0.0383859C0.438345 0.00678061 0.517842 -0.00966837 0.59822 -0.00998595C0.678598 -0.0103035 0.758222 0.00551602 0.832374 0.0365347C0.906526 0.067554 0.973698 0.113142 1.02991 0.170598L4.63349 3.57398C4.69162 3.63 4.73785 3.69717 4.76943 3.77147C4.80101 3.84577 4.81729 3.92568 4.81729 4.00641C4.81729 4.08714 4.80101 4.16704 4.76943 4.24134C4.73785 4.31564 4.69162 4.38281 4.63349 4.43884L1.02991 7.84222C0.915188 7.95259 0.761339 8.01291 0.602172 8.0099C0.443004 8.0069 0.291541 7.94083 0.181065 7.8262Z"
110-
fill="currentColor"
111-
/>
112-
</svg>
113-
</a>
114-
{posts
115-
?.filter(({ data }) =>
116-
data.categories.some(
117-
(category: string) =>
118-
category.toLowerCase() === "case studies",
119-
),
120-
)
121-
?.slice(0, 2)
122-
?.map(({ data, slug }, i) => {
123-
return (
124-
<a
125-
key={i}
126-
href={`/case-studies/${slug}`}
127-
className="group flex cursor-pointer flex-col gap-0.5 rounded-lg px-8 py-1.5 text-sm transition-all hover:bg-gray-50 dark:hover:bg-black/10 "
128-
>
129-
<p className="line-clamp-1 font-medium group-hover:text-foreground ">
130-
{data.title}
131-
</p>
132-
<p className="line-clamp-1 text-para">
133-
{data.description}
134-
</p>
135-
</a>
136-
);
137-
})}
138-
</div>
13992
</div>
14093
</div>
14194
</Menu.Items>

src/pages/blog/[slug].astro

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -284,30 +284,6 @@ const { Content } = await post.render();
284284
</div>
285285
</div>
286286

287-
<!-- Related Articles Section -->
288-
<div class="mb-10 mt-10 space-y-10 md:mb-0 md:hidden">
289-
<div>
290-
<p class="text-xs font-bold text-foreground">Related Articles</p>
291-
<div class="mt-3 flex flex-col space-y-2">
292-
{
293-
relatedArticles
294-
.sort(() => Math.random() - 0.5)
295-
.slice(0, 4)
296-
.map((post: BlogPost) => {
297-
return (
298-
<a
299-
href={`/blog/${post.slug}`}
300-
class="line-clamp-2 cursor-pointer text-xs text-darkText hover:text-primary hover:no-underline"
301-
>
302-
{post.data.title}
303-
</a>
304-
);
305-
})
306-
}
307-
</div>
308-
</div>
309-
</div>
310-
311287
<!-- Console Banner Mobile -->
312288
<div class="mb-10 mt-10 md:hidden">
313289
<ConsoleBanner />

src/pages/case-studies/[slug].astro

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import BlogLayout from "@/layouts/blog-layout.astro";
88
import { proseClasses } from "@/lib/prose-classes";
99
import { Image } from "astro:assets";
1010
import { getCollection, type CollectionEntry } from "astro:content";
11-
import clsx from "clsx";
1211
import { Facebook, Linkedin } from "lucide-react";
1312
1413
type BlogPost = CollectionEntry<"Blog">;
@@ -230,79 +229,11 @@ const { Content } = await post.render();
230229
</div>
231230
</div>
232231

233-
<!-- Other Case Studies Section -->
234-
<div class="mb-10 mt-10 space-y-10 md:mb-0 md:hidden">
235-
<div>
236-
<p class="text-xs font-bold text-foreground">Other Case Studies</p>
237-
<div class="mt-3 flex flex-col space-y-2">
238-
{
239-
otherCaseStudies.slice(0, 4).map((caseStudy: BlogPost) => {
240-
return (
241-
<a
242-
href={`/case-studies/${caseStudy.slug}`}
243-
class="line-clamp-2 cursor-pointer text-xs text-darkText hover:text-primary hover:no-underline"
244-
>
245-
{caseStudy.data.title}
246-
</a>
247-
);
248-
})
249-
}
250-
</div>
251-
</div>
252-
</div>
253-
254232
<!-- Console Banner Mobile -->
255233
<div class="mb-10 mt-10 md:hidden">
256234
<ConsoleBanner />
257235
</div>
258236

259-
<!-- Mobile CTA Banner for Deploy on Console (after Other Case Studies) -->
260-
<div class="mb-10 mt-10 md:hidden">
261-
<section
262-
class={clsx(
263-
"flex flex-col items-center justify-around",
264-
"bg-white dark:bg-background2",
265-
"border-y",
266-
"px-[30px] py-[80px] lg:py-[160px]",
267-
"text-center"
268-
)}
269-
>
270-
<h2
271-
class={clsx(
272-
"max-w-[1000px] font-instrument text-foreground",
273-
"text-3xl md:text-5xl xl:text-6xl 2xl:text-[80px]",
274-
"md:leading-snug"
275-
)}
276-
>
277-
Experience the Supercloud.
278-
</h2>
279-
280-
<div class="mt-6 md:mt-10">
281-
<div class="hidden md:block">
282-
<ButtonLink
283-
link="https://console.akash.network/"
284-
size="xl"
285-
className="bg-primary text-white hover:bg-darkGray"
286-
id="console-case-study"
287-
>
288-
Console Login
289-
</ButtonLink>
290-
</div>
291-
292-
<div class="block md:hidden">
293-
<ButtonLink
294-
link="https://console.akash.network/"
295-
size="md"
296-
className="bg-primary text-white hover:bg-darkGray"
297-
id="console-case-study-mobile"
298-
>
299-
Console Login
300-
</ButtonLink>
301-
</div>
302-
</div>
303-
</section>
304-
</div>
305-
306237
<div class="hidden items-center justify-between py-10 md:flex">
307238
<p class="text-center text-base font-bold text-foreground">
308239
Share this Case Study

src/utils/hideCta.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ export const hiddenPaths = [
33
"/pricing/gpus",
44
"/akash-accelerate-2024",
55
"/gpus-on-demand",
6+
"/case-studies/",
7+
"/blog/",
68
];
79

810
export const shouldHideCta = (pathname: string) => {

0 commit comments

Comments
 (0)