chore: update styles

This commit is contained in:
Steven 2023-09-23 01:25:08 +08:00
parent 3488cd04c0
commit b97fb13929
4 changed files with 25 additions and 15 deletions

View File

@ -26,7 +26,7 @@ const Navigator = () => {
</button>
<button
className={classNames(
"flex flex-row justify-center items-center px-2 leading-7 text-sm dark:text-gray-400 rounded-md hover:bg-gray-200",
"flex flex-row justify-center items-center px-2 leading-7 text-sm dark:text-gray-400 rounded-md",
currentTab === "tab:mine"
? "bg-gray-600 dark:bg-zinc-700 text-white dark:text-gray-400 shadow"
: "hover:bg-gray-200 dark:hover:bg-zinc-700"
@ -40,7 +40,7 @@ const Navigator = () => {
<button
key={tag}
className={classNames(
"flex flex-row justify-center items-center px-2 leading-7 text-sm dark:text-gray-400 rounded-md hover:bg-gray-200",
"flex flex-row justify-center items-center px-2 leading-7 text-sm dark:text-gray-400 rounded-md",
currentTab === `tag:${tag}`
? "bg-gray-600 dark:bg-zinc-700 text-white dark:text-gray-400 shadow"
: "hover:bg-gray-200 dark:hover:bg-zinc-700"

View File

@ -3,6 +3,7 @@ import { isEqual } from "lodash-es";
import { useEffect, useRef, useState } from "react";
import toast from "react-hot-toast";
import { workspaceServiceClient } from "@/grpcweb";
import { releaseGuard } from "@/helpers/utils";
import { WorkspaceSetting } from "@/types/proto/api/v2/workspace_service";
const WorkspaceSection: React.FC = () => {
@ -63,6 +64,7 @@ const WorkspaceSection: React.FC = () => {
return (
<div className="w-full flex flex-col justify-start items-start space-y-4">
<p className="text-base font-semibold leading-6 text-gray-900 dark:text-gray-500">Workspace settings</p>
{releaseGuard() && (
<div className="w-full flex flex-col justify-start items-start">
<p className="mt-2 dark:text-gray-400">Custom style</p>
<Textarea
@ -73,6 +75,7 @@ const WorkspaceSection: React.FC = () => {
onChange={(event) => handleCustomStyleChange(event.target.value)}
/>
</div>
)}
<div className="w-full flex flex-col justify-start items-start">
<Checkbox
label="Enable user signup"

View File

@ -4,8 +4,12 @@ export const isNullorUndefined = (value: any) => {
return isNull(value) || isUndefined(value);
};
export function absolutifyLink(rel: string): string {
export const absolutifyLink = (rel: string): string => {
const anchor = document.createElement("a");
anchor.setAttribute("href", rel);
return anchor.href;
}
};
export const releaseGuard = () => {
return import.meta.env.MODE === "development";
};

View File

@ -1,4 +1,4 @@
import { Divider } from "@mui/joy";
import { Alert, Divider } from "@mui/joy";
import PreferenceSection from "@/components/setting/PreferenceSection";
import AccessTokenSection from "../components/setting/AccessTokenSection";
import AccountSection from "../components/setting/AccountSection";
@ -18,6 +18,9 @@ const Setting: React.FC = () => {
{isAdmin && (
<>
<Divider />
<Alert variant="soft" color="warning">
You can see the settings items below because you are an Admin.
</Alert>
<MemberSection />
<WorkspaceSection />
</>