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

Video feed #2557

Merged
merged 160 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
5bb0e69
v2
intergalacticspacehighway Nov 22, 2023
1dc31e8
simplify video
intergalacticspacehighway Nov 23, 2023
56bcf35
feed layout
intergalacticspacehighway Nov 27, 2023
7809779
feat: add linear gradient
intergalacticspacehighway Nov 27, 2023
f8e0abd
nits
intergalacticspacehighway Nov 27, 2023
711071d
Add SFSymbol type import to MenuItemIcon
hirbod Nov 27, 2023
23bc491
Add UploadComposer component
hirbod Nov 27, 2023
b009b39
Add UploadPreview component
hirbod Nov 27, 2023
b224825
Add CreateTabBarIcon component to bottom tab
hirbod Nov 27, 2023
8d7c749
Add upload components to root stack navigator
hirbod Nov 27, 2023
11c51e2
Remove unused navigation types
hirbod Nov 27, 2023
6096c14
Add UploadComposerScreen component
hirbod Nov 27, 2023
28f7fc4
Add UploadPreviewScreen component
hirbod Nov 27, 2023
905490a
Add upload tab to bottom tab navigator
hirbod Nov 27, 2023
bd0006d
Add expo-camera and sf-symbols-typescript
hirbod Nov 27, 2023
34e2636
Remove unused import and variable declaration in
hirbod Nov 27, 2023
209d579
Update yarn.lock with new dependencies
hirbod Nov 27, 2023
bd2b534
Remove expo-camera and add tus-js-client
hirbod Nov 27, 2023
e73c3eb
Add CreateTabBarIcon component to HeaderMd
hirbod Nov 27, 2023
3012b60
Add videoPath to UploadPreview component
hirbod Nov 27, 2023
269beeb
Add upload tab bar icon component
hirbod Nov 27, 2023
3febd8b
Add video upload functionality
hirbod Nov 27, 2023
38df611
Update import path for CreateTabBarIcon in
hirbod Nov 27, 2023
437695e
Add upload preview and composer screens
hirbod Nov 27, 2023
0d15f94
Reorder providers in AppProviders component
hirbod Nov 27, 2023
d3e18d0
Remove growthbook import
hirbod Nov 27, 2023
12c0902
collapsible text
intergalacticspacehighway Nov 28, 2023
632fb8c
Update upload tab bar icon to navigate to upload
hirbod Nov 28, 2023
52b65ac
Add UploadComposerScreen component
hirbod Nov 28, 2023
b96fafc
Add redirect function for composer screen
hirbod Nov 28, 2023
10878c7
Export UploadComposerScreen component
hirbod Nov 28, 2023
144d653
Add UploadComposerScreen component
hirbod Nov 28, 2023
593c916
fix: cleanup
intergalacticspacehighway Nov 28, 2023
f1c8282
mute provider
intergalacticspacehighway Nov 28, 2023
1893be6
Add expo-video-thumbnails package
hirbod Nov 28, 2023
24d9818
Add expo-video-thumbnails package
hirbod Nov 28, 2023
e6d3b6a
Remove unused imports and add divider in Header
hirbod Nov 28, 2023
e08bd3e
Update upload composer component
hirbod Nov 28, 2023
818754c
Add Gallery and Image icons to UploadTabBarIcon
hirbod Nov 28, 2023
9a6ab24
Add VideoThumbnail component
hirbod Nov 28, 2023
dc01591
Fix video file types in chooseVideo function
hirbod Nov 28, 2023
41e3eb8
Update upload screen component name
hirbod Nov 28, 2023
c8488ee
Update title in UploadComposerScreen
hirbod Nov 28, 2023
6f63aeb
Remove title in UploadComposerScreen
hirbod Nov 28, 2023
ad94160
Fix videoUri optional parameter bug in
hirbod Nov 28, 2023
cc1b35e
Add video upload composer component
hirbod Nov 28, 2023
25fef63
Hide header in uploadComposer screen
hirbod Nov 28, 2023
87f18c6
Hide header in UploadComposerScreen
hirbod Nov 28, 2023
3cf8ffb
Update placeholder text color in UploadComposer
hirbod Nov 28, 2023
7712a02
Add Create.svg and Create.tsx icons to design
hirbod Nov 28, 2023
e8931cf
Add CreateTabBarIcon component to Footer
hirbod Nov 28, 2023
2c666db
Add Create icon and text to CreateTabBarIcon
hirbod Nov 28, 2023
4532544
Refactor video upload store to only allow mp4
hirbod Nov 28, 2023
ff5744a
Add new icon: Create
hirbod Nov 28, 2023
66fafd3
Refactor caption input styling in UploadComposer
hirbod Nov 28, 2023
2fd621b
wip: Add signUpload function to videoUploadStore
hirbod Nov 28, 2023
b9f8abb
wip: dd Pressable component for signing upload
hirbod Nov 28, 2023
d947016
ivs player
intergalacticspacehighway Nov 29, 2023
9924989
wip video feed ivs
intergalacticspacehighway Nov 29, 2023
25f4d7e
remove expo av on native
intergalacticspacehighway Nov 29, 2023
71c4cf1
remove expo av on native
intergalacticspacehighway Nov 29, 2023
b79833d
Update expo-image-picker version to 14.6.0
hirbod Nov 29, 2023
a5f07a2
Add style for footer height
hirbod Nov 29, 2023
229af5d
Add video upload functionality
hirbod Nov 29, 2023
e3742b2
Add useState and useLayoutEffect hooks to
hirbod Nov 29, 2023
94d6b14
Add TusFileReader class for reading files and
hirbod Nov 29, 2023
ed31f21
Add web implementation of FileReader component
hirbod Nov 29, 2023
588f14e
Add upload types for video and thumbnail
hirbod Nov 29, 2023
6555cde
Refactor CreateTabBarIcon component
hirbod Nov 29, 2023
3ea6fd8
Refactor video thumbnail component to support
hirbod Nov 29, 2023
604bae7
Add video upload store
hirbod Nov 29, 2023
7d130bc
Remove video upload functionality
hirbod Nov 29, 2023
e4404c1
Fix retry logic in signUpload function
hirbod Nov 29, 2023
4f2c4ec
Add text input for description in UploadComposer
hirbod Nov 29, 2023
35888ee
Add memoization to VideoThumbnail component
hirbod Nov 29, 2023
3f4c173
Add min-height style to UploadComposerScreen
hirbod Nov 29, 2023
6aae481
Merge branch 'feat/new-video-upload' into video-feed-v2
intergalacticspacehighway Nov 30, 2023
b5d83b5
merge
intergalacticspacehighway Nov 30, 2023
69fa53b
web layout fixes
intergalacticspacehighway Nov 30, 2023
77a7314
layout fixes
intergalacticspacehighway Nov 30, 2023
345f3d4
optimise mobile web playing
intergalacticspacehighway Nov 30, 2023
d291d0a
optimise mobile web playing
intergalacticspacehighway Nov 30, 2023
3c55e6c
increase overscan
intergalacticspacehighway Nov 30, 2023
feabb49
Update retryDelays in signUpload function
hirbod Nov 30, 2023
b7adb51
Remove unused import from action.ts
hirbod Nov 30, 2023
462848f
Update CreateTabBarIcon to CreateButtonDesktop
hirbod Nov 30, 2023
d4f0a16
Update video thumbnail height
hirbod Nov 30, 2023
7fbe864
Update UploadComposerScreen styles
hirbod Nov 30, 2023
ce964f9
support custom icon color for create
hirbod Nov 30, 2023
f164d21
Update CreateButtonDesktop size
hirbod Nov 30, 2023
9f945e7
Fix video upload abort issue and add border curve
hirbod Nov 30, 2023
3c9c440
Remove console.log statements
hirbod Nov 30, 2023
2da66a9
Fix requestedTimeToleranceBefore issue in
hirbod Dec 1, 2023
8d97a87
Update iOS deployment target to 13.4
hirbod Dec 1, 2023
6ff1038
Add videoMaxDuration and selectionLimit options to
hirbod Dec 1, 2023
5bc1660
Add quality parameter to getThumbnailAsync
hirbod Dec 1, 2023
5dd4808
profile posts tab
intergalacticspacehighway Dec 1, 2023
9adc818
initial scroll index
intergalacticspacehighway Dec 1, 2023
48c76ff
post detail screen
intergalacticspacehighway Dec 1, 2023
e298321
Update import in footer component
hirbod Dec 1, 2023
0e086db
Fix camera and media library permissions handling
hirbod Dec 1, 2023
e3b3f4d
Update upload button styling and toast message
hirbod Dec 1, 2023
d7ad449
Add disabled state to upload button
hirbod Dec 1, 2023
e0e05f4
Add CreateIconMobileWeb component for uploading
hirbod Dec 1, 2023
4bfb212
Add Spinner and Loading State to
hirbod Dec 1, 2023
58d5463
Update CreateTabBarIcon component
hirbod Dec 1, 2023
b168047
Update UploadComposerScreen height
hirbod Dec 1, 2023
247862e
Add abortUpload function to handle upload
hirbod Dec 1, 2023
53e6d71
Refactor CreateIconMobileWeb component
hirbod Dec 1, 2023
711446f
Fix CreateButtonDesktop upload functionality
hirbod Dec 1, 2023
4e5e641
Add abortUpload function to VideoUploadStoreState
hirbod Dec 1, 2023
e037b19
Add abortUpload function to CreateTabBarIcon
hirbod Dec 1, 2023
f1992b3
Add abortUpload action to video upload store
hirbod Dec 1, 2023
60f803b
fix: focus playing
intergalacticspacehighway Dec 1, 2023
28f57e9
share screen
intergalacticspacehighway Dec 1, 2023
6a10960
share screen
intergalacticspacehighway Dec 1, 2023
5b4d524
Fix upload cleanup and add beforeunload event
hirbod Dec 1, 2023
b27e128
Remove video upload functionality
hirbod Dec 1, 2023
c91d27c
Remove unused import in composer.tsx
hirbod Dec 1, 2023
16eb39b
Refactor video upload functionality
hirbod Dec 1, 2023
6632e58
Fix import casing in video-upload-store
hirbod Dec 1, 2023
cfe7151
Remove unused import in VideoThumbnail component
hirbod Dec 1, 2023
2a5ee0d
Fix import paths in upload components
hirbod Dec 1, 2023
24400ae
Fix video preview delay in UploadComposer
hirbod Dec 1, 2023
810fdb3
Add UploadComposer component
hirbod Dec 1, 2023
4ed45aa
Fix upload component imports
hirbod Dec 1, 2023
861f382
Remove unused code and update UI in
hirbod Dec 1, 2023
c2051b0
Commented out console.log statements and added
hirbod Dec 1, 2023
e0ed8eb
Fix event listener removal in
hirbod Dec 1, 2023
309da42
Add globalThis.gc() to abort upload and display
hirbod Dec 1, 2023
00fa85a
fix: home feed
intergalacticspacehighway Dec 1, 2023
cd48125
fix: home feed
intergalacticspacehighway Dec 1, 2023
08f1140
channel lock icon
intergalacticspacehighway Dec 2, 2023
049b52e
channel lock icon
intergalacticspacehighway Dec 2, 2023
7d1a3a9
background audio stop fixes
intergalacticspacehighway Dec 2, 2023
cc2d48e
background audio stop fixes
intergalacticspacehighway Dec 2, 2023
3033527
background audio stop fixes
intergalacticspacehighway Dec 2, 2023
5f07857
profile posts pagination
intergalacticspacehighway Dec 4, 2023
685ae06
Add upload completion notification and backend
hirbod Dec 4, 2023
21c3404
Update button sizes and margins in HeaderMd
hirbod Dec 4, 2023
a1ef1cf
Fix login issue and improve upload functionality
hirbod Dec 6, 2023
3555c77
Update image source URL in PostsTab component
hirbod Dec 6, 2023
07df5e4
Update useHomePosts and useInfiniteListQuery
hirbod Dec 6, 2023
cb647f8
Update pagination in useHomePosts hook
hirbod Dec 6, 2023
d52411f
Enable revalidation on mount in useHomePosts hook
hirbod Dec 6, 2023
c873560
fix layouts
intergalacticspacehighway Dec 6, 2023
a8e7a9f
Add axios dependency and update useHomePosts hook
hirbod Dec 6, 2023
af1dd2f
Refactor useHomePosts hook to improve performance
hirbod Dec 6, 2023
c090591
Commented out snapToOffsets prop in VideoFeedList
hirbod Dec 6, 2023
8610387
Add background color to video feed item and
hirbod Dec 6, 2023
ce06867
Add top padding to VideoFeedItem
intergalacticspacehighway Dec 6, 2023
896df99
Add loading indicators to VideoFeedList component
hirbod Dec 6, 2023
4fb7d48
Add useLogInPromise hook to VideoFeedItem
hirbod Dec 6, 2023
2320635
scroll snap chrome
intergalacticspacehighway Dec 6, 2023
030082d
scroll snap chrome
intergalacticspacehighway Dec 6, 2023
a2f9294
Refactor video-feed-item.tsx to use font-semibold
hirbod Dec 6, 2023
7039e6b
Add scroll fix for video feed list
hirbod Dec 6, 2023
3a1af1b
fix crash
intergalacticspacehighway Dec 7, 2023
4777bbe
Add keyboard navigation functionality to
hirbod Dec 7, 2023
089c59b
Refactor VideoFeedList component to use padding
hirbod Dec 7, 2023
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
60 changes: 51 additions & 9 deletions apps/expo/App.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { useEffect } from "react";
import { AppState, LogBox } from "react-native";
import { useEffect, useRef, useCallback } from "react";
import { AppState, AppStateStatus, LogBox, Platform } from "react-native";

import { configure as configureWalletMobileSDK } from "@coinbase/wallet-mobile-sdk";
import { Audio, InterruptionModeIOS, InterruptionModeAndroid } from "expo-av";
import { Image } from "expo-image";
import { useKeepAwake } from "expo-keep-awake";
import * as SplashScreen from "expo-splash-screen";
import { AvoidSoftInput } from "react-native-avoid-softinput";
import { enableFreeze, enableScreens } from "react-native-screens";
import { VolumeManager } from "react-native-volume-manager";

import { useAppState } from "app/hooks/use-app-state";
import { useExpoUpdate } from "app/hooks/use-expo-update";
import { Logger } from "app/lib/logger";
import { Sentry } from "app/lib/sentry";
Expand Down Expand Up @@ -35,12 +37,6 @@ configureWalletMobileSDK({
hostPackageName: "org.toshi",
});

Audio.setAudioModeAsync({
playsInSilentModeIOS: true,
interruptionModeIOS: InterruptionModeIOS.DoNotMix,
interruptionModeAndroid: InterruptionModeAndroid.DoNotMix,
}).catch(() => {});

LogBox.ignoreLogs([
"Constants.deviceYearClass",
"No native splash screen",
Expand Down Expand Up @@ -75,6 +71,52 @@ function App() {
};
}, []);

const volumeWasTriggered = useRef<boolean>(false);
const volumeSystemChangesRunning = useRef<boolean>(false);
const audioSessionIsInactive = useRef<boolean>(false);

useKeepAwake();

useEffect(() => {
const volumeListener = VolumeManager.addVolumeListener(async () => {
if (
Platform.OS === "ios" &&
!volumeSystemChangesRunning.current &&
!volumeWasTriggered.current
) {
try {
volumeSystemChangesRunning.current = true;
await VolumeManager.enableInSilenceMode(true);
volumeWasTriggered.current = true;
} catch {
} finally {
volumeSystemChangesRunning.current = false;
}
}
});

return function blur() {
volumeListener.remove();
};
}, []);

const onAppStateChange = useCallback(async (status: AppStateStatus) => {
// VolumeManager.enable(true);
if (status === "active") {
if (audioSessionIsInactive.current) {
// VolumeManager.setActive(true);
audioSessionIsInactive.current = false;
}
} else if (status === "background") {
// VolumeManager.setActive(false);
audioSessionIsInactive.current = true;
}
}, []);

useAppState({
onChange: onAppStateChange,
});

// Handle push notifications
useEffect(() => {
// a memory warning listener for free up FastImage Cache
Expand Down
2 changes: 1 addition & 1 deletion apps/expo/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ const expoConfig: ExpoConfig = {
unstable_networkInspector: true,
},
ios: {
deploymentTarget: "13.0",
deploymentTarget: "13.4",
unstable_networkInspector: true,
},
},
Expand Down
7 changes: 5 additions & 2 deletions apps/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"@walletconnect/core": "2.9.1",
"@walletconnect/react-native-compat": "^2.9.1",
"@walletconnect/universal-provider": "2.9.1",
"amazon-ivs-react-native-player": "^1.4.1",
"app": "*",
"array-to-image": "^1.0.0",
"assert": "^2.1.0",
Expand All @@ -93,7 +94,6 @@
"events": "^3.3.0",
"expo": "^49.0.19",
"expo-application": "~5.4.0",
"expo-av": "~13.6.0",
"expo-blur": "~12.6.0",
"expo-build-properties": "~0.8.3",
"expo-clipboard": "~4.5.0",
Expand All @@ -106,7 +106,7 @@
"expo-haptics": "~12.6.0",
"expo-image": "~1.8.1",
"expo-image-manipulator": "~11.3.0",
"expo-image-picker": "~14.5.0",
"expo-image-picker": "~14.6.0",
"expo-insights": "~0.4.0",
"expo-linear-gradient": "~12.5.0",
"expo-linking": "~5.0.2",
Expand All @@ -122,6 +122,7 @@
"expo-status-bar": "~1.7.1",
"expo-system-ui": "~2.6.0",
"expo-updates": "~0.18.17",
"expo-video-thumbnails": "~7.4.0",
"expo-web-browser": "~12.5.0",
"fastestsmallesttextencoderdecoder": "^1.0.22",
"https-browserify": "~1.0.0",
Expand Down Expand Up @@ -173,13 +174,15 @@
"react-string-replace": "1.1.1",
"readable-stream": "4.4.2",
"sentry-expo": "~7.1.1",
"sf-symbols-typescript": "^1.0.0",
"solito": "~3.2.9",
"stream-browserify": "^3.0.0",
"string_decoder": "~1.3.0",
"timers-browserify": "^2.0.12",
"tinycolor2": "^1.6.0",
"tldts": "^6.0.12",
"tty-browserify": "0.0.1",
"tus-js-client": "^3.1.1",
"universal-tooltip": "1.0.2",
"url": "~0.11.3",
"use-timer": "^2.0.1",
Expand Down
1 change: 1 addition & 0 deletions apps/next/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const nextConfig = {
"react-native-compressor",
"expo-sharing",
"@gorhom/bottom-sheet",
"expo-video-thumbnails",
],
webpack: (config, options) => {
if (!options.isServer) {
Expand Down
1 change: 1 addition & 0 deletions apps/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"date-fns": "^2.30.0",
"design-system": "*",
"dom-to-image": "^2.6.0",
"expo-av": "~13.6.0",
"export-from-json": "^1.7.3",
"fortmatic": "^2.4.0",
"magic-sdk": "^13.1.0",
Expand Down
44 changes: 22 additions & 22 deletions apps/next/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ import { EnterInviteCodeModalScreen } from "app/screens/creatro-tokens-enter-inv
import { EditProfileScreen } from "app/screens/edit-profile";
import { LoginScreen } from "app/screens/login";
import { OnboardingScreen } from "app/screens/onboarding";
import { PostCreateSuccessScreen } from "app/screens/post-create-success-screen";
import { CreatorTokensImportAllowlistScreen } from "app/screens/profile/import-allowlist";
import { CreatorTokensImportAllowlistSuccessScreen } from "app/screens/profile/imported-allowlist-succeeded";
import { QRCodeShareScreen } from "app/screens/qr-code-share";
import { ReportScreen } from "app/screens/report";
import { AddEmailScreen } from "app/screens/settings-add-email";
import { VerifyPhoneNumberScreen } from "app/screens/settings-verify-phone-number";
import { UploadComposerScreen } from "app/screens/upload-composer/upload-composer";
import { prevRouteRef } from "app/utilities";

import { Toaster } from "design-system/toast";
Expand Down Expand Up @@ -198,23 +200,19 @@ function App({ Component, pageProps, router }: AppProps) {
</Head>
<AppProviders>
<Container>
<View tw="mx-auto flex-col md:flex-row">
<Header
canGoBack={
router.pathname === "/search" ||
router.pathname.split("/").length - 1 >= 2
}
/>
<Header
canGoBack={
router.pathname === "/search" ||
router.pathname.split("/").length - 1 >= 2
}
/>

<View tw="w-full items-center md:ml-auto md:w-[calc(100%-248px)]">
<NextNProgress
color="#4F46E5"
options={{ showSpinner: false }}
showOnShallow={false}
/>
<Component {...pageProps} />
</View>
</View>
<NextNProgress
color="#4F46E5"
options={{ showSpinner: false }}
showOnShallow={false}
/>
<Component {...pageProps} />
<Footer />
</Container>

Expand Down Expand Up @@ -243,6 +241,8 @@ function App({ Component, pageProps, router }: AppProps) {
<CreatorTokenCollectorsScreen />
<CreatorTokensShareModalScreen />
<CreatorTokenSocialShareScreen />
<PostCreateSuccessScreen />
<UploadComposerScreen />
{/* Login should be the last so it renders on top of others if needed */}
<LoginScreen />
<Toaster />
Expand All @@ -259,18 +259,18 @@ const inter = Inter({
const Container = withColorScheme(
({ children }: { children: React.ReactNode }) => {
const fonts = [inter.variable].join(" ");
const headerHeight = useHeaderHeight();
const bottomBarHeight = usePlatformBottomHeight();
return (
<View
tw="bg-white dark:bg-black md:bg-gray-100 dark:md:bg-gray-900"
tw={
"bg-white dark:bg-black md:bg-gray-100 dark:md:bg-gray-900 " + fonts
}
// @ts-ignore
style={{
paddingTop: headerHeight,
paddingBottom: `calc(${bottomBarHeight}px + env(safe-area-inset-bottom))`,
flex: 1,
flexDirection: "row",
}}
>
<div className={fonts}>{children}</div>
{children}
</View>
);
}
Expand Down
5 changes: 5 additions & 0 deletions apps/next/src/pages/posts/[postId]/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { PostDetail } from "app/components/post-detail";

export default function PostDetailPage() {
return <PostDetail />;
}
1 change: 1 addition & 0 deletions apps/next/src/pages/posts/[postId]/share.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Fragment as default } from "react";
5 changes: 5 additions & 0 deletions apps/next/src/pages/posts/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Posts } from "app/components/posts";

export default function PostsPage() {
return <Posts />;
}
17 changes: 17 additions & 0 deletions apps/next/src/styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,20 @@ textarea:focus-visible {
overflow: hidden;
height: 100%;
}

/* To prevent chromd mobile web from collapsing the address bar */
/* Start */
html {
overflow: hidden;
width: 100%;
}

body {
height: 100%;
position: fixed;
/* prevent overscroll bounce*/
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
/* iOS velocity scrolling */
}
/* End */
Loading
Loading