Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update React Native code formatting #61

Merged
merged 8 commits into from
Nov 28, 2024
Merged

Update React Native code formatting #61

merged 8 commits into from
Nov 28, 2024

Conversation

mironiasty
Copy link
Member

@mironiasty mironiasty commented Nov 28, 2024

Description

Various RN documentation tweaks:

  • fix formatting configuration
  • hide components from menu
  • refactor all examples to be 'copy - ready'

This is how updated example will look like:

Screenshot 2024-11-28 at 10 53 48

@@ -0,0 +1,3 @@
{
"tabWidth": 2
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added this as sometimes vscode does not use prettier formatter if config file is missing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rename was required, as right now this files are visible as separate documentation: https://docs.fishjam.io/react-native/components/configure-permissions

const { joinRoom } = useConnection();

const onPressJoin = useCallback(async () => {
const { fishjamUrl, peerToken } = yourFunction();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion:

Suggested change
const { fishjamUrl, peerToken } = yourFunction();
// retrieve the credentials from your backend
const { fishjamUrl, peerToken } = yourFunction();

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've implemented function to get data from sandbox as an example

import { Button } from "react-native";
import { useCamera, useConnection } from "@fishjam-cloud/react-native-client";

export function StartStreamingButton({
roomName,
userName,
}: {
roomName: string;
userName: string;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Maybe we should change to peerName here instead of using userName everywhere. I think the peer word is established in our nomenclature. I think user for us means the developer using our services.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated everywhere

@@ -231,7 +230,7 @@ export default function HomeScreen() {
return (
<SafeAreaView style={styles.container}>
{connectionStatus !== "connected" && (
<StartStreamingButton roomName="*roomName*" userName="*username*" />
<StartStreamingButton roomName="Room Name" userName="User Name" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise:

Suggested change
<StartStreamingButton roomName="Room Name" userName="User Name" />
<StartStreamingButton roomName="Room Name" peerName="Peer Name" />

.prettierignore Outdated
node_modules/*
.yarn/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New line at the end, pretty please 🥺

@@ -62,3 +62,4 @@ se
InstallPackage
ConfigurePermissions
mdx
_components
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: ❤️

@mironiasty mironiasty merged commit b06894c into main Nov 28, 2024
1 check passed
@mironiasty mironiasty deleted the nits-and-tits branch November 28, 2024 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants