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

Feature [RM85] Display Cards #86

Merged
merged 5 commits into from
Aug 19, 2021
Merged

Conversation

swg99
Copy link
Contributor

@swg99 swg99 commented Aug 17, 2021

https://github.com/orgs/novoda/projects/1#card-66586128
Character data is shown and more is loaded as the user scrolls.

ViewModel provides characterCardStates
Changed from get to load considering function does not return anything
Provides an episode for an episode url
A character Card is shown for each character from the R and M Api. The RemoteImage view is from stack overflow.
Character Cards are displayed on the app and more are loaded as the user scrolls.
@swg99 swg99 linked an issue Aug 17, 2021 that may be closed by this pull request
}

private func getStatusText(character: Character) -> String {
var str = ""

Choose a reason for hiding this comment

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

Try to avoid names of variables that are not descriptive

import SwiftUI

final class CharacterCardStateFactory {
private func getStatusColor(character: Character) -> Color {

Choose a reason for hiding this comment

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

Have you consider this to be a private extension on Character status?

Choose a reason for hiding this comment

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

This could be static function

Comment on lines +86 to +90





Choose a reason for hiding this comment

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

Just being picky here, but be careful when committing not to add whitespaces

struct CharacterTileView_Previews: PreviewProvider {
static var previews: some View {
Group {
VStack {
CharacterCard(characterCardState: CharacterCardState(id: 2, name: "Morty", image: UIImage(named: "morty-image")!, isAlive: true, species: "Human", lastLocation: "Earth", firstEpisode: "Episode 1"))
CharacterCard(cardViewModel: CharacterCardViewModel(character: Character(id: 1, name: "Morty", species: "Human", lastLocation: LastLocation(name: "Earth", url: ""), status: .alive, imageURL: "", episodeURLs: [])))

Choose a reason for hiding this comment

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

I like that you're using previews. Have you thought of all the possible display views?

@swg99 swg99 merged commit 7746368 into scottie-main Aug 19, 2021
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.

Display CharacterCards in the CharacterListView
2 participants