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

Setting page added #23

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

Conversation

madhushree007
Copy link

@giolaq I have added a setting page. Please have a look. If the UI looks ok, I will add language selector on this page.

@giolaq
Copy link
Contributor

giolaq commented Oct 18, 2024

Thank you, can you link this PR to this issue ?
Attach a couple of the screenshots on the issue too.

It's preferred to include Settings not at the same level of the main navigation paths but inside a page that the user can access from the profile.

@giolaq giolaq marked this pull request as draft October 18, 2024 17:41
@madhushree007 madhushree007 marked this pull request as ready for review October 24, 2024 15:29
import { useCallback, useState } from 'react';
import { Direction } from '@bam.tech/lrud';

export default function TVScreen() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is it called TVScreen? I think calling it SettingScreen is more suitable

Copy link
Author

Choose a reason for hiding this comment

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

Fixed! thanks for pointing.

@@ -37,17 +38,17 @@
"react-native-reanimated": "~3.10.1",
"react-native-safe-area-context": "4.10.1",
"react-native-screens": "3.31.1",
"react-native-vector-icons": "^10.2.0",
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 this is the only things added to the package.json, the others modified lines seems just moving lines. Can you commit only a file with this dependency entry?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, This is the only thing added in the package.json. The vector icons has been used in setting.tsx and CustomDrawerContent.tsx

Copy link
Author

Choose a reason for hiding this comment

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

@giolaq I have separated the setting menu in a separate file and imported it in custom drawer. Now setting.tsx and SettingMenu.tsx has icon dependency.

Copy link
Contributor

@Neha Neha left a comment

Choose a reason for hiding this comment

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

thank you for your PR. Could you please fill the PR template.

I have added a few comments.

@@ -77,6 +84,7 @@ const useDrawerStyles = function () {
width: scaledPixels(300),
backgroundColor: '#2c3e50', // Dark blue background
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: can you please remove the comments for backgroundColor & paddingTop

);
}

const useTVStyles = function() {
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: naming convention should be more align towards the setttings rather that "tvstyles"

textAlign: 'center',
},
focusedMenuItem: {
backgroundColor: '#FFFFFF',
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: should be lowercase and only 3 chars - #fff

submenu: {
flex: 1,
justifyContent: 'flex-start',
paddingVertical: 20,
Copy link
Contributor

Choose a reason for hiding this comment

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

paddingVertical and paddingHorizontal can be replace by just padding.

justifyContent: 'space-between',
},
focusedSubMenuItem: {
backgroundColor: '#EEE',
Copy link
Contributor

Choose a reason for hiding this comment

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

for consistency, can we please make color code to lowercase please

fontSize: scaledPixels(32),
},
menuTextFocused: {
color: 'black',
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: same as above.

fontSize: scaledPixels(16),
},
footerText: {
color: '#FFF',
Copy link
Contributor

Choose a reason for hiding this comment

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

please make it lowercase (and where ever the color code is uppercase).

backgroundColor: '#444',
borderRadius: 8,
},
menuText: {
Copy link
Contributor

Choose a reason for hiding this comment

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

question: why we have dropped scaledPixels() for this element.

export default function SettingMenu(props: any) {
const router = useRouter();
const { isOpen: isMenuOpen, toggleMenu } = useMenuContext();
const styles = useDrawerStyles();
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be right after the function definition (for consistency)

minHeight: '90%',
flex: 1,
marginBottom: scaledPixels(20),
},
Copy link
Contributor

Choose a reason for hiding this comment

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

formatting looks off here. Please format the file.

@Neha
Copy link
Contributor

Neha commented Oct 29, 2024

Thank you @madhushree007 for implementing the comments. PR looks great.

I ran the PR at local , here are the few things to take care of:

  1. Web and tvOS: settings font-size is not consistent with other in the left navigation
  2. Web: not able to navigate the options on setting page by keyboard
  3. Web: not able to select any other language beside English
  4. Web: UI is breaking on clicking on "Sound" and "display"

Screenshot 2024-10-29 at 16 45 37
Screenshot 2024-10-29 at 16 45 45
Screenshot 2024-10-29 at 16 45 59

tvOS:

  1. there is extra space on top of settings in left navigation
  2. Navigation between language, sound, and display is little confusing . It sometimes skip the language (white background didn't get visible)
    Screenshot 2024-10-29 at 16 59 16

@madhushree007
Copy link
Author

@Neha I have made changes according to your comments. I am not able to the PR template. Could you please guide me how and where I can fill PR template?

@madhushree007
Copy link
Author

@Neha Here is the screen recording for from tvOS simulator and web browser. I am aware of the issues @giolaq has mentioned. Those issues still needs to be fixed. II’m finding it a bit challenging to manage CSS for both tvOS and web platforms simultaneously. Any suggestions on balancing or streamlining the process would be really helpful.

tvOS.mov
web_browser.mov

@Neha
Copy link
Contributor

Neha commented Nov 1, 2024

@Neha I have made changes according to your comments. I am not able to the PR template. Could you please guide me how and where I can fill PR template?

When you raise the PR, it should show you default template for raising PR.

@Neha
Copy link
Contributor

Neha commented Nov 1, 2024

@Neha Here is the screen recording for from tvOS simulator and web browser. I am aware of the issues @giolaq has mentioned. Those issues still needs to be fixed. II’m finding it a bit challenging to manage CSS for both tvOS and web platforms simultaneously. Any suggestions on balancing or streamlining the process would be really helpful.

tvOS.mov
web_browser.mov

have you checked Platform.OS?

here is the documention: https://reactnative.dev/docs/platform-specific-code

@madhushree007
Copy link
Author

@Neha @giolaq I have added some css fix as per your suggestions :)

Copy link
Contributor

@Neha Neha left a comment

Choose a reason for hiding this comment

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

Thank you so much for your amazing work.

  1. The formatting of all files is very off. Can you please fix that. It is hard to understand all changes you made since last review.

  2. I am also not able to run this code on TvOS but it was working till last changes.

  3. On web, the settings font-size and position is not align to the rest of the link. How would you like to keep it? same as rest of the links or different?

  4. Setting pages on the web have alignment issues (please check screenshots).

I have left a few comments please check:
Screenshot 2024-11-19 at 09 37 11
Screenshot 2024-11-19 at 09 37 28
Screenshot 2024-11-19 at 09 37 22

{ id: 'display', label: 'Display' },
];

const submenus = {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should move the languages to a separate config file

<DefaultFocus key={index}>
<SpatialNavigationFocusableView
onSelect={() => {
console.log(item.name);
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove the console

<SpatialNavigationFocusableView
key={index}
onSelect={() => {
console.log(item.name);
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove the console

fontSize: scaledPixels(16),
},
footerText: {
color: '#FFF',
Copy link
Contributor

Choose a reason for hiding this comment

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

should be lowercase. Have the consistency in styling. Either have hexacode or string.

},
cogIcon: {
paddingRight: scaledPixels(6),
color: '#FFF',
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

@@ -23,6 +23,7 @@
"expo-build-properties": "~0.12.3",
"expo-constants": "~16.0.2",
"expo-font": "~12.0.7",
"expo-linear-gradient": "~13.0.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

are we using linear gradient in settings page?

@madhushree007
Copy link
Author

Thanks for your comments @Neha

For the formatting issue - I am using Prettier in VS code that might have different setting from yours because code looks well formatted in my code editor.

I have just checked and I can confirm that It is working as expected in TvOS. I am not sure why it is not working at your side. I can see there is a conflict in the PR but I am not able to resolve the conflict. I did try to pull the branch but I am not authorised.

Setting menu is separated from the rest of the menu as suggested by @giolaq. It is supposed to be smaller in font size and separated from Drawer menu.

I had a look at the Screenshot for web view and I think this is the expected behaviour because we do not have any data for other menus so we are not displaying the submenu for "Sound" and "Display". These are only placeholder. Here is the SS from my web view.
Screenshot 2024-11-19 at 11 49 03
Screenshot 2024-11-19 at 11 49 10

Thanks.

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.

3 participants