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

feat: add buttons to hide/show ui #632

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open

Conversation

dannyhw
Copy link
Member

@dannyhw dannyhw commented Oct 25, 2024

Issue:

What I did

image image

How to test

Please explain how to test your changes and consider the following questions

  • Does this need a new example in examples/expo-example?
  • Does this need an update to the documentation?

If your answer is yes to any of these, please make sure to include it in your PR.

import { useTheme } from '@storybook/react-native-theming';

export function FullscreenIcon({
color, //= '#2E3438',
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this is a missed debug statement?

borderWidth: 1,
borderColor: theme.appBorderColor,
}}
onPress={() => setUiHidden(!uiHidden)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Even though we don't have any other calls of setUiHidden so it should not be a problem. I would suggest using function setter for toggling.

Suggested change
onPress={() => setUiHidden(!uiHidden)}
onPress={() => setUiHidden(prev => !prev)}

<TouchableOpacity
style={{
position: 'absolute',
bottom: uiHidden ? 56 + insets.bottom : 16,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think in the future it might be useful to make it draggable (like android notification bubbles), in case it overlaps with buttons of a story component.

Comment on lines +157 to +159
<CloseFullscreenIcon color={theme.color.mediumdark} />
) : (
<FullscreenIcon color={theme.color.mediumdark} />
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably it's better to use theme.background.content.
Otherwise it does not respeect browsers darkmode, right?

@dannyhw
Copy link
Member Author

dannyhw commented Oct 27, 2024

thanks for all the feedback @tlow92 I definitely apply those and iterate a bit further to see what I can come up with

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.

2 participants