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

Emily/bottom play bar #38

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Emily/bottom play bar #38

wants to merge 13 commits into from

Conversation

emilysunaryo
Copy link
Contributor

@emilysunaryo emilysunaryo commented Apr 20, 2023

🎉 What's new in this PR 🎉

☁️ ☁️ Description ☁️ ☁️

This PR includes a new BottomPlayBar modal that will eventually be able to play and pause the current audio on every screen. In order to implement this, we had to rearrange our Navigation stack and have "PlayScreen" live outside of the "Navigation Bar" screen in RootNavigator.tsx

Screenshots 📲

Kapture 2023-04-19 at 20 41 37

⚡ How to review ⚡

Navigation.tsx could be potentially reviewed. We wrapped each navigation stack in CompositeScreenProps to fix the nagivation props error in each screen.

🌱 Next steps 🌱

Next steps will be to implement audio playing functionality within this modal. We need to be able to pass the current audio object to this modal for it to use audio util controls like pause and play through every screen. The modal could also use some extra styling to center its components

Relevant Links 🔗

Online sources ℹ️

Related PRs 🙌

CC: @davidqing6432

Copy link
Member

@wangannie wangannie left a comment

Choose a reason for hiding this comment

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

Looks good! Ping me to review again once you finalize the styling of the play bar and add the wrapper logic.

Also, I would rename the PR to word it like a commit message -- look at other PR names for examples!


const styles = StyleSheet.create({
card: {
backgroundColor: '#D9D9D9',
Copy link
Member

Choose a reason for hiding this comment

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

If there's a corresponding color in Colors.ts, use that! If it doesn't exist but there should be one, feel free to define a new color constant there.

@@ -7,6 +7,7 @@ const createI18n = (language: string): i18nInstance => {
const i18n = i18next.createInstance().use(initReactI18next);

i18n.init({
compatibilityJSON: 'v3',
Copy link
Member

Choose a reason for hiding this comment

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

This change shouldn't be relevant here

@@ -38,6 +72,18 @@ function PlayScreen() {
</Text>
<Text style={styles.author_text}>Shaldon Ferris</Text>

{/* <RectButton
Copy link
Member

Choose a reason for hiding this comment

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

Remove?

};

export type RootStackScreenProps<T extends keyof RootStackParamList> =
NativeStackScreenProps<RootStackParamList, T>;

export type HomeStackScreenProps<T extends keyof HomeStackParamList> =
NativeStackScreenProps<HomeStackParamList, T>;
CompositeScreenProps<
Copy link
Member

Choose a reason for hiding this comment

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

Would recommend adding a comment here to explain why we do this -- something like

// Note: we use composite screen props to support navigating to the 'Play' screen from any stack


// TODO: Use toggleAudio when it is necessary, may be fixed in later PRs.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function toggleAudio(
Copy link
Member

Choose a reason for hiding this comment

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

Remove this function for now -- you can find it in the commit history in this PR if you need it later.

Comment on lines +31 to +39
function BottomPlayBar({ onPress, children, style }: BottomPlayBarProps) {
return (
<Pressable style={[styles.card, style]} onPress={onPress}>
{children}
</Pressable>
);
}

type SearchBottomPlayBarProps = {
Copy link
Member

Choose a reason for hiding this comment

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

I would rename this to NowPlayingBar or something for consistency with your wrapper naming. Also bc this bar doesn't actually handle any of the positioning logic, so including the word 'bottom' could be misleading.

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