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

Add margin_top flag to feedback component #222

Merged
merged 1 commit into from
Mar 15, 2018

Conversation

vanitabarrett
Copy link
Contributor

Topic pages need the feedback component to be flush with the bottom of the taxon grid. We therefore need to be able to add a flag to remove the top margin in these cases

Example use on a topic page:

screen shot 2018-03-15 at 10 27 52

@vanitabarrett vanitabarrett force-pushed the add-margin-flag-feedback-component branch from cf02572 to b875451 Compare March 15, 2018 10:33
Copy link
Contributor

@maxgds maxgds left a comment

Choose a reason for hiding this comment

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

Couple of tiny change suggestions

@@ -1,8 +1,10 @@
<%
contact_govuk_path = "/contact/govuk"
margin_top||= 1
Copy link
Contributor

Choose a reason for hiding this comment

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

missing space before the ||

@@ -1,8 +1,10 @@
<%
contact_govuk_path = "/contact/govuk"
margin_top||= 1
margin_top_class = "gem-c-feedback--top-margin" if margin_top == 1
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure you need the
== 1

Topic pages need the feedback component to be flush with the bottom of the taxon grid. We therefore need to be able to add a flag to remove the top margin in these cases
@vanitabarrett vanitabarrett force-pushed the add-margin-flag-feedback-component branch from b875451 to 25ecf4d Compare March 15, 2018 10:43
@vanitabarrett
Copy link
Contributor Author

@maxgds Added the missing space 👍 For the second comment, I think the == 1 is needed otherwise the margin top class is always applied (because margin_top param always exists)

@maxgds
Copy link
Contributor

maxgds commented Mar 15, 2018

I thought if it was set to false it would be the same as not existing in the evaluation, but happy to take your word for it.

@vanitabarrett
Copy link
Contributor Author

@maxgds Ah okay, I was following a pattern for another component where we pass margin_top: 0 rather than false. Perhaps we need to add a story in the frontend backlog to go and standardise how we do this across all components.

@vanitabarrett vanitabarrett merged commit 477ffd2 into master Mar 15, 2018
@vanitabarrett vanitabarrett deleted the add-margin-flag-feedback-component branch March 15, 2018 10:58
@vanitabarrett vanitabarrett mentioned this pull request Mar 15, 2018
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

2 participants