Giter VIP home page Giter VIP logo

Comments (8)

peteryates avatar peteryates commented on July 25, 2024 1

It is absolutely. It'll be in the next release.

from govuk-components.

peteryates avatar peteryates commented on July 25, 2024

I've been thinking over how this might look and think that doing something like this feels sensible:

<%= render GovukComponent::NotificationBanner.new(
  title: "Important",
  heading: "You have 7 days left to send your application",
  link_text: "View application."
  link_target: "/applications/12345"
) %>

Additionally, taking a success flag to make it green and a block so additional content can be placed beneath the heading if required.

Did I miss anything?

from govuk-components.

frankieroberto avatar frankieroberto commented on July 25, 2024

@peteryates I don't think it makes sense to split out the heading from the link text and link target, as sometimes you may have multiple links, or other unanticipated content (eg two paragraphs?). Even in the simple example given, the full stop after "View application" should not be part of the link text:

Screenshot 2020-12-01 at 21 11 45

It might be better to more closely align with the Nunjucks macro options, and having something like:

<%= render GovukComponent::NotificationBanner.new(
  title: "Important",
  html: "You have 7 days left to send your application. <a href=\"/applications/12345\">View application</a>."
) %>

(There are other macro options we could also support, such as titleHeadingLevel, titleId, disableAutoFocus, classes and attributes)

from govuk-components.

peteryates avatar peteryates commented on July 25, 2024

@frankieroberto I'm afraid I didn't see your comment until I'd pushed my first crack at it. I built in classes and attributes but definitely agree that titleHeadingLevel, titleId and disableAutoFocus make sense too. Will address fully in #71

from govuk-components.

peteryates avatar peteryates commented on July 25, 2024

I've kept the link_text and link_target behaviour for the time being. It is my understanding that links inside the component headings need to have the class govuk-notification-banner__link which is a burden for the developer to remember every time they add a link or pass in a link_to.

from govuk-components.

paulrobertlloyd avatar paulrobertlloyd commented on July 25, 2024

Would it be possible to create this banner with this component (i.e. with the unlinked full stop)? https://apply-beta-prototype.herokuapp.com/dashboard/12345/ended-without-success (apply/bat)

from govuk-components.

peteryates avatar peteryates commented on July 25, 2024

@paulrobertlloyd Yeah, the associated PR (#71) has a screenshot of the docs with an example call and output.

from govuk-components.

paulrobertlloyd avatar paulrobertlloyd commented on July 25, 2024

@peteryates Perfect, thanks!

from govuk-components.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.