tangled
alpha
login
or
join now
stream.place
/
streamplace
Live video on the AT Protocol
74
fork
atom
overview
issues
1
pulls
pipelines
app: add <title> to streams
Eli Mallon
7 months ago
ba6852fa
1b9ec962
+15
-3
3 changed files
expand all
collapse all
unified
split
js
app
hooks
useTitle.tsx
src
screens
mobile-stream.tsx
stream.tsx
+11
js/app/hooks/useTitle.tsx
···
1
1
+
import { useNavigation } from "@react-navigation/native";
2
2
+
import { useEffect } from "react";
3
3
+
4
4
+
export default function useTitle(user: string) {
5
5
+
const navigation = useNavigation();
6
6
+
useEffect(() => {
7
7
+
navigation.setOptions({
8
8
+
title: `@${user} on Streamplace`,
9
9
+
});
10
10
+
}, [user, navigation]);
11
11
+
}
+2
-3
js/app/src/screens/mobile-stream.tsx
···
1
1
-
import { useNavigation } from "@react-navigation/native";
2
1
import { theme } from "@streamplace/components";
3
2
import { Player } from "components/mobile/player";
4
3
import { PlayerProps } from "components/player/props";
5
4
import { FullscreenProvider } from "contexts/FullscreenContext";
5
5
+
import useTitle from "hooks/useTitle";
6
6
import { isWeb } from "tamagui";
7
7
import { queryToProps } from "./util";
8
8
9
9
export default function MobileStream({ route }) {
10
10
const { user, protocol, url } = route.params;
11
11
-
const navigation = useNavigation();
12
11
let extraProps: Partial<PlayerProps> = {};
13
12
if (isWeb) {
14
13
extraProps = queryToProps(new URLSearchParams(window.location.search));
···
18
17
src = url;
19
18
}
20
19
21
21
-
console.log(src);
20
20
+
useTitle(user);
22
21
23
22
return (
24
23
<theme.ThemeProvider>
+2
js/app/src/screens/stream.tsx
···
1
1
import Livestream from "components/livestream/livestream";
2
2
import { PlayerProps } from "components/player/props";
3
3
import { FullscreenProvider } from "contexts/FullscreenContext";
4
4
+
import useTitle from "hooks/useTitle";
4
5
import { isWeb } from "tamagui";
5
6
import { queryToProps } from "./util";
6
7
···
14
15
if (user === "stream") {
15
16
src = url;
16
17
}
18
18
+
useTitle(user);
17
19
return (
18
20
<FullscreenProvider>
19
21
<Livestream src={src} {...extraProps} />