diff --git a/pkg/interface/src/views/landscape/components/GroupSwitcher.tsx b/pkg/interface/src/views/landscape/components/GroupSwitcher.tsx index f5e373d270..2b51e76804 100644 --- a/pkg/interface/src/views/landscape/components/GroupSwitcher.tsx +++ b/pkg/interface/src/views/landscape/components/GroupSwitcher.tsx @@ -1,21 +1,18 @@ -import React from "react"; +import React from 'react'; import { - Center, Box, Col, Row, Text, - IconButton, - Button, - Icon, -} from "@tlon/indigo-react"; -import { uxToHex } from "~/logic/lib/util"; -import { Link } from "react-router-dom"; + Icon +} from '@tlon/indigo-react'; +import { uxToHex } from '~/logic/lib/util'; +import { Link } from 'react-router-dom'; -import { Association, Associations } from "~/types/metadata-update"; -import { Dropdown } from "~/views/components/Dropdown"; -import { Workspace } from "~/types"; -import { getTitleFromWorkspace } from "~/logic/lib/workspace"; +import { Associations } from '~/types/metadata-update'; +import { Dropdown } from '~/views/components/Dropdown'; +import { Workspace } from '~/types'; +import { getTitleFromWorkspace } from '~/logic/lib/workspace'; const GroupSwitcherItem = ({ to, children, bottom = false, ...rest }) => ( @@ -47,7 +44,7 @@ function RecentGroups(props: { recent: string[]; associations: Associations }) { return (e in associations?.contacts); }).slice(1, 5).map((g) => { const assoc = associations.contacts[g]; - const color = uxToHex(assoc?.metadata?.color || "0x0"); + const color = uxToHex(assoc?.metadata?.color || '0x0'); return ( @@ -60,7 +57,7 @@ function RecentGroups(props: { recent: string[]; associations: Associations }) { bg={`#${color}`} mr={2} display="block" - flexShrink='0' + flexShrink={0} /> {assoc?.metadata?.title} @@ -76,6 +73,7 @@ export function GroupSwitcher(props: { workspace: Workspace; baseUrl: string; recentGroups: string[]; + isAdmin: any; }) { const { associations, workspace, isAdmin } = props; const title = getTitleFromWorkspace(associations, workspace); @@ -131,9 +129,9 @@ export function GroupSwitcher(props: { Join Group - {workspace.type === "group" && ( + {workspace.type === 'group' && ( <> - + Participants - + Group Settings - {isAdmin && ( + {isAdmin && ( - {title} + {title} - {(workspace.type === "group") && ( + {(workspace.type === 'group') && ( <> - {isAdmin && ( + {isAdmin && ( )} - + diff --git a/pkg/interface/src/views/landscape/components/Sidebar/Sidebar.tsx b/pkg/interface/src/views/landscape/components/Sidebar/Sidebar.tsx index 1fec33daa6..61380aaee3 100644 --- a/pkg/interface/src/views/landscape/components/Sidebar/Sidebar.tsx +++ b/pkg/interface/src/views/landscape/components/Sidebar/Sidebar.tsx @@ -1,26 +1,24 @@ -import React, { ReactNode } from "react"; +import React, { ReactNode } from 'react'; import styled from 'styled-components'; import { - Box, - Col, -} from "@tlon/indigo-react"; -import { Link } from "react-router-dom"; + Col +} from '@tlon/indigo-react'; -import GlobalApi from "~/logic/api/global"; -import { GroupSwitcher } from "../GroupSwitcher"; +import GlobalApi from '~/logic/api/global'; +import { GroupSwitcher } from '../GroupSwitcher'; import { Associations, Workspace, Groups, Invites, - Rolodex, -} from "~/types"; -import { SidebarListHeader } from "./SidebarListHeader"; -import { useLocalStorageState } from "~/logic/lib/useLocalStorageState"; -import { getGroupFromWorkspace } from "~/logic/lib/workspace"; + Rolodex +} from '~/types'; +import { SidebarListHeader } from './SidebarListHeader'; +import { useLocalStorageState } from '~/logic/lib/useLocalStorageState'; +import { getGroupFromWorkspace } from '~/logic/lib/workspace'; import { SidebarAppConfigs } from './types'; -import { SidebarList } from "./SidebarList"; -import { roleForShip } from "~/logic/lib/group"; +import { SidebarList } from './SidebarList'; +import { roleForShip } from '~/logic/lib/group'; const ScrollbarLessCol = styled(Col)` scrollbar-width: none !important; @@ -30,7 +28,6 @@ const ScrollbarLessCol = styled(Col)` } `; - interface SidebarProps { contacts: Rolodex; children: ReactNode; @@ -49,23 +46,23 @@ interface SidebarProps { } export function Sidebar(props: SidebarProps) { - const { invites, api, associations, selected, apps, workspace } = props; + const { associations, selected, workspace } = props; const groupPath = getGroupFromWorkspace(workspace); - const display = props.mobileHide ? ["none", "flex"] : "flex"; + const display = props.mobileHide ? ['none', 'flex'] : 'flex'; if (!associations) { return null; } const [config, setConfig] = useLocalStorageState( - `group-config:${groupPath || "home"}`, + `group-config:${groupPath || 'home'}`, { - sortBy: "lastUpdated", - hideUnjoined: false, + sortBy: 'lastUpdated', + hideUnjoined: false } ); const role = props.groups?.[groupPath] ? roleForShip(props.groups[groupPath], window.ship) : undefined; - const isAdmin = (role === "admin") || (workspace?.type === 'home'); + const isAdmin = (role === 'admin') || (workspace?.type === 'home'); return ( + selected={selected || ''} + workspace={workspace} + /> - - - - + New Channel - - - ); }