nicer tab styling on settings page
This commit is contained in:
parent
64bf9cfea0
commit
7ab3a0696a
3 changed files with 32 additions and 10 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { ArrowLeftIcon } from "@heroicons/react/24/outline";
|
||||
import { getFontSize } from "../util";
|
||||
|
||||
export interface PageHeaderProps {
|
||||
onTitleClick?: () => void;
|
||||
|
|
@ -15,7 +16,7 @@ export default function PageHeader({
|
|||
}: PageHeaderProps) {
|
||||
return (
|
||||
<div
|
||||
className={`bg-vsc-background sticky top-0 z-20 m-0 flex items-center justify-between bg-inherit py-0.5 ${
|
||||
className={`bg-vsc-background sticky top-0 z-20 m-0 flex items-center justify-between bg-inherit ${
|
||||
showBorder
|
||||
? "border-0 border-b-[1px] border-solid border-b-zinc-700"
|
||||
: ""
|
||||
|
|
@ -25,11 +26,16 @@ export default function PageHeader({
|
|||
{title && (
|
||||
<>
|
||||
<div
|
||||
className="cursor-pointer transition-colors duration-200 hover:text-zinc-100"
|
||||
className="flex cursor-pointer items-center transition-colors duration-200 hover:text-zinc-100"
|
||||
onClick={onTitleClick}
|
||||
>
|
||||
<ArrowLeftIcon className="ml-3 inline-block h-3 w-3" />
|
||||
<span className="m-2 inline-block text-base font-bold">
|
||||
<span
|
||||
className="mx-2 inline-block text-base font-bold"
|
||||
style={{
|
||||
fontSize: `${getFontSize() - 2}px`,
|
||||
}}
|
||||
>
|
||||
{title}
|
||||
</span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ const jetbrainsShortcuts: KeyboardShortcutProps[] = [
|
|||
function KeyboardShortcuts() {
|
||||
return (
|
||||
<div>
|
||||
<h3 className="mx-auto mb-1 text-lg">Keyboard shortcuts</h3>
|
||||
<h3 className="mx-auto mb-1 text-xl">Keyboard shortcuts</h3>
|
||||
<GridDiv>
|
||||
{(isJetBrains() ? jetbrainsShortcuts : vscodeShortcuts).map(
|
||||
(shortcut, i) => {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,14 @@
|
|||
import {
|
||||
AcademicCapIcon,
|
||||
CircleStackIcon,
|
||||
Cog6ToothIcon,
|
||||
QuestionMarkCircleIcon,
|
||||
} from "@heroicons/react/24/outline";
|
||||
import { useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import PageHeader from "../../components/PageHeader";
|
||||
import { useNavigationListener } from "../../hooks/useNavigationListener";
|
||||
import { getFontSize } from "../../util";
|
||||
import { AccountButton } from "./AccountButton";
|
||||
import { HelpCenterSection } from "./HelpCenterSection";
|
||||
import { IndexingSettingsSection } from "./IndexingSettingsSection";
|
||||
|
|
@ -12,6 +19,7 @@ type TabOption = {
|
|||
id: string;
|
||||
label: string;
|
||||
component: React.ReactNode;
|
||||
icon: React.ReactNode;
|
||||
};
|
||||
|
||||
function ConfigPage() {
|
||||
|
|
@ -21,24 +29,28 @@ function ConfigPage() {
|
|||
|
||||
const tabs: TabOption[] = [
|
||||
{
|
||||
id: "general",
|
||||
label: "General",
|
||||
id: "settings",
|
||||
label: "Settings",
|
||||
component: <UserSettingsForm />,
|
||||
icon: <Cog6ToothIcon className="h-4 w-4" />,
|
||||
},
|
||||
{
|
||||
id: "indexing",
|
||||
label: "Indexing",
|
||||
component: <IndexingSettingsSection />,
|
||||
icon: <CircleStackIcon className="h-4 w-4" />,
|
||||
},
|
||||
{
|
||||
id: "help",
|
||||
label: "Help Center",
|
||||
label: "Help",
|
||||
component: <HelpCenterSection />,
|
||||
icon: <QuestionMarkCircleIcon className="h-4 w-4" />,
|
||||
},
|
||||
{
|
||||
id: "shortcuts",
|
||||
label: "Shortcuts",
|
||||
component: <KeyboardShortcuts />,
|
||||
icon: <AcademicCapIcon className="h-4 w-4" />,
|
||||
},
|
||||
];
|
||||
|
||||
|
|
@ -53,20 +65,24 @@ function ConfigPage() {
|
|||
|
||||
<div className="flex flex-1 flex-col">
|
||||
{/* Tab Headers */}
|
||||
<div className="flex w-full justify-center">
|
||||
<div className="flex w-full justify-center border-0 border-b-[1px] border-solid border-b-zinc-700">
|
||||
{tabs.map((tab) => (
|
||||
<div
|
||||
style={{
|
||||
fontSize: `${getFontSize() - 2}px`,
|
||||
}}
|
||||
key={tab.id}
|
||||
className={`px-4 py-2`}
|
||||
className={`hover:bg-vsc-input-background flex cursor-pointer items-center gap-2 rounded-md px-4 py-2 ${activeTab === tab.id ? "" : "text-gray-400"}`}
|
||||
onClick={() => setActiveTab(tab.id)}
|
||||
>
|
||||
{tab.icon}
|
||||
{tab.label}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Tab Content */}
|
||||
<div className="flex-1 p-4">
|
||||
<div className="flex-1 px-4">
|
||||
{tabs.find((tab) => tab.id === activeTab)?.component}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue