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

Sync rendering of KnowledgePanels with the latest API changes. #667

Merged
merged 15 commits into from Nov 18, 2021

Conversation

jasmeet0817
Copy link
Contributor

This is how it looks:

image

@M123-dev
Copy link
Member

Some CI warnings @jasmeet0817

@jasmeet0817
Copy link
Contributor Author

Some CI warnings @jasmeet0817

Fixed

Copy link
Contributor

@monsieurtanuki monsieurtanuki left a comment

Choose a reason for hiding this comment

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

Hi @jasmeet0817!
I haven't seen anything strange; please have a look at my single comment though.

Comment on lines 19 to 31
if (knowledgePanel.titleElement!.type == TitleElementType.GRADE) {
return ScoreCard(
iconUrl: knowledgePanel.titleElement.iconUrl!,
description: knowledgePanel.titleElement.title,
cardEvaluation: getCardEvaluationFromKnowledgePanel(knowledgePanel),
iconUrl: knowledgePanel.titleElement!.iconUrl!,
description: knowledgePanel.titleElement!.title,
cardEvaluation: getCardEvaluationFromKnowledgePanelTitleElement(
knowledgePanel.titleElement!,
),
);
}
return KnowledgePanelTitleCard(
knowledgePanelTitleElement: knowledgePanel.titleElement,
knowledgePanelTitleElement: knowledgePanel.titleElement!,
evaluation: knowledgePanel.evaluation,
);
Copy link
Contributor

Choose a reason for hiding this comment

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

A switch syntax would be cleaner, as you're using an enum as input.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@jasmeet0817 jasmeet0817 merged commit 2d0cf81 into openfoodfacts:develop Nov 18, 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.

None yet

3 participants