Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
add gift button on profile
Browse files Browse the repository at this point in the history
  • Loading branch information
alantoa committed Oct 10, 2023
1 parent 2a725aa commit 97f3154
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
32 changes: 32 additions & 0 deletions packages/app/components/profile/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { Platform } from "react-native";
import { useSharedValue } from "react-native-reanimated";

import { Button } from "@showtime-xyz/universal.button";
import { GiftSolid } from "@showtime-xyz/universal.icon";
import { Pressable } from "@showtime-xyz/universal.pressable";
import { useRouter } from "@showtime-xyz/universal.router";
import { useSafeAreaInsets } from "@showtime-xyz/universal.safe-area";
import {
Expand All @@ -13,6 +15,7 @@ import {
TabSpinner,
NavigationState,
} from "@showtime-xyz/universal.tab-view";
import { colors } from "@showtime-xyz/universal.tailwind";
import { Text } from "@showtime-xyz/universal.text";
import { View } from "@showtime-xyz/universal.view";

Expand All @@ -34,6 +37,7 @@ import { formatProfileRoutes, getProfileName } from "app/utilities";

import { ErrorBoundary } from "../error-boundary";
import { TabFallback } from "../error-boundary/tab-fallback";
import { ButtonGoldLinearGradient } from "../gold-gradient";
import { ProfileError } from "./profile-error";
import { ProfileTabBar } from "./profile-tab-bar";
import { ProfileTabList, ProfileTabListRef } from "./profile-tab-list";
Expand Down Expand Up @@ -238,6 +242,34 @@ const Profile = ({ username }: ProfileScreenProps) => {
withBackground
user={profileData?.data?.profile}
/>
<Pressable
tw={[
"ml-2 h-8 w-8 items-center justify-center rounded-full bg-black/60",
]}
onPress={() => {
router.push(
Platform.select({
native: `/profile/invite-creator-token`,
web: {
pathname: router.pathname,
query: {
...router.query,
inviteCreatorTokenModal: true,
},
} as any,
}),
Platform.select({
native: `/profile/invite-creator-token`,
web: router.asPath,
}),
{ scroll: false }
);
}}
>
<ButtonGoldLinearGradient />
<GiftSolid width={26} height={26} color={colors.gray[900]} />
</Pressable>

<Button
tw="ml-2"
onPress={onShare}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { InviteCreatorToken } from "app/components/creator-token/invite-creator-
export const InviteCreatorTokenScreen = withModalScreen(InviteCreatorToken, {
title: "Invite friends",
matchingPathname: "/profile/invite-creator-token",
matchingQueryParam: "inviteCreatorToken",
matchingQueryParam: "inviteCreatorTokenModal",
snapPoints: ["100%"],
tw: "w-full sm:w-[400px] md:w-[400px] lg:w-[400px] xl:w-[400px]",
disableBackdropPress: true,
Expand Down

0 comments on commit 97f3154

Please sign in to comment.