Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release] Hotfix 6.7.1 => 6.7.2 (patch) #3891

Merged
merged 20 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,10 @@
"BSCT",
"Moonriver",
"chainid",
"Solflare"
"Solflare",
"Buttrfly",
"Soulbound",
"Fren"
],
"flagWords": [],
"ignorePaths": [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mask.social",
"type": "module",
"version": "6.7.1",
"version": "6.7.2",
"private": true,
"packageManager": "[email protected]",
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions src/app/(normal)/channel/[source]/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { memoizeWithRedis } from '@/helpers/memoizeWithRedis.js';
import { resolveSocialMediaProvider } from '@/helpers/resolveSocialMediaProvider.js';
import { resolveSocialSource } from '@/helpers/resolveSource.js';
import { runInSafeAsync } from '@/helpers/runInSafe.js';
import { setupLocaleForSSR } from '@/i18n/index.js';
import type { NextPageProps } from '@/types/index.js';

const createPageMetadata = memoizeWithRedis(createMetadataChannelById, {
Expand All @@ -38,6 +39,9 @@ export async function generateMetadata(props: Props): Promise<Metadata> {

export default async function Page(props: Props) {
if (await isBotRequest()) return null;

await setupLocaleForSSR();

const params = await props.params;
const source = resolveSocialSource(params.source);
const provider = resolveSocialMediaProvider(source);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function EngagementLayout({
[
{
value: EngagementType.Mirrors,
title: <Trans>Mirrors</Trans>,
title: <Trans>Reposts</Trans>,
link: resolveEngagementUrl(id, source, EngagementType.Mirrors),
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/app/(settings)/settings/wallets/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function Wallets() {
return (
<Section className="max-h-screen overflow-y-auto">
<Headline>
<Trans>Associated wallets</Trans>
<Trans>Connected wallets</Trans>
{isRefetching ? <LoadingIcon className="ml-1 inline-block" size={20} /> : null}
</Headline>
{!isLoading && connected.length === 0 && related.length === 0 ? (
Expand Down
23 changes: 0 additions & 23 deletions src/app/api/third-party/login/route.ts

This file was deleted.

19 changes: 0 additions & 19 deletions src/app/api/third-party/logout/route.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/app/api/twitter/user/search/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const GET = compose<(request: NextRequest, context?: NextRequestContext)

const userFields = TWITTER_USER_OPTIONS['user.fields'];
const url = urlcat('users/search', {
query: queryParams.query.replace(/_/g, ''),
query: queryParams.query,
'user.fields': Array.isArray(userFields) ? userFields.join(',') : undefined,
next_token: queryParams.cursor ? queryParams.cursor : undefined,
max_results: queryParams.limit,
Expand Down
3 changes: 3 additions & 0 deletions src/assets/failed-square.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions src/components/Actions/Mirrors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const Mirror = memo<MirrorProps>(function Mirror({
if (shares === 0) {
switch (source) {
case Source.Lens:
return t`Mirror or Quote`;
return t`Repost or Quote`;
case Source.Farcaster:
return t`Recast or Quote`;
case Source.Twitter:
Expand All @@ -62,8 +62,8 @@ export const Mirror = memo<MirrorProps>(function Mirror({
switch (source) {
case Source.Lens:
return plural(shares, {
one: 'Mirror or Quote',
other: 'Mirrors or Quotes',
one: 'Repost or Quote',
other: 'Reposts or Quotes',
});
case Source.Farcaster:
return plural(shares, {
Expand All @@ -81,7 +81,7 @@ export const Mirror = memo<MirrorProps>(function Mirror({
const mirrorActionText = useMemo(() => {
switch (source) {
case Source.Lens:
return mirrored ? t`Mirror again` : t`Mirror`;
return mirrored ? t`Repost again` : t`Repost`;
case Source.Farcaster:
return mirrored ? t`Cancel Recast` : t`Recast`;
case Source.Twitter:
Expand Down Expand Up @@ -130,7 +130,7 @@ export const Mirror = memo<MirrorProps>(function Mirror({
>
<MirrorLargeIcon width={18} height={18} />
<span className="font-medium">
<Trans>Undo mirror</Trans>
<Trans>Undo repost</Trans>
</span>
</div>
) : null}
Expand All @@ -156,7 +156,7 @@ export const Mirror = memo<MirrorProps>(function Mirror({
>
<motion.div
whileTap={{ scale: 0.9 }}
aria-label="Mirror"
aria-label="Repost"
onClick={(event) => {
event.preventDefault();
event.stopPropagation();
Expand Down
4 changes: 2 additions & 2 deletions src/components/Actions/PostStatistics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ export const PostStatistics = memo<Props>(function PostStatistics({
other: 'recasts',
}),
[Source.Lens]: plural(post.stats.mirrors, {
one: 'mirror',
other: 'mirrors',
one: 'repost',
other: 'reposts',
}),
[Source.Twitter]: plural(post.stats.mirrors, {
one: 'repost',
Expand Down
6 changes: 3 additions & 3 deletions src/components/Activity/ActivityClaimButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { t } from '@lingui/core/macro';
import { Trans } from '@lingui/react/macro';
import { safeUnreachable } from '@masknet/kit';
import { ChainId } from '@masknet/web3-shared-evm';
import { type ReactNode, useContext, useState } from 'react';
import { type ReactNode, use, useContext, useState } from 'react';
import { useAsyncFn } from 'react-use';

import { ActivityContext } from '@/components/Activity/ActivityContext.js';
import { ActivityMintSuccessDialog } from '@/components/Activity/ActivityMintSuccessDialog.js';
import { ActivityPremiumListContext } from '@/components/Activity/ActivityPremiumListContext.js';
import { useActivityClaimCondition } from '@/components/Activity/hooks/useActivityClaimCondition.js';
import { useActivityPremiumList } from '@/components/Activity/hooks/useActivityPremiumList.js';
import { LoadingIcon } from '@/components/LoadingIcon.js';
import type { SocialSource } from '@/constants/enum.js';
import type { Chars } from '@/helpers/chars.js';
Expand Down Expand Up @@ -46,7 +46,7 @@ export function ActivityClaimButton({
const { data, refetch } = useActivityClaimCondition(source);
const [hash, setHash] = useState<string | undefined>(undefined);
const [chainId, setChainId] = useState<ChainId | 'solana' | undefined>(undefined);
const list = useActivityPremiumList(source);
const { list } = use(ActivityPremiumListContext);

const isPremium = list.some((x) => x.verified);
const disabled = status === ActivityStatus.Ended || !data?.canClaim || !address || rest.disabled;
Expand Down
16 changes: 7 additions & 9 deletions src/components/Activity/ActivityPremiumConditionList.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
'use client';

import type { PropsWithChildren, ReactNode } from 'react';
import { use } from 'react';

import { ActivityPremiumListContext } from '@/components/Activity/ActivityPremiumListContext.js';
import { ActivityVerifyText } from '@/components/Activity/ActivityVerifyText.js';
import { useActivityPremiumList } from '@/components/Activity/hooks/useActivityPremiumList.js';
import type { SocialSource } from '@/constants/enum.js';
import { classNames } from '@/helpers/classNames.js';

export function ActivityPremiumConditionList({
title,
source,
children,
}: PropsWithChildren<{ title: ReactNode; source: SocialSource }>) {
const list = useActivityPremiumList(source);
export function ActivityPremiumConditionList({ title, children }: PropsWithChildren<{ title: ReactNode }>) {
const { list } = use(ActivityPremiumListContext);

return (
<div
Expand All @@ -25,7 +21,9 @@ export function ActivityPremiumConditionList({
<ul className="list-disc pl-4 text-sm font-normal leading-6">
{list.map((item, i) => (
<li key={i}>
<ActivityVerifyText verified={item.verified}>{item.label}</ActivityVerifyText>
<ActivityVerifyText verified={item.verified} hasFailedIcon>
{item.label}
</ActivityVerifyText>
</li>
))}
</ul>
Expand Down
28 changes: 28 additions & 0 deletions src/components/Activity/ActivityPremiumListContext.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
'use client';

import { createContext, type PropsWithChildren, type ReactNode, useMemo } from 'react';

interface ActivityPremiumListItem {
label: ReactNode;
verified?: boolean;
}

interface ActivityPremiumListContext {
list: ActivityPremiumListItem[];
}

export const ActivityPremiumListContext = createContext<ActivityPremiumListContext>({
list: [],
});

export function ActivityPremiumListProvider({
children,
list,
}: PropsWithChildren<Pick<ActivityPremiumListContext, 'list'>>) {
const value = useMemo(() => {
return {
list,
};
}, [list]);
return <ActivityPremiumListContext.Provider value={value}>{children}</ActivityPremiumListContext.Provider>;
}
127 changes: 127 additions & 0 deletions src/components/Activity/ActivityTasks/ActivityButtrflyTasks.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
'use client';

import { t } from '@lingui/core/macro';
import { Trans } from '@lingui/react/macro';
import { ChainId } from '@masknet/web3-shared-evm';
import { useContext, useMemo } from 'react';

import { ActivityClaimButton } from '@/components/Activity/ActivityClaimButton.js';
import { ActivityConnectCard } from '@/components/Activity/ActivityConnectCard.js';
import { ActivityContext } from '@/components/Activity/ActivityContext.js';
import { ActivityLoginButton } from '@/components/Activity/ActivityLoginButton.js';
import { ActivityPremiumConditionList } from '@/components/Activity/ActivityPremiumConditionList.js';
import { ActivityPremiumListProvider } from '@/components/Activity/ActivityPremiumListContext.js';
import { ActivityVerifyText } from '@/components/Activity/ActivityVerifyText.js';
import { useActivityClaimCondition } from '@/components/Activity/hooks/useActivityClaimCondition.js';
import { useActivityShareUrl } from '@/components/Activity/hooks/useActivityShareUrl.js';
import { Link } from '@/components/Activity/Link.js';
import { IS_ANDROID } from '@/constants/bowser.js';
import { Source } from '@/constants/enum.js';
import { FIREFLY_TELEGRAM_URL } from '@/constants/index.js';
import { FIREFLY_MENTION } from '@/constants/mentions.js';
import type { Chars } from '@/helpers/chars.js';
import { classNames } from '@/helpers/classNames.js';
import { replaceObjectInStringArray } from '@/helpers/replaceObjectInStringArray.js';
import { fireflyBridgeProvider } from '@/providers/firefly/Bridge.js';
import type { ActivityInfoResponse } from '@/providers/types/Firefly.js';

export function ActivityButtrflyTasks({
data,
}: {
data: Pick<Required<ActivityInfoResponse>['data'], 'status' | 'name'>;
}) {
const { address } = useContext(ActivityContext);
const { data: claimCondition } = useActivityClaimCondition(Source.Lens);
const list = [
{
label: <Trans>Top 500 Buttrfly Points Leaderboard</Trans>,
verified: claimCondition?.lens?.isTopUser,
},
];
const shareUrl = useActivityShareUrl(data.name);
const shareContent = useMemo(() => {
const fireflyMention = 'FIREFLY_MENTION';
return replaceObjectInStringArray(
t`Just earned $MASK by minting the Buttrfly Fren 🦋 collectible from ${fireflyMention}

Claim here ${shareUrl}`,
{
[fireflyMention]: FIREFLY_MENTION,
},
);
}, [shareUrl]);
const isPremium = list.some((x) => x.verified);

return (
<ActivityPremiumListProvider list={list}>
<div className="mb-4 w-full space-y-4 px-6 py-4">
<div className="flex w-full flex-col space-y-2">
<div className="flex h-8 items-center justify-between">
<h2 className="text-base font-semibold leading-6">
<Trans>Check Eligibility</Trans>
</h2>
<ActivityLoginButton source={Source.Lens} />
</div>
</div>
<div
className={classNames(
'w-full rounded-2xl p-3 text-sm font-normal leading-6',
claimCondition?.lens?.isActiveUser ? 'bg-success/10 dark:bg-success/20' : 'bg-bg',
)}
>
<ActivityVerifyText verified={claimCondition?.lens?.isActiveUser} hasFailedIcon>
<h3>
<Trans>Posted to Lens on Buttrfly since August 1, 2024</Trans>
</h3>
</ActivityVerifyText>
</div>
<h2 className="text-base font-semibold leading-6">
<Trans>Connect Wallet</Trans>
</h2>
<ActivityConnectCard
chainId={ChainId.Polygon}
source={Source.Lens}
label={
address ? (
<Trans>Wallet submitted</Trans>
) : (
<Trans>Submit a wallet to receive a collectible and $MASK airdrop</Trans>
)
}
/>
<div className="mb-4 flex w-full flex-col space-y-2 text-sm font-semibold leading-6">
<h2 className="text-base font-semibold leading-6">
<Trans>Eligible for Premium?</Trans>
</h2>
<ActivityPremiumConditionList
title={<Trans>Unlock a premium collectible and a larger $MASK airdrop </Trans>}
/>
</div>
<p className="w-full text-center text-[10px]">
<Trans>
For any inquiries, please{' '}
<Link href={FIREFLY_TELEGRAM_URL} target="_blank" className="inline text-highlight">
contact us
</Link>
. All rights reserved by Firefly.
</Trans>
</p>
</div>
<div
className={classNames(
'sticky bottom-0 mt-auto w-full bg-primaryBottom px-4',
fireflyBridgeProvider.supported && IS_ANDROID
? 'pb-safe-or-8'
: 'pt-1.5 pb-safe-or-4 max-md:pb-safe-or-2',
)}
>
<ActivityClaimButton
status={data.status}
shareContent={shareContent as Chars}
source={Source.Lens}
claimType={isPremium ? 'premium' : 'base'}
/>
</div>
</ActivityPremiumListProvider>
);
}
Loading