Skip to content

Commit

Permalink
Daily/optimize ui2 (nacos-group#651)
Browse files Browse the repository at this point in the history
* fix:build missing variable

* fix style

* fix: style/ BACK

* fix: BACK\slider position
  • Loading branch information
xpy01xpy authored May 8, 2024
1 parent 0ed82bd commit 5157ec9
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/components/common/Header/CommunityMenu.astro
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const communityItems = [
const categoryMap = {
article: "blog_article",
case: "blog_case.",
case: "blog_case",
ecosystem: "blog_ecosystem",
release: "news_release",
committer: "news_personnel",
Expand Down
16 changes: 15 additions & 1 deletion src/components/markdownSet/BlogTop.astro
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const backIconMap = {
<div class="blog_header_title">{title}</div>
<div class="blog_category_menu">
{
(type === "home" || type == "blog-sub") &&
["blog-sub", "home"].includes(type) &&
category &&
category.map((category) => {
return (
Expand All @@ -36,6 +36,20 @@ const backIconMap = {
);
})
}

{
!["home", "blog-sub"].includes(type) && (
<Button
type="primary"
href={backIconMap[type]}
class="rounded-3xl"
visibility={false}
>
<Icon name="left-arrow" class="text-lg align-middle" />
<span class="ml-1">BACK</span>
</Button>
)
}
</div>
</BaseContainer>
</div>
Expand Down
33 changes: 19 additions & 14 deletions src/components/markdownSet/SimpleContainer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,26 @@ if(pageList && pageList.length) {
---

<BaseContainer class="flex justify-between">
<div class="max-w-[200px] min-w-[200px] hidden 2xl:block xl:block lg:block">
<div class="text-lg text-gray-08 mb-[32px]">文章</div>
<div class="text-[16px] text-gray-14">
{
pageList.map(post=>{
return (
<a
class="text-gray-14 no-underline font-normal block mb-[24px]"
href={`#${post.slug}`}
>
{ post.data.title }
</a>
);
})
<div class="max-w-[200px] min-w-[200px] hidden 2xl:block xl:block lg:block relative">
<div class="sticky top-[100px]">
{pageList && pageList.length?
<div class="text-lg text-gray-08 mb-[32px]">文章</div>
:null
}
<div class="text-[16px] text-gray-14">
{
pageList.map(post=>{
return (
<a
class="text-gray-14 no-underline font-normal block mb-[24px]"
href={`#${post.slug}`}
>
{ post.data.title }
</a>
);
})
}
</div>
</div>
</div>

Expand Down
10 changes: 8 additions & 2 deletions src/pages/blog/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,17 @@ const next = articlePosts[0].entries[currentIndex + 1];
<script>
const url = new URL(window.location.href);
let source = url.searchParams.get("source");
source = source.replace(/_/g, "/");
if(source) {
source = source.replace(/_/g, "/");
};
const backBtn: HTMLAnchorElement = document.querySelector("#back-btn a");
backBtn.onclick = (e) => {
e.preventDefault();
location.href = `/${source}/`;
if(source && source !== 'undefined') {
location.href = `/${source}/`;
} else {
location.href = `/blog/`;
};
};
</script>

Expand Down

0 comments on commit 5157ec9

Please sign in to comment.