From 383b9697c6259aa92d88407422cfa82c5c10ccb8 Mon Sep 17 00:00:00 2001 From: Skylar Barrera Date: Thu, 7 Dec 2023 11:26:29 -0500 Subject: [PATCH 1/4] Update Crowdin configuration file --- crowdin.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crowdin.yml b/crowdin.yml index f3688a40721..abb0f7f44b5 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,3 +1,5 @@ files: - source: /src/languages/en_US.json translation: /src/languages/%locale_with_underscore%.json +bundles: + - 2 From d238aeeb072198c3879d9ca1726da3838b8f9add Mon Sep 17 00:00:00 2001 From: Matthew Wall Date: Thu, 7 Dec 2023 11:07:33 -0700 Subject: [PATCH 2/4] fix search not being able to scroll to bottom due to add bottom tab bar (#5227) --- src/navigation/SwipeNavigator.js | 2 +- src/screens/discover/components/DiscoverSearch.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/navigation/SwipeNavigator.js b/src/navigation/SwipeNavigator.js index 9713364ed52..f690d449fe3 100644 --- a/src/navigation/SwipeNavigator.js +++ b/src/navigation/SwipeNavigator.js @@ -64,7 +64,7 @@ const animationConfig = { const Swipe = createMaterialTopTabNavigator(); -const getHeaderHeight = () => { +export const getHeaderHeight = () => { if (IS_IOS) { return 82; } diff --git a/src/screens/discover/components/DiscoverSearch.js b/src/screens/discover/components/DiscoverSearch.js index 8f9f46d2729..39e371e4f06 100644 --- a/src/screens/discover/components/DiscoverSearch.js +++ b/src/screens/discover/components/DiscoverSearch.js @@ -38,6 +38,7 @@ import { getPoapAndOpenSheetWithSecretWord, } from '@/utils/poaps'; import { navigateToMintCollection } from '@/resources/reservoir/mints'; +import { getHeaderHeight } from '@/navigation/SwipeNavigator'; export const SearchContainer = styled(Row)({ height: '100%', @@ -61,6 +62,7 @@ export default function DiscoverSearch() { const { colors } = useTheme(); const profilesEnabled = useExperimentalFlag(PROFILES); + const marginBottom = useMemo(() => getHeaderHeight(), []); const currencySelectionListRef = useRef(); const [searchQueryForSearch] = useDebounce(searchQuery, 350); @@ -277,7 +279,7 @@ export default function DiscoverSearch() { return ( Date: Thu, 7 Dec 2023 13:45:49 -0500 Subject: [PATCH 3/4] tx sim: enable zora (#5226) --- src/screens/SignTransactionSheet.tsx | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/screens/SignTransactionSheet.tsx b/src/screens/SignTransactionSheet.tsx index 9667fe316a7..d930d7e9294 100644 --- a/src/screens/SignTransactionSheet.tsx +++ b/src/screens/SignTransactionSheet.tsx @@ -241,8 +241,7 @@ export const SignTransactionSheet = () => { gasFeeParamsBySpeed, } = useGas(); - const simulationUnavailable = - isPersonalSign || currentNetwork === Network.zora; + const simulationUnavailable = isPersonalSign; const itemCount = (simulationData?.in?.length || 0) + @@ -1427,8 +1426,7 @@ const SimulationCard = ({ ); const spinnerRotation = useSharedValue(0); - const simulationUnavailable = - isPersonalSign || currentNetwork === Network.zora; + const simulationUnavailable = isPersonalSign; const listStyle = useAnimatedStyle(() => ({ opacity: noChanges @@ -1584,11 +1582,9 @@ const SimulationCard = ({ const shouldExpandOnLoad = isBalanceEnough === false || (!isEmpty(simulation) && !noChanges) || - currentNetwork === Network.zora || !!simulationError; return shouldExpandOnLoad; }, [ - currentNetwork, isBalanceEnough, isLoading, isPersonalSign, @@ -1606,13 +1602,7 @@ const SimulationCard = ({ isExpanded={isExpanded} > ) : ( <> - {simulationUnavailable && !isPersonalSign && ( + {simulationUnavailable && isPersonalSign && ( {i18n.t( i18n.l.walletconnect.simulation.simulation_card.messages - .unavailable_zora_network + .unavailable_personal_sign )} From 9a377343feab01d54143acee13d33a1c834e8f5e Mon Sep 17 00:00:00 2001 From: Matthew Wall Date: Thu, 7 Dec 2023 13:24:54 -0700 Subject: [PATCH 4/4] add contentful points tweet intent schema and queries (#5228) --- src/graphql/queries/arc.graphql | 23 ++++ .../pointsTweetIntentCollectionQuery.ts | 102 ++++++++++++++++++ .../pointsTweetIntentQuery.ts | 87 +++++++++++++++ 3 files changed, 212 insertions(+) create mode 100644 src/resources/pointsTweetIntent/pointsTweetIntentCollectionQuery.ts create mode 100644 src/resources/pointsTweetIntent/pointsTweetIntentQuery.ts diff --git a/src/graphql/queries/arc.graphql b/src/graphql/queries/arc.graphql index 9d58ff97137..2ffe240ee2f 100644 --- a/src/graphql/queries/arc.graphql +++ b/src/graphql/queries/arc.graphql @@ -237,3 +237,26 @@ query getPromoSheet($id: String!) { subHeader } } + +query getPointsTweetIntentCollection($order: [PointsTweetIntentOrder]) { + pointsTweetIntentCollection(order: $order) { + items { + sys { + id + } + key + text + via + url + } + } +} + +query getPointsTweetIntent($id: String!) { + pointsTweetIntent(id: $id) { + key + text + via + url + } +} diff --git a/src/resources/pointsTweetIntent/pointsTweetIntentCollectionQuery.ts b/src/resources/pointsTweetIntent/pointsTweetIntentCollectionQuery.ts new file mode 100644 index 00000000000..a807731d562 --- /dev/null +++ b/src/resources/pointsTweetIntent/pointsTweetIntentCollectionQuery.ts @@ -0,0 +1,102 @@ +import { useQuery } from '@tanstack/react-query'; + +import { + createQueryKey, + queryClient, + QueryConfig, + QueryFunctionArgs, + QueryFunctionResult, +} from '@/react-query'; + +import { arcDevClient } from '@/graphql'; +import { PointsTweetIntentOrder } from '@/graphql/__generated__/arc'; + +// Set a default stale time of 10 seconds so we don't over-fetch +// (query will serve cached data & invalidate after 10s). +const defaultStaleTime = 60_000; + +export type PointsTweetIntentCollectionArgs = { + order?: PointsTweetIntentOrder[]; +}; + +// /////////////////////////////////////////////// +// Query Key + +const pointsTweetIntentCollectionQueryKey = ({ + order, +}: PointsTweetIntentCollectionArgs) => + createQueryKey( + 'pointsTweetIntentCollection', + { order }, + { persisterVersion: 1 } + ); + +type PointsTweetIntentCollectionQueryKey = ReturnType< + typeof pointsTweetIntentCollectionQueryKey +>; + +// /////////////////////////////////////////////// +// Query Function + +async function pointsTweetIntentCollectionQueryFunction({ + queryKey: [{ order }], +}: QueryFunctionArgs) { + const data = await arcDevClient.getPointsTweetIntentCollection({ order }); + return data; +} + +export type PointsTweetIntentCollectionResult = QueryFunctionResult< + typeof pointsTweetIntentCollectionQueryFunction +>; + +// /////////////////////////////////////////////// +// Query Prefetcher + +export async function prefetchPointsTweetIntentCollection( + { order }: PointsTweetIntentCollectionArgs, + config: QueryConfig< + PointsTweetIntentCollectionResult, + Error, + PointsTweetIntentCollectionQueryKey + > = {} +) { + return await queryClient.prefetchQuery( + pointsTweetIntentCollectionQueryKey({ order }), + pointsTweetIntentCollectionQueryFunction, + config + ); +} + +// /////////////////////////////////////////////// +// Query Fetcher + +export async function fetchPointsTweetIntentCollection({ + order, +}: PointsTweetIntentCollectionArgs) { + return await queryClient.fetchQuery( + pointsTweetIntentCollectionQueryKey({ order }), + pointsTweetIntentCollectionQueryFunction, + { staleTime: defaultStaleTime } + ); +} + +// /////////////////////////////////////////////// +// Query Hook + +export function usePointsTweetIntentCollectionQuery( + { order }: PointsTweetIntentCollectionArgs = {}, + { + enabled, + refetchInterval = 30_000, + }: { enabled?: boolean; refetchInterval?: number } = {} +) { + return useQuery( + pointsTweetIntentCollectionQueryKey({ order }), + pointsTweetIntentCollectionQueryFunction, + { + enabled, + staleTime: defaultStaleTime, + refetchInterval, + } + ); +} diff --git a/src/resources/pointsTweetIntent/pointsTweetIntentQuery.ts b/src/resources/pointsTweetIntent/pointsTweetIntentQuery.ts new file mode 100644 index 00000000000..88c434518b1 --- /dev/null +++ b/src/resources/pointsTweetIntent/pointsTweetIntentQuery.ts @@ -0,0 +1,87 @@ +import { useQuery } from '@tanstack/react-query'; + +import { + createQueryKey, + queryClient, + QueryConfig, + QueryFunctionArgs, + QueryFunctionResult, +} from '@/react-query'; + +import { arcDevClient } from '@/graphql'; + +// Set a default stale time of 10 seconds so we don't over-fetch +// (query will serve cached data & invalidate after 10s). +const defaultStaleTime = 60_000; + +export type PointsTweetIntentArgs = { + id: string; +}; + +// /////////////////////////////////////////////// +// Query Key + +const pointsTweetIntentQueryKey = ({ id }: PointsTweetIntentArgs) => + createQueryKey('pointsTweetIntent', { id }, { persisterVersion: 1 }); + +type PointsTweetIntentQueryKey = ReturnType; + +// /////////////////////////////////////////////// +// Query Function + +async function pointsTweetIntentQueryFunction({ + queryKey: [{ id }], +}: QueryFunctionArgs) { + const data = await arcDevClient.getPointsTweetIntent({ id }); + return data; +} + +export type PointsTweetIntentResult = QueryFunctionResult< + typeof pointsTweetIntentQueryFunction +>; + +// /////////////////////////////////////////////// +// Query Prefetcher + +export async function prefetchPointsTweetIntent( + { id }: PointsTweetIntentArgs, + config: QueryConfig< + PointsTweetIntentResult, + Error, + PointsTweetIntentQueryKey + > = {} +) { + return await queryClient.prefetchQuery( + pointsTweetIntentQueryKey({ id }), + pointsTweetIntentQueryFunction, + config + ); +} + +// /////////////////////////////////////////////// +// Query Fetcher + +export async function fetchPointsTweetIntent({ id }: PointsTweetIntentArgs) { + return await queryClient.fetchQuery( + pointsTweetIntentQueryKey({ id }), + pointsTweetIntentQueryFunction, + { staleTime: defaultStaleTime } + ); +} + +// /////////////////////////////////////////////// +// Query Hook + +export function usePointsTweetIntentQuery( + { id }: PointsTweetIntentArgs, + { enabled }: { enabled?: boolean } = {} +) { + return useQuery( + pointsTweetIntentQueryKey({ id }), + pointsTweetIntentQueryFunction, + { + enabled, + staleTime: defaultStaleTime, + } + ); +}