From 1f65cd7f15088eb6ec94c1973f14cc5c7cc48605 Mon Sep 17 00:00:00 2001
From: Hirbod <504909+hirbod@users.noreply.github.com>
Date: Wed, 1 Nov 2023 12:04:43 +0100
Subject: [PATCH 01/12] fix: mobile web create button was still visible (#2489)
---
packages/app/components/footer/index.tsx | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/packages/app/components/footer/index.tsx b/packages/app/components/footer/index.tsx
index 0ded471b5c..767ee1de12 100644
--- a/packages/app/components/footer/index.tsx
+++ b/packages/app/components/footer/index.tsx
@@ -1,3 +1,4 @@
+import { useContext } from "react";
import { useWindowDimensions } from "react-native";
import { useIsDarkMode } from "@showtime-xyz/universal.hooks";
@@ -5,6 +6,7 @@ import { useRouter } from "@showtime-xyz/universal.router";
import { View } from "@showtime-xyz/universal.view";
import { MOBILE_WEB_TABS_HEIGHT } from "app/constants/layout";
+import { UserContext } from "app/context/user-context";
import {
HIDE_MOBILE_WEB_FOOTER_SCREENS,
SWIPE_LIST_SCREENS,
@@ -19,6 +21,7 @@ import {
import { useNavigationElements } from "app/navigation/use-navigation-elements";
const Footer = () => {
+ const user = useContext(UserContext);
const router = useRouter();
const isDark = useIsDarkMode();
const isDarkThemePage = SWIPE_LIST_SCREENS.includes(router.pathname);
@@ -33,6 +36,11 @@ const Footer = () => {
const { width } = useWindowDimensions();
const { isTabBarHidden } = useNavigationElements();
+ const canCreateMusicDrop =
+ !!user?.user?.data.profile.bypass_track_ownership_validation ||
+ !!user?.user?.data.profile.spotify_artist_id ||
+ !!user?.user?.data.profile.apple_music_artist_id;
+
if (width >= 768) {
return null;
}
@@ -65,11 +73,13 @@ const Footer = () => {
color={color}
focused={router.pathname === "/channels"}
/>
-
+ {canCreateMusicDrop && (
+
+ )}
Date: Wed, 1 Nov 2023 15:02:52 +0100
Subject: [PATCH 02/12] fix: show info tooltip instead of wrong token modal
(#2491)
* fix: show info tooltip instead of wrong token modal
* fix: remove unused const
---
.../profile/creator-tokens-panel.tsx | 101 ++++++------------
1 file changed, 32 insertions(+), 69 deletions(-)
diff --git a/packages/app/components/profile/creator-tokens-panel.tsx b/packages/app/components/profile/creator-tokens-panel.tsx
index e85fec60c0..70254be421 100644
--- a/packages/app/components/profile/creator-tokens-panel.tsx
+++ b/packages/app/components/profile/creator-tokens-panel.tsx
@@ -18,6 +18,7 @@ import { useWalletUSDCBalance } from "app/hooks/creator-token/use-wallet-usdc-ba
import { useWallet } from "app/hooks/use-wallet";
import { getCurrencyPrice } from "app/utilities";
+import { TextTooltip } from "../tooltips/text-tooltip";
import { PlatformBuyButton, PlatformSellButton } from "./buy-and-sell-buttons";
type CreatorTokensPanelProps = { isSelf?: boolean; username?: string };
@@ -157,8 +158,6 @@ export const CreatorTokensPanel = ({
username,
}: CreatorTokensPanelProps) => {
const isDark = useIsDarkMode();
- const router = useRouter();
- const { data: userProfileData } = useUserProfile({ address: username });
const usdcBalance = useWalletUSDCBalance();
@@ -171,84 +170,48 @@ export const CreatorTokensPanel = ({
- Wallet balance
+ USDC wallet balance
- {
- router.push(
- Platform.select({
- native: "/creator-token/explanation",
- web: {
- pathname: router.pathname,
- query: {
- ...router.query,
- creatorTokensExplanationModal: true,
- },
- } as any,
- }),
- Platform.select({
- native: "/creator-token/explanation",
- web:
- router.asPath === "/"
- ? "/creator-token/explanation"
- : router.asPath,
- }),
- { shallow: true }
- );
- }}
- hitSlop={{ top: 12, left: 12, right: 12, bottom: 12 }}
- >
-
-
+
+
+ }
+ text={
+ "Your estimated USDC wallet\nbalance on the Base network."
+ }
+ />
{getCurrencyPrice("USD", usdcBalance.data?.displayBalance)}
- {/*
- // TODO: Creator Tokens P1
+ {/* TODO: creator tokens p2
Token earnings
- {
- router.push(
- Platform.select({
- native: "/creator-token/explanation",
- web: {
- pathname: router.pathname,
- query: {
- ...router.query,
- creatorTokensExplanationModal: true,
- },
- } as any,
- }),
- Platform.select({
- native: "/creator-token/explanation",
- web:
- router.asPath === "/"
- ? "/creator-token/explanation"
- : router.asPath,
- }),
- { shallow: true }
- );
- }}
- hitSlop={{ top: 12, left: 12, right: 12, bottom: 12 }}
- >
-
-
+
+ }
+ text={
+ "Every time someone trades\nyour token you earn a 7%\nfee."
+ }
+ />
$21.67
From f71740eb536928750eaf48623fdea58d1ff4a378 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Wed, 1 Nov 2023 14:08:01 +0000
Subject: [PATCH 03/12] release v149.0.8
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 5d1582fb95..380115c5cd 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "showtime",
- "version": "149.0.7",
+ "version": "149.0.8",
"private": true,
"license": "MIT",
"devDependencies": {
From 49b79e89138b4384c6968ce3267585aa99c7a70f Mon Sep 17 00:00:00 2001
From: Alan Toa <37520667+alantoa@users.noreply.github.com>
Date: Thu, 2 Nov 2023 02:18:57 +0800
Subject: [PATCH 04/12] Fix/creator token buy modal issues (#2495)
* fix: some UI issues with creator token buy modal
* remove unuseful code
* add a default creator token pic
* fix
---
.../creator-token/buy-creator-token.tsx | 60 +++++++++++--------
.../creator-token/self-serve-explainer.tsx | 4 +-
packages/app/hooks/use-wallet-balance.ts | 1 +
packages/design-system/toggle/index.tsx | 3 +
4 files changed, 41 insertions(+), 27 deletions(-)
diff --git a/packages/app/components/creator-token/buy-creator-token.tsx b/packages/app/components/creator-token/buy-creator-token.tsx
index 02d725ab4e..5607688c9c 100644
--- a/packages/app/components/creator-token/buy-creator-token.tsx
+++ b/packages/app/components/creator-token/buy-creator-token.tsx
@@ -46,23 +46,23 @@ type Query = {
const { useParam } = createParam();
// Disable ETH payment on dev for now because it doesn't support the dev environment yet.
-const PAYMENT_METHODS = __DEV__
- ? [
- {
- title: "USDC",
- value: "USDC",
- },
- ]
- : [
- {
- title: "ETH",
- value: "ETH",
- },
- {
- title: "USDC",
- value: "USDC",
- },
- ];
+const BUY_PAYMENTS = [
+ {
+ title: "ETH",
+ value: "ETH",
+ },
+ {
+ title: "USDC",
+ value: "USDC",
+ },
+];
+const SELL_PAYMENTS = [
+ {
+ title: "USDC",
+ value: "USDC",
+ },
+];
+
const SELECT_LIST = [
{
title: "Buy",
@@ -168,6 +168,7 @@ export const BuyCreatorToken = () => {
"https://app.uniswap.org/swap?outputCurrency=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&chain=base"
)
}
+ size="regular"
>
Buy USDC on Uniswap
@@ -180,6 +181,7 @@ export const BuyCreatorToken = () => {
return (
@@ -262,15 +264,21 @@ export const BuyCreatorToken = () => {
- m.value === "USDC")
- }
- value={paymentMethod}
- onChange={(value: any) => setPaymentMethod(value)}
- />
+ {selectedAction === "buy" ? (
+ setPaymentMethod(value)}
+ key="BUY_PAYMENTS"
+ />
+ ) : (
+ setPaymentMethod(value)}
+ key="SELL_PAYMENTS"
+ />
+ )}
{
setShowExplanation(true);
diff --git a/packages/app/components/creator-token/self-serve-explainer.tsx b/packages/app/components/creator-token/self-serve-explainer.tsx
index 82a8636113..e34763d2e9 100644
--- a/packages/app/components/creator-token/self-serve-explainer.tsx
+++ b/packages/app/components/creator-token/self-serve-explainer.tsx
@@ -36,7 +36,9 @@ export const SelfServeExplainer = () => {
const isDark = useIsDarkMode();
const { user } = useUser();
const { top } = useSafeAreaInsets();
- const userProfilePic = user?.data.profile.img_url;
+ const userProfilePic =
+ user?.data.profile.img_url ||
+ "https://media.showtime.xyz/assets/default-creator-token-pic.png";
const [profilePic, setProfilePic] = useState(
userProfilePic
diff --git a/packages/app/hooks/use-wallet-balance.ts b/packages/app/hooks/use-wallet-balance.ts
index f41ac31b23..c51445a24d 100644
--- a/packages/app/hooks/use-wallet-balance.ts
+++ b/packages/app/hooks/use-wallet-balance.ts
@@ -7,6 +7,7 @@ import { useWallet } from "./use-wallet/use-wallet";
export const useWalletETHBalance = () => {
const wallet = useWallet();
const res = useSWR("ethBalance" + wallet.address, async () => {
+ if (__DEV__) return { balance: 0, displayBalance: "0" };
if (wallet.address) {
const res = (await publicClient.getBalance({
address: wallet.address,
diff --git a/packages/design-system/toggle/index.tsx b/packages/design-system/toggle/index.tsx
index 582a5e9ca0..9d892d2b28 100644
--- a/packages/design-system/toggle/index.tsx
+++ b/packages/design-system/toggle/index.tsx
@@ -4,6 +4,8 @@ import Animated, {
useAnimatedStyle,
withTiming,
useSharedValue,
+ FadeIn,
+ Layout,
} from "react-native-reanimated";
import { useIsDarkMode } from "@showtime-xyz/universal.hooks";
@@ -71,6 +73,7 @@ export const Toggle = ({
backgroundColor: isDark ? colors.white : colors.gray[900],
},
]}
+ entering={FadeIn}
/>
) : null}
{options.map((item, index) => (
From 30199fbf39d142ffc5b7c1dd199689f88051902d Mon Sep 17 00:00:00 2001
From: github-actions
Date: Wed, 1 Nov 2023 18:23:46 +0000
Subject: [PATCH 05/12] release v149.0.9
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 380115c5cd..45a7624658 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "showtime",
- "version": "149.0.8",
+ "version": "149.0.9",
"private": true,
"license": "MIT",
"devDependencies": {
From baab0286b32390825e34ede12982dbfbb1e0b4e5 Mon Sep 17 00:00:00 2001
From: Alan Toa <37520667+alantoa@users.noreply.github.com>
Date: Thu, 2 Nov 2023 04:24:05 +0800
Subject: [PATCH 06/12] feat: reenable import allowlist to channel (#2494)
* feat: reenable import allowlist to channel
* fix: re-enable AccessTicket icon in channels header
* fix: remove view member list
* feat: add upload indicator for CSV upload
---------
Co-authored-by: Hirbod Mirjavadi
---
.../components/messages-header.tsx | 25 +------
packages/app/components/header-dropdown.tsx | 3 +-
.../app/components/header/header.md.web.tsx | 2 -
.../components/profile/import-allowlist.tsx | 69 ++++++++++++-------
4 files changed, 45 insertions(+), 54 deletions(-)
diff --git a/packages/app/components/creator-channels/components/messages-header.tsx b/packages/app/components/creator-channels/components/messages-header.tsx
index cf175661b7..02731e4b4e 100644
--- a/packages/app/components/creator-channels/components/messages-header.tsx
+++ b/packages/app/components/creator-channels/components/messages-header.tsx
@@ -22,28 +22,6 @@ export const MessagesHeader = (props: HeaderProps) => {
const router = useRouter();
const isDark = useIsDarkMode();
- const viewMembersList = useCallback(() => {
- const as = `/channels/${props.channelId}/members`;
-
- router.push(
- Platform.select({
- native: as,
- web: {
- pathname: router.pathname,
- query: {
- ...router.query,
- channelsMembersModal: true,
- },
- } as any,
- }),
- Platform.select({
- native: as,
- web: router.asPath,
- }),
- { shallow: true }
- );
- }, [props.channelId, router]);
-
const inviteAllowlist = useCallback(() => {
const as = "/creator-token/import-allowlist";
router.push(
@@ -112,8 +90,7 @@ export const MessagesHeader = (props: HeaderProps) => {
/>
) : (
- // TODO: Creator Tokens P1 (hide hidden class)
-
+
- {/* TODO: Creator Tokens P1
{isAuthenticated && (
{
@@ -218,7 +217,7 @@ function HeaderDropdown({
)}
- */}
+
{
)}
- {/* TODO: Creator Tokens P1
{isAuthenticated && (
{
@@ -484,7 +483,6 @@ export const HeaderMd = withColorScheme(() => {
)}
- */}
{
const router = useRouter();
+ const [isLoading, setIsLoading] = useState(false);
const pickCSV = useCallback(async () => {
try {
const file = await DocumentPicker.getDocumentAsync({
@@ -38,30 +39,38 @@ export const ImportAllowlist = () => {
"Content-Type": `multipart/form-data`,
};
const attachment = file.assets[0].uri;
- if (Platform.OS === "web") {
- const attachmentFormData = await getFileFormData(attachment);
- const formData = new FormData();
- formData.append(
- "file",
- attachmentFormData!,
- generateRandomFilename(extractMimeType(attachment))
- );
- await axios({
- url: uploadUrl,
- method: "POST",
- headers: headers,
- data: formData,
- });
- } else {
- await FileSystem.uploadAsync(uploadUrl, attachment, {
- uploadType: FileSystem.FileSystemUploadType.MULTIPART,
- sessionType: FileSystem.FileSystemSessionType.BACKGROUND,
- fieldName: "file",
- httpMethod: "POST",
- headers,
- });
+
+ try {
+ setIsLoading(true);
+ if (Platform.OS === "web") {
+ const attachmentFormData = await getFileFormData(attachment);
+ const formData = new FormData();
+ formData.append(
+ "file",
+ attachmentFormData!,
+ generateRandomFilename(extractMimeType(attachment))
+ );
+ await axios({
+ url: uploadUrl,
+ method: "POST",
+ headers: headers,
+ data: formData,
+ });
+ } else {
+ await FileSystem.uploadAsync(uploadUrl, attachment, {
+ uploadType: FileSystem.FileSystemUploadType.MULTIPART,
+ sessionType: FileSystem.FileSystemSessionType.BACKGROUND,
+ fieldName: "file",
+ httpMethod: "POST",
+ headers,
+ });
+ }
+ toast.success("Allowlist imported successfully");
+ } catch {
+ toast.error("An error occurred while uploading the file");
+ } finally {
+ setIsLoading(false);
}
- toast.success("Allowlist imported successfully");
const nativeUrl = "/creator-token/import-allowlist-success";
const url = Platform.select({
@@ -107,14 +116,22 @@ export const ImportAllowlist = () => {
Creator Tokens to unlock your channel.
-