Skip to content

Commit

Permalink
CMS-304: Fix spacing issue and add hasTrailReport field (#1411)
Browse files Browse the repository at this point in the history
* CMS-304: Fix spacing issue and add hasTrailReport field

* CMS-304: Change font size smaller in visitor guidelines

* CMS-304: Add hasTrailReport field to guideline-type collection
  • Loading branch information
ayumi-oxd authored Aug 9, 2024
1 parent 95145e5 commit 7a09937
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
],
"required": true
},
"hasTrailReport": {
"type": "boolean",
"default": false
},
"defaultRank": {
"type": "integer",
"min": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"isActive": {
"type": "boolean",
"default": false,
"default": true,
"required": true
},
"rank": {
Expand Down Expand Up @@ -46,4 +46,4 @@
"inversedBy": "parkGuidelines"
}
}
}
}
1 change: 1 addition & 0 deletions src/gatsby/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ exports.createSchemaCustomization = ({ actions }) => {
type STRAPI_GUIDELINE_TYPE implements Node @derivedTypes @dontInfer {
guidelineName: String
icon: String
hasTrailReport: Boolean
defaultRank: Int
defaultTitle: String
defaultDescription: STRAPI_GUIDELINE_TYPEDefaultDescription
Expand Down
2 changes: 1 addition & 1 deletion src/gatsby/src/components/park/advisoryDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default function AdvisoryDetails({ advisories, parkType }) {
}, [advisories.length])

return (
<div id="advisories" className="mb-4">
<div id="advisories">
{/* id="park-advisory-details-container" should be removed once it's removed from the contents */}
<h3 id="park-advisory-details-container">
{`Advisories (${advisories.length})`}
Expand Down
6 changes: 3 additions & 3 deletions src/gatsby/src/components/park/visitorGuidelines.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const Guideline = ({ guide, reports }) => {
{guide.description.data.description ?
guide.description.data.description : guidelineType.defaultDescription.data.defaultDescription}
</HtmlContent>
{(guidelineType.icon === "list-check" && reports?.length > 0) &&
{(guidelineType.hasTrailReport && reports?.length > 0) &&
reports.map((report, index) => (
<p key={index}>
View the <a href={report.reportUrl}>{report.title} [PDF]</a>
Expand All @@ -46,11 +46,11 @@ export default function VisitorGuidelines({ guidelines, trailReports }) {
return rankA - rankB
})
return (
<>
<div id="visitor-guidelines">
<h3>Visitor guidelines</h3>
{sortedGuidelines.map((guide, index) => (
<Guideline key={index} guide={guide} reports={trailReports} />
))}
</>
</div>
)
}
11 changes: 9 additions & 2 deletions src/gatsby/src/styles/parks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,13 @@ h2.section-heading {
}
}

// Know before you go
#know-before-you-go {
#advisories {
margin-bottom: 40px;
}
}

.park-overview {
&.collapsed {
max-height: 260px;
Expand Down Expand Up @@ -478,7 +485,7 @@ h2.section-heading {

// visitor guidelines
.guideline {
margin-bottom: 16px;
margin-bottom: 8px;
&--left {
svg, img {
width: 48px;
Expand All @@ -491,7 +498,7 @@ h2.section-heading {
margin-bottom: 8px;
}
p {
margin-bottom: 0;
font-size: 0.875rem;
}
}
}
1 change: 1 addition & 0 deletions src/gatsby/src/templates/park.js
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ export const query = graphql`
}
guidelineType {
icon
hasTrailReport
defaultRank
defaultTitle
defaultDescription {
Expand Down

0 comments on commit 7a09937

Please sign in to comment.