show current version in the help section dropdown (#2353)

This commit is contained in:
Aaryan Khandelwal 2023-10-04 18:31:28 +05:30 committed by GitHub
parent 05920a72a5
commit 7bdca9c73a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 52 additions and 45 deletions

View File

@ -1,5 +1,6 @@
{ {
"repository": "https://github.com/makeplane/plane.git", "repository": "https://github.com/makeplane/plane.git",
"version": "0.13.2",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"private": true, "private": true,
"workspaces": [ "workspaces": [

View File

@ -1,6 +1,6 @@
{ {
"name": "eslint-config-custom", "name": "eslint-config-custom",
"version": "0.0.0", "version": "0.13.2",
"main": "index.js", "main": "index.js",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "tailwind-config-custom", "name": "tailwind-config-custom",
"version": "0.0.1", "version": "0.13.2",
"description": "common tailwind configuration across monorepo", "description": "common tailwind configuration across monorepo",
"main": "index.js", "main": "index.js",
"devDependencies": { "devDependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "tsconfig", "name": "tsconfig",
"version": "0.0.0", "version": "0.13.2",
"private": true, "private": true,
"files": [ "files": [
"base.json", "base.json",

View File

@ -1,6 +1,6 @@
{ {
"name": "ui", "name": "ui",
"version": "0.0.0", "version": "0.13.2",
"main": "./index.tsx", "main": "./index.tsx",
"types": "./index.tsx", "types": "./index.tsx",
"license": "MIT", "license": "MIT",

View File

@ -1,6 +1,6 @@
{ {
"name": "space", "name": "space",
"version": "0.0.1", "version": "0.13.2",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev -p 4000", "dev": "next dev -p 4000",

View File

@ -1,24 +1,23 @@
import React, { useRef, useState } from "react"; import React, { useRef, useState } from "react";
import Link from "next/link"; import Link from "next/link";
// headless ui
import { Transition } from "@headlessui/react"; import { Transition } from "@headlessui/react";
// mobx store
import { useMobxStore } from "lib/mobx/store-provider";
// hooks // hooks
import useTheme from "hooks/use-theme";
import useOutsideClickDetector from "hooks/use-outside-click-detector"; import useOutsideClickDetector from "hooks/use-outside-click-detector";
// icons // icons
import { Bolt, HelpOutlineOutlined, WestOutlined } from "@mui/icons-material"; import { Bolt, HelpOutlineOutlined, WestOutlined } from "@mui/icons-material";
import { ChatBubbleOvalLeftEllipsisIcon } from "@heroicons/react/24/outline"; import { DiscordIcon } from "components/icons";
import { DocumentIcon, DiscordIcon, GithubIcon } from "components/icons"; import { FileText, Github, MessagesSquare } from "lucide-react";
// mobx store // assets
import { useMobxStore } from "lib/mobx/store-provider"; import packageJson from "package.json";
const helpOptions = [ const helpOptions = [
{ {
name: "Documentation", name: "Documentation",
href: "https://docs.plane.so/", href: "https://docs.plane.so/",
Icon: DocumentIcon, Icon: FileText,
}, },
{ {
name: "Join our Discord", name: "Join our Discord",
@ -28,13 +27,13 @@ const helpOptions = [
{ {
name: "Report a bug", name: "Report a bug",
href: "https://github.com/makeplane/plane/issues/new/choose", href: "https://github.com/makeplane/plane/issues/new/choose",
Icon: GithubIcon, Icon: Github,
}, },
{ {
name: "Chat with us", name: "Chat with us",
href: null, href: null,
onClick: () => (window as any).$crisp.push(["do", "chat:show"]), onClick: () => (window as any).$crisp.push(["do", "chat:show"]),
Icon: ChatBubbleOvalLeftEllipsisIcon, Icon: MessagesSquare,
}, },
]; ];
@ -123,21 +122,24 @@ export const WorkspaceHelpSection: React.FC<WorkspaceHelpSectionProps> = ({ setS
leaveTo="transform opacity-0 scale-95" leaveTo="transform opacity-0 scale-95"
> >
<div <div
className={`absolute bottom-2 ${ className={`absolute bottom-2 min-w-[10rem] ${
store?.theme?.sidebarCollapsed ? "left-full" : "left-[-75px]" store?.theme?.sidebarCollapsed ? "left-full" : "-left-[75px]"
} space-y-2 rounded-sm bg-custom-background-80 p-1 shadow-md`} } rounded bg-custom-background-100 p-1 shadow-custom-shadow-xs whitespace-nowrap divide-y divide-custom-border-200`}
ref={helpOptionsRef} ref={helpOptionsRef}
> >
<div className="space-y-1 pb-2">
{helpOptions.map(({ name, Icon, href, onClick }) => { {helpOptions.map(({ name, Icon, href, onClick }) => {
if (href) if (href)
return ( return (
<Link href={href} key={name}> <Link href={href} key={name}>
<a <a
target="_blank" target="_blank"
className="flex items-center gap-x-2 whitespace-nowrap rounded-md px-2 py-1 text-xs hover:bg-custom-background-90" className="flex items-center gap-x-2 rounded px-2 py-1 text-xs hover:bg-custom-background-80"
> >
<Icon className="h-4 w-4 text-custom-text-200" /> <div className="grid place-items-center flex-shrink-0">
<span className="text-sm">{name}</span> <Icon className="text-custom-text-200 h-3.5 w-3.5" size={14} />
</div>
<span className="text-xs">{name}</span>
</a> </a>
</Link> </Link>
); );
@ -146,15 +148,19 @@ export const WorkspaceHelpSection: React.FC<WorkspaceHelpSectionProps> = ({ setS
<button <button
key={name} key={name}
type="button" type="button"
onClick={onClick ? onClick : undefined} onClick={onClick ?? undefined}
className="flex w-full items-center gap-x-2 whitespace-nowrap rounded-md px-2 py-1 text-xs hover:bg-custom-background-90" className="flex w-full items-center gap-x-2 rounded px-2 py-1 text-xs hover:bg-custom-background-80"
> >
<Icon className="h-4 w-4 text-custom-sidebar-text-200" /> <div className="grid place-items-center flex-shrink-0">
<span className="text-sm">{name}</span> <Icon className="text-custom-text-200 h-3.5 w-3.5" size={14} />
</div>
<span className="text-xs">{name}</span>
</button> </button>
); );
})} })}
</div> </div>
<div className="px-2 pt-2 pb-1 text-[10px]">Version: v{packageJson.version}</div>
</div>
</Transition> </Transition>
</div> </div>
</div> </div>

View File

@ -1,6 +1,6 @@
{ {
"name": "web", "name": "web",
"version": "0.1.0", "version": "0.13.2",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev --port 3000", "dev": "next dev --port 3000",