Skip to content

Commit

Permalink
feat: fix community page shimmer (#3288)
Browse files Browse the repository at this point in the history
* chore: add defaultOptions to tanstack client

* feat: fix community page shimmer
  • Loading branch information
bigint committed Jul 21, 2023
1 parent b125886 commit 52c0254
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 12 deletions.
4 changes: 3 additions & 1 deletion apps/web/src/components/Common/Providers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ const livepeerClient = createReactClient({
provider: studioProvider({ apiKey: '' })
});

const queryClient = new QueryClient();
const queryClient = new QueryClient({
defaultOptions: { queries: { refetchOnWindowFocus: false } }
});
const apolloClient = webClient;

const Providers = ({ children }: { children: ReactNode }) => {
Expand Down
10 changes: 2 additions & 8 deletions apps/web/src/components/Community/Shimmer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import PublicationsShimmer from '@components/Shared/Shimmer/PublicationsShimmer'
import { GridItemEight, GridItemFour, GridLayout } from '@lenster/ui';
import type { FC } from 'react';

const ProfilePageShimmer: FC = () => {
const CommunityPageShimmer: FC = () => {
return (
<GridLayout className="pt-6">
<GridItemFour>
Expand Down Expand Up @@ -44,16 +44,10 @@ const ProfilePageShimmer: FC = () => {
</div>
</GridItemFour>
<GridItemEight>
<div className="mb-5 mt-3 flex gap-3 px-5 sm:mt-0 sm:px-0">
<div className="shimmer h-8 w-14 rounded-lg sm:w-28" />
<div className="shimmer h-8 w-14 rounded-lg sm:w-28" />
<div className="shimmer h-8 w-14 rounded-lg sm:w-28" />
<div className="shimmer h-8 w-14 rounded-lg sm:w-28" />
</div>
<PublicationsShimmer />
</GridItemEight>
</GridLayout>
);
};

export default ProfilePageShimmer;
export default CommunityPageShimmer;
4 changes: 2 additions & 2 deletions apps/web/src/components/Community/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Custom500 from 'src/pages/500';

import Details from './Details';
import Feed from './Feed';
import ProfilePageShimmer from './Shimmer';
import CommunityPageShimmer from './Shimmer';

const ViewCommunity: NextPage = () => {
const {
Expand Down Expand Up @@ -46,7 +46,7 @@ const ViewCommunity: NextPage = () => {
}

if (isLoading) {
return <ProfilePageShimmer />;
return <CommunityPageShimmer />;
}

if (!data) {
Expand Down
8 changes: 8 additions & 0 deletions apps/web/src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -2450,6 +2450,14 @@ msgstr ""
msgid "You can't reply to this post"
msgstr ""

#: src/components/Shared/Community/JoinOrLeave.tsx
msgid "Successfully left the community"
msgstr "Successfully left the community"

#: src/components/Shared/Community/JoinOrLeave.tsx
msgid "Successfully joined the community"
msgstr "Successfully joined the community"

#: src/components/Shared/Community/JoinOrLeave.tsx
msgid "Leave"
msgstr "Leave"
Expand Down
8 changes: 8 additions & 0 deletions apps/web/src/locales/fr/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -2450,6 +2450,14 @@ msgstr ""
msgid "You can't reply to this post"
msgstr ""

#: src/components/Shared/Community/JoinOrLeave.tsx
msgid "Successfully left the community"
msgstr ""

#: src/components/Shared/Community/JoinOrLeave.tsx
msgid "Successfully joined the community"
msgstr ""

#: src/components/Shared/Community/JoinOrLeave.tsx
msgid "Leave"
msgstr ""
Expand Down
8 changes: 8 additions & 0 deletions apps/web/src/locales/ru/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -2450,6 +2450,14 @@ msgstr "Новый"
msgid "You can't reply to this post"
msgstr "Вы не можете ответить на этот пост"

#: src/components/Shared/Community/JoinOrLeave.tsx
msgid "Successfully left the community"
msgstr ""

#: src/components/Shared/Community/JoinOrLeave.tsx
msgid "Successfully joined the community"
msgstr ""

#: src/components/Shared/Community/JoinOrLeave.tsx
msgid "Leave"
msgstr ""
Expand Down
8 changes: 8 additions & 0 deletions apps/web/src/locales/ta/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -2450,6 +2450,14 @@ msgstr "புதியது"
msgid "You can't reply to this post"
msgstr "இந்த இடுகைக்கு நீங்கள் பதிலளிக்க முடியாது"

#: src/components/Shared/Community/JoinOrLeave.tsx
msgid "Successfully left the community"
msgstr ""

#: src/components/Shared/Community/JoinOrLeave.tsx
msgid "Successfully joined the community"
msgstr ""

#: src/components/Shared/Community/JoinOrLeave.tsx
msgid "Leave"
msgstr ""
Expand Down
8 changes: 8 additions & 0 deletions apps/web/src/locales/zh/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -2450,6 +2450,14 @@ msgstr "新的"
msgid "You can't reply to this post"
msgstr "您无法回复此帖子"

#: src/components/Shared/Community/JoinOrLeave.tsx
msgid "Successfully left the community"
msgstr ""

#: src/components/Shared/Community/JoinOrLeave.tsx
msgid "Successfully joined the community"
msgstr ""

#: src/components/Shared/Community/JoinOrLeave.tsx
msgid "Leave"
msgstr ""
Expand Down
5 changes: 4 additions & 1 deletion packages/workers/metadata/src/handlers/postMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ export default async (request: IRequest, env: Env) => {

// Append Tags to metadata
const taggerResponseJson: any = await responses[0].json();
payload.tags = taggerResponseJson.topics;
payload.tags = [
...(payload.tags as string[]),
...taggerResponseJson.topics
];

// Append Locale to metadata
const localeResponse: any = await responses[1].json();
Expand Down

0 comments on commit 52c0254

Please sign in to comment.