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

Reimplement footer #95

Merged
merged 2 commits into from
Jan 23, 2021
Merged

Reimplement footer #95

merged 2 commits into from
Jan 23, 2021

Conversation

peteryates
Copy link
Member

This is a reimplementation of the footer component built using @paulrobertlloyd's suggestions in #92

  • meta_items: Array. items for use in the meta section of the footer.
  • meta_items_title: String. Title for a meta item section. Defaults to ‘Support links’
  • meta_content: Slot? Content to add to the meta section of the footer. This will appear below any links specified using meta_items option.
  • meta_licence: String/Boolean. Licence text. Defaults to OGL licence (OGL logo plus the text ‘All content is available under the Open Government Licence v3.0, except where otherwise stated’). If this option is used, the OGL SVG logo is removed. If set to false, both the SVG logo and text span are removed.
  • meta: Slot. Custom HTML that appears to the left of the crest. If this slot is used, all of the above settings are ignored, and defaults overwritten.

Here's the spec output describing the new behavoiur

GovukComponent::Footer
  when no arguments are provided
    the default licence info is included
    the OGL logo is present
    the copyright information is present
  custom meta contents
    meta items and title
      when no meta_items are present
        no title should be rendered
        no list should be rendered
      when meta_items are present
        the title should be rendered but visually hidden
        each of the provided links is rendered in a list
    when custom meta_licence text is provided
      the custom licence text should be rendered
      the licence SVG is not rendered
    when custom meta_licence text is disabled with nil
      the licence text not should be rendered
    adding custom content under the meta items list
      the content should be rendered
      the licence, meta items and header should still be rendered
  overwriting all meta information with custom content
    the custom content should be rendered
    the licence, meta items and header shouldn't be rendered
  when custom copyright information is provided
    the custom copyright text and link are rendered

Fixes #92
Closes #94

This approach allows for more flexibility and a more intuitive feel to
the arguments.

* meta_items: Array. items for use in the meta section of the footer.
* meta_items_title: String. Title for a meta item section. Defaults to
  ‘Support links’
* meta_content: Slot? Content to add to the meta section of the footer.
  This will appear below any links specified using meta_items option.
* meta_licence: String/Boolean. Licence text. Defaults to OGL licence
  (OGL logo plus the text ‘All content is available under the Open
  Government Licence v3.0, except where otherwise stated’). If this option
  is used, the OGL SVG logo is removed. If set to false, both the SVG logo
  and text span are removed.
* meta: Slot. Custom HTML that appears to the left of the crest. If this
  slot is used, all of the above settings are ignored, and defaults
  overwritten.

Thanks to @paulrobertlloyd for the suggestions

Refs #92
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.

Provide additional flexibility in footer component
1 participant