-
Notifications
You must be signed in to change notification settings - Fork 6
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
Fix AudienceTopics styles and add types #367
Conversation
@@ -6,10 +6,11 @@ export function AudienceTopics({ tags }: FormattedAudienceTopics) { | |||
if (isEmpty(tags)) return null | |||
const tagsList = tags.map(({ id, href, name }) => ( | |||
<div key={id}> | |||
<div className="vads-u-margin-right--1 vads-u-margin-bottom--1 medium-screen:vads-u-margin-bottom--0"> | |||
<div className="vads-u-margin-right--1 vads-u-margin-bottom--1 medium-screen:vads-u-margin-bottom--1p5"> | |||
<Link | |||
href={`${href}/${encodeURI(name)}`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, ty
src/data/queries/audienceTopics.ts
Outdated
@@ -3,14 +3,21 @@ import { ParagraphAudienceTopics } from '@/types/drupal/paragraph' | |||
import { QueryFormatter } from 'next-drupal-query' | |||
import { AudienceTopic } from '@/types/formatted/audienceTopics' | |||
|
|||
const getTagsList = (fieldTags) => { | |||
if (!fieldTags) return null | |||
interface Tag { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this needed?
if the formatter is returning AudienceTopic[]
but it just calls getTagsList which returns Tag[]
, can we re-use one or the other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed that, thanks
Description
department-of-veterans-affairs/va.gov-cms#16617
Tags for resource and support taxonomies were largely already done. This PR fixes up some styling and adds type safety to the getTags function.
Changes
Testing done
Local
Screenshots
QA steps
Verify tags render as expected in storybook
Is this PR blocked by another PR?
DO NOT MERGE
label