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

SVA-258/NativeBaseProjectList #131

Merged
merged 15 commits into from Apr 20, 2023
Merged

SVA-258/NativeBaseProjectList #131

merged 15 commits into from Apr 20, 2023

Conversation

CatMac228
Copy link
Collaborator

@CatMac228 CatMac228 commented Mar 27, 2023

Description

  • Updated List container and associated components to match the new Project list design using Native Base.
  • Moved the container and associated components to the Native Base folder.
  • Updated imports on other components to point to the new Native Base folder.

Fixes # SVA-258

Type of change

Please delete options that are not relevant

  • New Feature (non-breaking change which adds functionality)

Testing locally

  • No additional requirements to test these changes locally.
  • The 'buddying' icon is different from the design as was unable to import the one used in Figma from Iconify. Have added a temporary one while we try to figure it out :)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have removed any unnecessary comments or console logging
  • I have made corresponding changes to the documentation (if required)
  • I have addressed accessibility, if needed
  • I have followed best practices, e.g. NativeBase approaches and theming
  • I have checked the app in dark mode, if making front-end design changes
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

IOS:

Android:

@CatMac228 CatMac228 marked this pull request as ready for review April 10, 2023 17:49
Copy link
Contributor

@DougieWougie DougieWougie left a comment

Choose a reason for hiding this comment

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

Great work - looks so much more like an App now!

Copy link
Collaborator

@joefhall joefhall left a comment

Choose a reason for hiding this comment

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

Nice work @CatMac228! Have spotted some things, but they're all basically small things so hopefully not loads to do

app/src/NativeBase/Components/List.tsx Show resolved Hide resolved
>
<ProjectSummary project={item} />
</ProjectListItem>
<Card margin="2">
Copy link
Collaborator

Choose a reason for hiding this comment

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

From looking at Figma, the edge of the card should line up horizontally with the edge of the segmented picker above, whereas the card has extra spacing around it at the moment here. So I think the margin setting here should be changed to marginY="2" (i.e. vertical margin only, not horizontal) and then I think it'll line up (though do check).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Did not know about X & Y margins! The spacing was driving me mad 😄

app/src/NativeBase/Components/List.tsx Show resolved Hide resolved
<Text fontSize="xs">{item.client}</Text>
<ColouredTag title={item.role} />
{Boolean(item.buddying) && (
<>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Small thing but you don't need the <> and </> here, as the HStack works as a top-level element

import { useDispatch, useSelector } from 'react-redux'
import styled from 'styled-components/native'
import { EventSearch } from './EventSearchContainer'
import { EventSearch } from '../../Containers/EventSearchContainer'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Small thing but the syntax we normally use to reference a different top-level directory inside app/src is '@/Containers/EventSearchContainer'

onSearchButtonPress={() => navigate(screens.search[params.type], '')}
/>
<VStack
_dark={{ backgroundColor: 'bgDarkMode.100' }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you can remove these _dark and _light settings here as the default does the same?

space={4}
padding={4}
>
<Heading fontSize="md">Projects List</Heading>
Copy link
Collaborator

@joefhall joefhall Apr 14, 2023

Choose a reason for hiding this comment

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

From looking at the NativeBase docs for Heading, I think the recommended way to change a heading is using the size attribute rather than fontSize (works differently to e.g. <Text>)

Copy link
Collaborator

@joefhall joefhall left a comment

Choose a reason for hiding this comment

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

Looking great @CatMac228 -- just one thing I spotted with the bottom of the last card being cut off when I see it in on my Android emulator. Have put in a suggestion you could try, if that doesn't work or you can't figure it out and need some help, do give me a shout if you want.

@@ -116,18 +130,62 @@ const List: FC<ListProps> = ({ data, mode, options, searchScreen, type }) => {
return (
<FlatList
Copy link
Collaborator

Choose a reason for hiding this comment

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

The one last thing I've spotted is that the bottom of the last item in the list is being cut off.

I think (but am not certain) that you might need to set a maxHeight for the FlatList using an approach similar to what's being done in ProjectRegisterInterest -- define a height for the stuff that's above the list (like line 37), calculate the height of the window (line 158) , then set a maxHeight of one minus the other (like line 171 except that uses minHeight whereas I think you want to use maxHeight here).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thank you for spotting, that's an embarrassing miss on my part! 😄 messed about with it there and it is kind of working but there's a bit of white space above the nav icons now...not sure if that's okay or not

(red line = empty space)

Screenshot 2023-04-18 at 20 57 27

Copy link
Collaborator

Choose a reason for hiding this comment

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

No worries -- obviously good to spot as much as you can yourself, but this partly why we do reviews 🙂

That looks better, thanks. (Could increase the height of the list ever so slightly if you think it needs it.) If you want to push the change I can re-review.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@CatMac228 that's looking cut off on my emulator?

Screenshot 2023-04-19 10 26 14

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh no it looks so different on IOS 😢
Screenshot 2023-04-19 at 12 15 03

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

they seem to be behaving the same way when I use minHeight but not maxHeight 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's possible I'm wrong about maxHeight and it should be minHeight -- was just a suggestion off the top of my head. If you've got a version that works do push again and I can try it my end too. I'm travelling this afternoon but should be able to get online again this evening.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No probs! Will remove the maxHeight bit for now although the list will be cut off slightly at the bottom. Wonder if it could be related to these issues facebook/react-native#23693 &facebook/react-native#36447 ?

Copy link
Collaborator

@joefhall joefhall left a comment

Choose a reason for hiding this comment

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

🙌

@CatMac228 CatMac228 merged commit 55dda8f into main Apr 20, 2023
1 of 2 checks passed
@roryf roryf deleted the SVA-258/NativeBaseProjectList branch November 8, 2023 11:14
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.

None yet

3 participants