-
Notifications
You must be signed in to change notification settings - Fork 18
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
base: main
Are you sure you want to change the base?
Conversation
Thank you, can you link this PR to this issue ? 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. |
app/(drawer)/settings.tsx
Outdated
import { useCallback, useState } from 'react'; | ||
import { Direction } from '@bam.tech/lrud'; | ||
|
||
export default function TVScreen() { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
app/(drawer)/_layout.tsx
Outdated
@@ -77,6 +84,7 @@ const useDrawerStyles = function () { | |||
width: scaledPixels(300), | |||
backgroundColor: '#2c3e50', // Dark blue background |
There was a problem hiding this comment.
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
app/(drawer)/settings.tsx
Outdated
); | ||
} | ||
|
||
const useTVStyles = function() { |
There was a problem hiding this comment.
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"
app/(drawer)/settings.tsx
Outdated
textAlign: 'center', | ||
}, | ||
focusedMenuItem: { | ||
backgroundColor: '#FFFFFF', |
There was a problem hiding this comment.
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
app/(drawer)/settings.tsx
Outdated
submenu: { | ||
flex: 1, | ||
justifyContent: 'flex-start', | ||
paddingVertical: 20, |
There was a problem hiding this comment.
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.
app/(drawer)/settings.tsx
Outdated
justifyContent: 'space-between', | ||
}, | ||
focusedSubMenuItem: { | ||
backgroundColor: '#EEE', |
There was a problem hiding this comment.
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
components/SettingMenu.tsx
Outdated
fontSize: scaledPixels(32), | ||
}, | ||
menuTextFocused: { | ||
color: 'black', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: same as above.
components/SettingMenu.tsx
Outdated
fontSize: scaledPixels(16), | ||
}, | ||
footerText: { | ||
color: '#FFF', |
There was a problem hiding this comment.
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).
app/(drawer)/settings.tsx
Outdated
backgroundColor: '#444', | ||
borderRadius: 8, | ||
}, | ||
menuText: { |
There was a problem hiding this comment.
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.
components/SettingMenu.tsx
Outdated
export default function SettingMenu(props: any) { | ||
const router = useRouter(); | ||
const { isOpen: isMenuOpen, toggleMenu } = useMenuContext(); | ||
const styles = useDrawerStyles(); |
There was a problem hiding this comment.
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)
components/CustomDrawerContent.tsx
Outdated
minHeight: '90%', | ||
flex: 1, | ||
marginBottom: scaledPixels(20), | ||
}, |
There was a problem hiding this comment.
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.
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:
tvOS: |
@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? |
@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.movweb_browser.mov |
When you raise the PR, it should show you default template for raising PR. |
have you checked here is the documention: https://reactnative.dev/docs/platform-specific-code |
There was a problem hiding this 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.
-
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.
-
I am also not able to run this code on TvOS but it was working till last changes.
-
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?
-
Setting pages on the web have alignment issues (please check screenshots).
app/(drawer)/settings.tsx
Outdated
{ id: 'display', label: 'Display' }, | ||
]; | ||
|
||
const submenus = { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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?
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. Thanks. |
@giolaq I have added a setting page. Please have a look. If the UI looks ok, I will add language selector on this page.