mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2025-05-02 17:07:13 +00:00
linting
This commit is contained in:
parent
ca8bf52cce
commit
203f5964d5
3 changed files with 16 additions and 20 deletions
frontend/src
|
@ -14,7 +14,7 @@ export default function NewWorkspaceModal({ hideModal = noop }) {
|
|||
const form = new FormData(formEl.current);
|
||||
for (var [key, value] of form.entries()) data[key] = value;
|
||||
const { workspace, message } = await Workspace.new(data);
|
||||
if (!!workspace){
|
||||
if (!!workspace) {
|
||||
window.location.href = paths.workspace.chat(workspace.slug);
|
||||
}
|
||||
setError(message);
|
||||
|
@ -29,9 +29,7 @@ export default function NewWorkspaceModal({ hideModal = noop }) {
|
|||
<div className="relative w-[500px] max-h-full">
|
||||
<div className="relative bg-modal-gradient rounded-lg shadow-md border-2 border-accent">
|
||||
<div className="flex items-start justify-between p-4 border-b rounded-t border-white/10">
|
||||
<h3 className="text-xl font-semibold text-white">
|
||||
New Workspace
|
||||
</h3>
|
||||
<h3 className="text-xl font-semibold text-white">New Workspace</h3>
|
||||
<button
|
||||
onClick={hideModal}
|
||||
type="button"
|
||||
|
@ -61,9 +59,7 @@ export default function NewWorkspaceModal({ hideModal = noop }) {
|
|||
/>
|
||||
</div>
|
||||
{error && (
|
||||
<p className="text-red-400 text-sm">
|
||||
Error: {error}
|
||||
</p>
|
||||
<p className="text-red-400 text-sm">Error: {error}</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import { isMobile } from 'react-device-detect';
|
||||
import paths from '../../utils/paths';
|
||||
import { AUTH_TIMESTAMP, AUTH_TOKEN, AUTH_USER } from '../../utils/constants';
|
||||
import { Person, SignOut } from '@phosphor-icons/react';
|
||||
import { userFromStorage } from '../../utils/request';
|
||||
import React, { useState, useEffect, useRef } from "react";
|
||||
import { isMobile } from "react-device-detect";
|
||||
import paths from "../../utils/paths";
|
||||
import { AUTH_TIMESTAMP, AUTH_TOKEN, AUTH_USER } from "../../utils/constants";
|
||||
import { Person, SignOut } from "@phosphor-icons/react";
|
||||
import { userFromStorage } from "../../utils/request";
|
||||
|
||||
export default function UserMenu({ children }) {
|
||||
if (isMobile) return <>{children}</>;
|
||||
|
@ -20,14 +20,14 @@ function useLoginMode() {
|
|||
const user = !!window.localStorage.getItem(AUTH_USER);
|
||||
const token = !!window.localStorage.getItem(AUTH_TOKEN);
|
||||
|
||||
if (user && token) return 'multi';
|
||||
if (!user && token) return 'single';
|
||||
if (user && token) return "multi";
|
||||
if (!user && token) return "single";
|
||||
return null;
|
||||
}
|
||||
|
||||
function userDisplay() {
|
||||
const user = userFromStorage();
|
||||
return user?.username?.slice(0, 2) || 'AA';
|
||||
return user?.username?.slice(0, 2) || "AA";
|
||||
}
|
||||
|
||||
function UserButton() {
|
||||
|
@ -47,9 +47,9 @@ function UserButton() {
|
|||
|
||||
useEffect(() => {
|
||||
if (showMenu) {
|
||||
document.addEventListener('mousedown', handleClose);
|
||||
document.addEventListener("mousedown", handleClose);
|
||||
}
|
||||
return () => document.removeEventListener('mousedown', handleClose);
|
||||
return () => document.removeEventListener("mousedown", handleClose);
|
||||
}, [showMenu]);
|
||||
|
||||
if (mode === null) return null;
|
||||
|
@ -62,7 +62,7 @@ function UserButton() {
|
|||
type="button"
|
||||
className="uppercase transition-all duration-300 w-[35px] h-[35px] text-base font-semibold rounded-full flex items-center bg-sidebar-button hover:bg-menu-item-selected-gradient justify-center text-white p-2 hover:border-slate-100 hover:border-opacity-50 border-transparent border"
|
||||
>
|
||||
{mode === 'multi' ? userDisplay() : <Person size={14} />}
|
||||
{mode === "multi" ? userDisplay() : <Person size={14} />}
|
||||
</button>
|
||||
|
||||
{showMenu && (
|
||||
|
|
|
@ -378,4 +378,4 @@ dialog::backdrop {
|
|||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue