Skip to content

Commit

Permalink
chore: remove old spaces (#3379)
Browse files Browse the repository at this point in the history
* chore: remove old spaces

* chore: remove huddle package
  • Loading branch information
bigint committed Jul 27, 2023
1 parent 3347f11 commit 1c20fe7
Show file tree
Hide file tree
Showing 35 changed files with 39 additions and 1,081 deletions.
2 changes: 0 additions & 2 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
"@headlessui/react": "^1.7.15",
"@heroicons/react": "v1",
"@hookform/resolvers": "^3.1.1",
"@huddle01/auth": "^0.0.1",
"@huddle01/react": "^0.0.11",
"@lens-protocol/sdk-gated": "^1.2.0",
"@lenster/abis": "*",
"@lenster/data": "*",
Expand Down
37 changes: 0 additions & 37 deletions apps/web/src/components/Composer/Actions/SpaceSettings/index.tsx

This file was deleted.

5 changes: 1 addition & 4 deletions apps/web/src/components/Composer/Editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const Editor: FC = () => {
(state) => state.setPublicationContent
);
const showPollEditor = usePublicationStore((state) => state.showPollEditor);
const showSpaceEditor = usePublicationStore((state) => state.showSpaceEditor);
const attachments = usePublicationStore((state) => state.attachments);
const { handleUploadAttachments } = useUploadAttachments();
const [editor] = useLexicalComposerContext();
Expand Down Expand Up @@ -74,9 +73,7 @@ const Editor: FC = () => {
}
placeholder={
<div className="pointer-events-none absolute top-[65px] whitespace-nowrap px-5 text-gray-400">
{showSpaceEditor ? (
<Trans>What do you want to talk about?</Trans>
) : showPollEditor ? (
{showPollEditor ? (
<Trans>Ask a question...</Trans>
) : (
<Trans>What's happening?</Trans>
Expand Down
39 changes: 2 additions & 37 deletions apps/web/src/components/Composer/NewPublication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ import { AudioPublicationSchema } from '@components/Shared/Audio';
import Wrapper from '@components/Shared/Embed/Wrapper';
import withLexicalContext from '@components/Shared/Lexical/withLexicalContext';
import useCreatePoll from '@components/utils/hooks/useCreatePoll';
import useCreateSpace from '@components/utils/hooks/useCreateSpace';
import useEthersWalletClient from '@components/utils/hooks/useEthersWalletClient';
import {
ChatAlt2Icon,
MicrophoneIcon,
PencilAltIcon
} from '@heroicons/react/outline';
import { ChatAlt2Icon, PencilAltIcon } from '@heroicons/react/outline';
import type {
CollectCondition,
EncryptedMetadata,
Expand Down Expand Up @@ -93,7 +88,6 @@ import { v4 as uuid } from 'uuid';
import { useContractWrite, usePublicClient, useSignTypedData } from 'wagmi';

import PollEditor from './Actions/PollSettings/PollEditor';
import SpaceSettings from './Actions/SpaceSettings';
import Editor from './Editor';

const Attachment = dynamic(
Expand Down Expand Up @@ -164,8 +158,6 @@ const NewPublication: FC<NewPublicationProps> = ({ publication }) => {
showPollEditor,
setShowPollEditor,
resetPollConfig,
showSpaceEditor,
setShowSpaceEditor,
pollConfig,
community,
setCommunity
Expand Down Expand Up @@ -201,7 +193,6 @@ const NewPublication: FC<NewPublicationProps> = ({ publication }) => {
const publicClient = usePublicClient();
const { data: walletClient } = useEthersWalletClient();
const [createPoll] = useCreatePoll();
const [createSpace] = useCreateSpace();

const isComment = Boolean(publication);
const hasAudio = ALLOWED_AUDIO_TYPES.includes(
Expand All @@ -228,7 +219,6 @@ const NewPublication: FC<NewPublicationProps> = ({ publication }) => {
setQuotedPublication(null);
setShowPollEditor(false);
resetPollConfig();
setShowSpaceEditor(false);
setAttachments([]);
setVideoThumbnail({
url: '',
Expand Down Expand Up @@ -698,30 +688,12 @@ const NewPublication: FC<NewPublicationProps> = ({ publication }) => {
);
}

// Create Space in Huddle
let spaceId = null;
if (showSpaceEditor) {
spaceId = await createSpace();
}

const attributes: MetadataAttributeInput[] = [
{
traitType: 'type',
displayType: PublicationMetadataDisplayTypes.String,
value: getMainContentFocus()?.toLowerCase()
},
...(showSpaceEditor
? [
{
traitType: 'audioSpace',
displayType: PublicationMetadataDisplayTypes.String,
value: JSON.stringify({
id: spaceId,
host: '0x3A5bd1E37b099aE3386D13947b6a90d97675e5e3'
})
}
]
: []),
...(quotedPublication
? [
{
Expand Down Expand Up @@ -925,7 +897,6 @@ const NewPublication: FC<NewPublicationProps> = ({ publication }) => {
</>
)}
<PollSettings />
{!isComment ? <SpaceSettings /> : null}
</div>
<div className="ml-auto pt-2 sm:pt-0">
<Button
Expand All @@ -940,19 +911,13 @@ const NewPublication: FC<NewPublicationProps> = ({ publication }) => {
<Spinner size="xs" />
) : isComment ? (
<ChatAlt2Icon className="h-4 w-4" />
) : showSpaceEditor ? (
<MicrophoneIcon className="h-4 w-4" />
) : (
<PencilAltIcon className="h-4 w-4" />
)
}
onClick={createPublication}
>
{isComment
? t`Comment`
: showSpaceEditor
? t`Start Space`
: t`Post`}
{isComment ? t`Comment` : t`Post`}
</Button>
</div>
</div>
Expand Down
16 changes: 0 additions & 16 deletions apps/web/src/components/Publication/PublicationBody.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import Attachments from '@components/Shared/Attachments';
import Quote from '@components/Shared/Embed/Quote';
import Space from '@components/Shared/Embed/Space';
import Markup from '@components/Shared/Markup';
import Oembed from '@components/Shared/Oembed';
import Snapshot from '@components/Shared/Snapshot';
import { EyeIcon } from '@heroicons/react/outline';
import { FeatureFlag } from '@lenster/data/feature-flags';
import type { Publication } from '@lenster/lens';
import getPublicationAttribute from '@lenster/lib/getPublicationAttribute';
import getSnapshotProposalId from '@lenster/lib/getSnapshotProposalId';
import getURLs from '@lenster/lib/getURLs';
import isFeatureEnabled from '@lenster/lib/isFeatureEnabled';
import type { SpaceMetadata } from '@lenster/types/spaces';
import { Trans } from '@lingui/macro';
import clsx from 'clsx';
import Link from 'next/link';
Expand All @@ -30,7 +26,6 @@ const PublicationBody: FC<PublicationBodyProps> = ({
showMore = false,
quoted = false
}) => {
const isSpacesEnabled = isFeatureEnabled(FeatureFlag.Spaces);
const { id, metadata } = publication;
const canShowMore = metadata?.content?.length > 450 && showMore;
const urls = getURLs(metadata?.content);
Expand All @@ -40,13 +35,6 @@ const PublicationBody: FC<PublicationBodyProps> = ({
metadata.attributes,
'quotedPublicationId'
);
const spaceObject = getPublicationAttribute(
metadata.attributes,
'audioSpace'
);
const space: SpaceMetadata = Boolean(spaceObject)
? JSON.parse(spaceObject)
: null;

let content = metadata?.content;
const filterId = snapshotProposalId || quotedPublicationId;
Expand All @@ -63,10 +51,6 @@ const PublicationBody: FC<PublicationBodyProps> = ({
return <DecryptedPublicationBody encryptedPublication={publication} />;
}

if (Boolean(space?.id) && isSpacesEnabled) {
return <Space publication={publication} />;
}

const showAttachments = metadata?.media?.length > 0;
const showSnapshot = snapshotProposalId;
const showQuotedPublication = quotedPublicationId && !quoted;
Expand Down
169 changes: 0 additions & 169 deletions apps/web/src/components/Shared/Embed/Space/SpacePlayer.tsx

This file was deleted.

Loading

2 comments on commit 1c20fe7

@vercel
Copy link

@vercel vercel bot commented on 1c20fe7 Jul 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

web – ./apps/web

lenster.vercel.app
web-git-main-lenster.vercel.app
lenster.xyz
web-lenster.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 1c20fe7 Jul 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

prerender – ./apps/prerender

prerender-git-main-lenster.vercel.app
prerender.lenster.xyz
prerender-lenster.vercel.app

Please sign in to comment.