Remove dummy data

This commit is contained in:
SleeplessOne1917 2023-07-22 22:44:27 -04:00
parent 38f9c6de87
commit 89634a35e8

View file

@ -41,46 +41,6 @@ function uriToQuery(uri: string) {
return match ? `!${match[2]}@${match[1]}` : "";
}
const _test_com_view: CommunityView = {
community: {
id: 2,
name: "test",
title: "Testy",
description:
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
removed: false,
published: "2023-07-08T03:12:46.323277",
updated: "2023-07-22T00:29:46.425846",
deleted: false,
nsfw: false,
actor_id: "https://localhost/c/test",
local: true,
icon: "http://localhost:1236/pictrs/image/dc71f5e8-fdb2-48ae-8a49-f504e4adaf26.png",
banner:
"http://localhost:1236/pictrs/image/fdf28def-5c4d-49a6-84bc-fd6b5d901cc7.jpeg",
hidden: false,
posting_restricted_to_mods: false,
instance_id: 1,
followers_url: "dwdwdwd",
inbox_url: "dwdwdwdw",
},
subscribed: "Subscribed",
blocked: false,
counts: {
id: 1,
community_id: 2,
subscribers: 1,
posts: 1,
comments: 30,
published: "2023-07-08T03:12:46.323277",
users_active_day: 1,
users_active_week: 1,
users_active_month: 1,
users_active_half_year: 1,
hot_rank: 0,
},
};
async function handleToggleFollow(i: RemoteFetch, follow: boolean) {
const { resolveObjectRes } = i.state;
if (resolveObjectRes.state === "success" && resolveObjectRes.data.community) {
@ -169,31 +129,32 @@ export class RemoteFetch extends Component<any, RemoteFetchState> {
}
get content() {
const status = "success" as "success" | "loading" | "empty";
const res = this.state.resolveObjectRes;
const { uri } = getRemoteFetchQueryParams();
const remoteCommunityName = uri ? uriToQuery(uri) : "remote community";
switch (status) {
switch (res.state) {
case "success": {
const communityView = res.data.community as CommunityView;
return (
<>
<h1>Community Federated!</h1>
<div className="card mt-5">
{_test_com_view.community.banner && (
<PictrsImage src={_test_com_view.community.banner} cardTop />
{communityView.community.banner && (
<PictrsImage src={communityView.community.banner} cardTop />
)}
<div className="card-body">
<h2 className="card-title">
<CommunityLink community={_test_com_view.community} />
<CommunityLink community={communityView.community} />
</h2>
{_test_com_view.community.description && (
{communityView.community.description && (
<div className="card-text mb-3 preview-lines">
{_test_com_view.community.description}
{communityView.community.description}
</div>
)}
<SubscribeButton
communityView={_test_com_view}
communityView={communityView}
onFollow={linkEvent(this, handleFollow)}
onUnFollow={linkEvent(this, handleUnfollow)}
loading={this.state.followCommunityLoading}