From e3990475e94b774cda4816c3c265b31c1cdaf7e9 Mon Sep 17 00:00:00 2001 From: Radu Cazacu Date: Tue, 23 Jan 2024 22:09:07 +0200 Subject: [PATCH] Remove all linting errors --- components/chat/Chat.tsx | 33 ++++++------ components/common/Layout/Layout.stories.tsx | 1 - components/common/Layout/Layout.tsx | 28 ++++------- components/common/Layout/StartLayout.tsx | 50 ++++++------------- components/ui/AddServer.tsx | 4 +- components/ui/context.tsx | 2 +- .../ui/workspacesBar/WorkspaceBar.stories.tsx | 5 +- pages/_app.tsx | 2 +- pages/index.tsx | 2 +- pages/server/[serverCid].tsx | 1 - pages/settings/plans.tsx | 9 ++-- pages/storage.tsx | 4 +- src-tauri/.cargo/config.toml | 4 -- 13 files changed, 53 insertions(+), 92 deletions(-) delete mode 100644 src-tauri/.cargo/config.toml diff --git a/components/chat/Chat.tsx b/components/chat/Chat.tsx index 30f00fa..0ecd5a6 100644 --- a/components/chat/Chat.tsx +++ b/components/chat/Chat.tsx @@ -1,25 +1,24 @@ import React, { useState } from 'react'; -import { IMessage } from '@common/types/messages'; import _ from 'lodash'; function Chat() { - const [messages, setMessages] = useState([]); + // const [messages, setMessages] = useState([]); const [messageInput, setMessageInput] = useState(''); - const [currentUser, setCurrentUser] = useState('User1'); - const handleSend = () => { - // append the new message to the current list of messages - setMessages((messages) => [ - ...messages, - { user: currentUser, message: messageInput, timestamp: new Date() }, - ]); - // clear the input field - setMessageInput(''); - }; - const handleUserChange = (event: React.ChangeEvent) => { - setCurrentUser(event.target.value); - }; - const [label, setLab] = useState('Standart'); + // const [currentUser, setCurrentUser] = useState('User1'); + // const handleSend = () => { + // // append the new message to the current list of messages + // setMessages((messages) => [ + // ...messages, + // { user: currentUser, message: messageInput, timestamp: new Date() }, + // ]); + // // clear the input field + // setMessageInput(''); + // }; + // const handleUserChange = (event: React.ChangeEvent) => { + // setCurrentUser(event.target.value); + // }; + // const [label, setLab] = useState('Standart'); return (
@@ -33,7 +32,7 @@ function Chat() {
diff --git a/components/common/Layout/Layout.stories.tsx b/components/common/Layout/Layout.stories.tsx index 804807e..23dce53 100644 --- a/components/common/Layout/Layout.stories.tsx +++ b/components/common/Layout/Layout.stories.tsx @@ -1,5 +1,4 @@ import { Meta, StoryFn } from '@storybook/react'; -import { Fragment } from 'react'; import { Layout as Lay } from './Layout'; export default { diff --git a/components/common/Layout/Layout.tsx b/components/common/Layout/Layout.tsx index 2af7dc0..01d1058 100644 --- a/components/common/Layout/Layout.tsx +++ b/components/common/Layout/Layout.tsx @@ -1,16 +1,8 @@ import React from 'react'; import { Fragment, useState } from 'react'; import { Dialog, Transition } from '@headlessui/react'; -import { - Bars3Icon, - DocumentDuplicateIcon, - FolderIcon, - HomeIcon, - UsersIcon, - XMarkIcon, -} from '@heroicons/react/24/outline'; +import { Bars3Icon, UsersIcon, XMarkIcon } from '@heroicons/react/24/outline'; -import { useAppSelector } from 'redux/store'; import { usePathname } from 'next/navigation'; import WorkspacesBar from '@components/ui/workspacesBar'; import AddServerModal from '@components/ui/AddServer'; @@ -33,9 +25,9 @@ function classNames(...classes: any) { export const Layout = ({ children }: Props) => { const [sidebarOpen, setSidebarOpen] = useState(false); const [addServerOpen, setAddServerOpen] = useState(false); - const currentUsedSessionCid: string = useAppSelector( - (state) => state.context.sessions.current_used_session_server - ); + // const currentUsedSessionCid: string = useAppSelector( + // (state) => state.context.sessions.current_used_session_server + // ); const pathname = usePathname(); console.log(pathname); @@ -48,13 +40,13 @@ export const Layout = ({ children }: Props) => { }, ]); - const current_sessions = useAppSelector( - (state) => state.context.sessions.current_sessions - ); + // const current_sessions = useAppSelector( + // (state) => state.context.sessions.current_sessions + // ); - const peers = Object.keys( - current_sessions[currentUsedSessionCid] ?? {} - ).length; + // const peers = Object.keys( + // current_sessions[currentUsedSessionCid] ?? {} + // ).length; return ( <> diff --git a/components/common/Layout/StartLayout.tsx b/components/common/Layout/StartLayout.tsx index 2610059..c66f4de 100644 --- a/components/common/Layout/StartLayout.tsx +++ b/components/common/Layout/StartLayout.tsx @@ -1,34 +1,16 @@ import React from 'react'; import { Fragment, useState } from 'react'; -import { Dialog, Menu, Transition } from '@headlessui/react'; +import { Dialog, Transition } from '@headlessui/react'; import { Bars3Icon, - BellIcon, - CalendarIcon, - ChartPieIcon, - ChevronDownIcon, - Cog6ToothIcon, DocumentDuplicateIcon, - FolderIcon, - HomeIcon, - MagnifyingGlassIcon, - UsersIcon, XMarkIcon, } from '@heroicons/react/24/outline'; -import { useAppSelector } from 'redux/store'; import { usePathname } from 'next/navigation'; import WorkspacesBar from '@components/ui/workspacesBar'; import AddServerModal from '@components/ui/AddServer'; -const navigation = [ - { name: 'Dashboard', href: '#', icon: HomeIcon, current: true }, - { name: 'Team', href: '#', icon: UsersIcon, current: false }, - { name: 'Projects', href: '#', icon: FolderIcon, current: false }, - { name: 'Calendar', href: '#', icon: CalendarIcon, current: false }, - { name: 'Documents', href: '#', icon: DocumentDuplicateIcon, current: false }, - { name: 'Reports', href: '#', icon: ChartPieIcon, current: false }, -]; const teams = [ { id: 1, name: 'Heroicons', href: '#', initial: 'H', current: false }, { id: 2, name: 'Tailwind Labs', href: '#', initial: 'T', current: false }, @@ -46,19 +28,19 @@ function classNames(...classes: any) { export const Layout = ({ children }: Props) => { const [sidebarOpen, setSidebarOpen] = useState(false); const [addServerOpen, setAddServerOpen] = useState(false); - const currentUsedSessionCid: string = useAppSelector( - (state) => state.context.sessions.current_used_session_server - ); + // const currentUsedSessionCid: string = useAppSelector( + // (state) => state.context.sessions.current_used_session_server + // ); const pathname = usePathname(); console.log(pathname); const [navigation, _] = useState([ - { - name: 'Find Peers', - href: `/server/findPeers/`, - icon: UsersIcon, - current: true, - }, + // { + // name: 'Find Peers', + // href: `/server/findPeers/`, + // icon: UsersIcon, + // current: true, + // }, { name: 'Storage', href: '/server/storage/', @@ -67,13 +49,13 @@ export const Layout = ({ children }: Props) => { }, ]); - const current_sessions = useAppSelector( - (state) => state.context.sessions.current_sessions - ); + // const current_sessions = useAppSelector( + // (state) => state.context.sessions.current_sessions + // ); - const peers = Object.keys( - current_sessions[currentUsedSessionCid] ?? {} - ).length; + // const peers = Object.keys( + // current_sessions[currentUsedSessionCid] ?? {} + // ).length; return ( <> diff --git a/components/ui/AddServer.tsx b/components/ui/AddServer.tsx index 9b053b6..fbb08f7 100644 --- a/components/ui/AddServer.tsx +++ b/components/ui/AddServer.tsx @@ -1,6 +1,4 @@ -import { RootState } from 'redux/store'; import { Dispatch, SetStateAction, useState } from 'react'; -import { useSelector } from 'react-redux'; export default function AddServerModal({ onCloseNavbar, @@ -13,7 +11,7 @@ export default function AddServerModal({ // const register = useRegister_c2s(); - const { uuid } = useSelector((state: RootState) => state.uuid); + // const { uuid } = useSelector((state: RootState) => state.uuid); const [fullName, setFullName] = useState(''); const [username, setUsername] = useState(''); diff --git a/components/ui/context.tsx b/components/ui/context.tsx index c4ad301..2e4a4bd 100644 --- a/components/ui/context.tsx +++ b/components/ui/context.tsx @@ -16,7 +16,7 @@ export interface StateValues { } const stateModifiers = { - setUuid: (payload: string) => {}, + setUuid: (_payload: string) => {}, }; const initialState = { uuid: '' }; diff --git a/components/ui/workspacesBar/WorkspaceBar.stories.tsx b/components/ui/workspacesBar/WorkspaceBar.stories.tsx index 44ff3ca..3e4c46a 100644 --- a/components/ui/workspacesBar/WorkspaceBar.stories.tsx +++ b/components/ui/workspacesBar/WorkspaceBar.stories.tsx @@ -1,11 +1,10 @@ -import type { Meta, StoryFn } from '@storybook/react'; +import type { Meta } from '@storybook/react'; import WorkspaceBar from './WorkspaceBar'; -import { SetStateAction } from 'react'; export default { title: 'Components/ Bar', component: WorkspaceBar, } as Meta; -export const Bar: StoryFn = () => {}} />; +// export const Bar: StoryFn = () => ; diff --git a/pages/_app.tsx b/pages/_app.tsx index afd9b63..e876296 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -22,7 +22,7 @@ function CustomApp({ Component, pageProps, }: AppProps & { Component: { Layout: FC<{ children: ReactNode }> } }) { - const [connErr, setErr] = useState(''); + const [_connErr, setErr] = useState(''); useEffect(() => { const connect = async () => { diff --git a/pages/index.tsx b/pages/index.tsx index dd7d661..3ed0f90 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -6,7 +6,7 @@ import genUuid from '@lib/utils'; import store from '@redux/store'; import { addToContext } from '@redux/slices/streamHandler.slice'; -export default function Home({ connErr }: { connErr: string }) { +export default function Home() { return ( <>
diff --git a/pages/server/[serverCid].tsx b/pages/server/[serverCid].tsx index bc993e2..98e5fb8 100644 --- a/pages/server/[serverCid].tsx +++ b/pages/server/[serverCid].tsx @@ -1,5 +1,4 @@ import { Layout } from '@components/common/Layout'; -import useListAllPeers from '@hooks/c2s/useListAllPeers'; const Server = () => { return (
diff --git a/pages/settings/plans.tsx b/pages/settings/plans.tsx index 377a8f6..3a2b376 100644 --- a/pages/settings/plans.tsx +++ b/pages/settings/plans.tsx @@ -1,5 +1,4 @@ import { Fragment } from 'react'; -import { CheckIcon, MinusIcon } from '@heroicons/react/20/solid'; import Link from 'next/link'; const tiers = [ @@ -154,7 +153,7 @@ export default function Example() { {sections.map((section) => (
    • - {section.features.map((feature) => + {/* {section.features.map((feature) => feature.tiers[tier.name] ? (
    • ) : null - )} + )} */}
  • ))} @@ -277,7 +276,7 @@ export default function Example() { {tiers.map((tier) => ( - {typeof feature.tiers[tier.name] === 'string' ? ( + {/* {typeof feature.tiers[tier.name] === 'string' ? (
    {feature.tiers[tier.name]}
    @@ -302,7 +301,7 @@ export default function Example() { in {tier.name} - )} + )} */} ))} diff --git a/pages/storage.tsx b/pages/storage.tsx index 82e3bb4..575b180 100644 --- a/pages/storage.tsx +++ b/pages/storage.tsx @@ -1,10 +1,8 @@ import { Layout } from '@components/common/Layout'; import React from 'react'; -import { useSelector } from 'react-redux'; -import { RootState } from 'redux/store'; export default function Storage() { - const { uuid } = useSelector((state: RootState) => state.uuid); + // const { uuid } = useSelector((state: RootState) => state.uuid); // const upload = (e: any) => { // const arr: string[] = []; // Array.from(e.target.files).forEach((file: any) => { diff --git a/src-tauri/.cargo/config.toml b/src-tauri/.cargo/config.toml deleted file mode 100644 index c383b48..0000000 --- a/src-tauri/.cargo/config.toml +++ /dev/null @@ -1,4 +0,0 @@ -[build] -target = "x86_64-unknown-linux-gnu" - -[target]