Skip to content

Commit

Permalink
Revert "style visi (#17)"
Browse files Browse the repository at this point in the history
This reverts commit 6983caa.
  • Loading branch information
zizdlp committed Aug 24, 2024
1 parent 6983caa commit 4c0029d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
15 changes: 1 addition & 14 deletions zbook_frontend/src/components/sidebars/RepoSideBarSettting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Anchor } from "@/types/interface";
import RepoSideBarSettingItem from "./RepoSideBarSetttingItem";
import { FaDiscord, FaGithub } from "react-icons/fa";
import { ThemeColor } from "../TableOfContent";
import { usePathname } from "@/navigation";

export default function RepoSideBarSetting({
username,
reponame,
Expand All @@ -29,19 +29,6 @@ export default function RepoSideBarSetting({
visibility_level: string;
theme_color: ThemeColor;
}) {
const pathname = usePathname();
let page_type = "";
if (pathname != undefined) {
const regex = new RegExp(
`^\/([^\/]+)?\/?workspace\/${username}\/?([^\/]*)?\/?$`
);
const matches = pathname.match(regex);
if (matches) {
page_type = matches[2] || "";
}
console.log("matches:", matches);
}

const t = useTranslations("SideBar");
async function manualSyncRepoHandler() {
const id = toast(t("SynchronizingRepository"), {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { MdBook } from "react-icons/md";
import { usePathname } from "@/navigation";
import SideBarLiContent from "./SideBarLiContent";
import { useTranslations } from "next-intl";
import { Lexend_Tera } from "next/font/google";
export default function UserSideBarSocial({
username,
count_following,
Expand Down
20 changes: 15 additions & 5 deletions zbook_frontend/src/components/wrappers/UpdateVisibilityButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { fetchServerWithAuthWrapper } from "@/fetchs/server_with_auth";
import { FetchServerWithAuthWrapperEndPoint } from "@/fetchs/server_with_auth_util";
import React, { useState } from "react";
import { MdOutlineVisibilityOff, MdVisibility } from "react-icons/md";
import { MdVisibility } from "react-icons/md";

export default function UpdateVisibleButton({
username,
Expand Down Expand Up @@ -49,15 +49,25 @@ export default function UpdateVisibleButton({
});
}
}
// return (
// <>
// {isVisible && (
// <MdVisibility
// onClick={async () => {
// // await actionUpdateUserBlock();
// }}
// className="p-1 w-7 h-7 cursor-pointer text-gray-500 border dark:border-0 border-gray-200 rounded dark:bg-[#263142] hover:bg-sky-500 hover:text-white dark:hover:bg-gray-900 dark:text-gray-400"
// />
// )}
// </>
// );
return (
<div
className="bg-green-500 flex space-x-2 items-center dark:bg-green-700 text-white rounded-lg py-2 px-4 font-semibold text-sm cursor-pointer hover:bg-green-600 dark:hover:bg-green-500"
className="bg-green-500 dark:bg-green-700 text-white rounded-lg py-2 px-4 font-semibold text-sm cursor-pointer hover:bg-green-600 dark:hover:bg-green-500"
onClick={() => updateFollowStatus()}
>
{isVisible ? <MdVisibility /> : <MdOutlineVisibilityOff />}

<span className="flex-1 whitespace-nowrap">
{isVisible ? "取消" : "允许"}
{isVisible ? "取消" : "添加"}
</span>
</div>
);
Expand Down

0 comments on commit 4c0029d

Please sign in to comment.