on master help sign in
pages/applications: remove related grants if none available
38bfc32Matilde Park
pages/applications/[[...application]].js+2−2
@@ -111,7 +111,7 @@ const ApplicationPage = ({ data, markdown, organisation, matchedGrants, search,
111 markdown={markdown}
111 markdown={markdown}
112 />
112 />
113 <hr className="text-wall-200" />
113 <hr className="text-wall-200" />
114− {matchedGrants && <div className="basis-full flex flex-col space-y-2">
114+ {matchedGrants.length > 0 && <div className="basis-full flex flex-col space-y-2">
115 <p className="font-semibold text-wall-400">Related Grants</p>
115 <p className="font-semibold text-wall-400">Related Grants</p>
116 {matchedGrants.map((grant) => {
116 {matchedGrants.map((grant) => {
117 return <GrantPreview grant={grant} />
117 return <GrantPreview grant={grant} />
@@ -181,7 +181,7 @@ export const getServerSideProps = async ({ params, res }) => {
181 ? JSON.stringify(Markdown.parse({ post: { content } }))
181 ? JSON.stringify(Markdown.parse({ post: { content } }))
182 : null;
182 : null;
183
183
184− const matchedGrants = getGrantsByShortcode(params.application) || null;
184+ const matchedGrants = getGrantsByShortcode(params.application);
185
185
186 if (!data.title) {
186 if (!data.title) {
187 data = {
187 data = {