From a75b5cc65ad931ed34c443f8fa1dabc2b128c95f Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:59:54 -0400 Subject: [PATCH 01/12] feat: add featured bool to static cms --- public/admin/config.yml | 3 +++ src/content/config.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/public/admin/config.yml b/public/admin/config.yml index abc1ed6..cdaa516 100644 --- a/public/admin/config.yml +++ b/public/admin/config.yml @@ -91,6 +91,9 @@ collections: i18n: duplicate label: Citation widget: text + - name: feature + label: Featured Publication + widget: boolean - name: image required: false i18n: duplicate diff --git a/src/content/config.ts b/src/content/config.ts index e8f596d..b7c288b 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -32,6 +32,7 @@ const publications = defineCollection({ author: z.string(), pubDate: z.coerce.date(), citation: z.string(), + feature: z.boolean(), image: z.string().optional(), pdf: z.string().optional(), url: z.string().optional(), From 25bf0e1a45b41944d2481f2a6fb5414c000b24f3 Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:02:35 -0400 Subject: [PATCH 02/12] chore: add feature data to all pubs --- .../article-2021-09-01_rodilitz-scott-and-edward-h-kaplan.md | 1 + ...rine-m-jonathan-hiskey-jorge-durand-and-douglas-s-massey.md | 1 + .../book-2013-01-01_arias-patricia-and-jorge-durand.md | 1 + src/content/publications/book-2016-01-01_durand-jorge.md | 1 + .../publications/chapter-2014-07-23_massey-douglas-s.md | 1 + src/content/publications/chapter-2015-02-01_durand-jorge-g.md | 1 + .../chapter-2015-03-02_torres-rebecca-mar\303\255a.md" | 1 + .../chapter-2015-05-05_massey-douglas-s-and-karen-a-pren.md | 1 + .../publications/chapter-2015-07-07_massey-douglas-s.md | 1 + ...onato-katharine-m-and-gabriela-le\303\263n-p\303\251rez.md" | 1 + .../chapter-2016-01-01_durand-jorge-and-karen-pren.md | 1 + .../publications/chapter-2016-01-01_riosmena-fernando.md | 1 + src/content/publications/chapter-2016-01-01_schmidt-kerstin.md | 1 + .../chapter-2016-01-01_s\303\241nchez-soto-gabriela.md" | 1 + ...1995-01-01_department-of-economics-georgetown-university.md | 3 ++- 15 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/content/publications/article-2021-09-01_rodilitz-scott-and-edward-h-kaplan.md b/src/content/publications/article-2021-09-01_rodilitz-scott-and-edward-h-kaplan.md index ef6457b..77057a7 100644 --- a/src/content/publications/article-2021-09-01_rodilitz-scott-and-edward-h-kaplan.md +++ b/src/content/publications/article-2021-09-01_rodilitz-scott-and-edward-h-kaplan.md @@ -4,5 +4,6 @@ author: Rodilitz, Scott and Edward H. Kaplan pubDate: 2021-09-01 citation: 'Rodilitz, Scott and Edward H. Kaplan. "Snapshot Models of Undocumented Immigration." Risk Analysis, (2021) DOI: 10.1111/risa.13658' +feature: true url: https://pubmed.ncbi.nlm.nih.gov/33373472/ --- diff --git a/src/content/publications/book-2010-01-01_donato-katharine-m-jonathan-hiskey-jorge-durand-and-douglas-s-massey.md b/src/content/publications/book-2010-01-01_donato-katharine-m-jonathan-hiskey-jorge-durand-and-douglas-s-massey.md index cb79153..afd2d1f 100644 --- a/src/content/publications/book-2010-01-01_donato-katharine-m-jonathan-hiskey-jorge-durand-and-douglas-s-massey.md +++ b/src/content/publications/book-2010-01-01_donato-katharine-m-jonathan-hiskey-jorge-durand-and-douglas-s-massey.md @@ -5,6 +5,7 @@ pubDate: 2010-01-01 citation: Donato, Katharine M., Jonathan Hiskey, Jorge Durand, and Douglas S. Massey. 2010. Salvando fronteras. Migración internacional en América Latina y el Caribe. Miguel Angel Porrúa. +feature: false image: /pubs/salvando_fronteras.jpg pdf: /pubs/donato_hiskey_durand_massey_2010-salvando-fronteras.pdf --- diff --git a/src/content/publications/book-2013-01-01_arias-patricia-and-jorge-durand.md b/src/content/publications/book-2013-01-01_arias-patricia-and-jorge-durand.md index e7c2286..763243e 100644 --- a/src/content/publications/book-2013-01-01_arias-patricia-and-jorge-durand.md +++ b/src/content/publications/book-2013-01-01_arias-patricia-and-jorge-durand.md @@ -5,6 +5,7 @@ pubDate: 2013-01-01 citation: Arias, Patricia and Jorge Durand. 2013. Paul S. Taylor y la migración jalisciense a Estados Unidos. Universidad de Guadalajara, Centro Universitario de los Altos. +feature: false image: /pubs/taylor-y-la-migracion-jaliscience.jpg pdf: /pubs/2013_arias_durand_paul_taylor.pdf --- diff --git a/src/content/publications/book-2016-01-01_durand-jorge.md b/src/content/publications/book-2016-01-01_durand-jorge.md index 00fb66d..ef25dc8 100644 --- a/src/content/publications/book-2016-01-01_durand-jorge.md +++ b/src/content/publications/book-2016-01-01_durand-jorge.md @@ -4,6 +4,7 @@ author: Durand, Jorge pubDate: 2016-01-01 citation: "Durand, Jorge . 2016. Historia mínima de la migración México-Estados Unidos . 1a. edición. Ciudad de México: El Colegio de México" +feature: true image: /pubs/historiaminimamexico.jpg url: https://doi.org/10.2307/j.ctt1t89k3g --- diff --git a/src/content/publications/chapter-2014-07-23_massey-douglas-s.md b/src/content/publications/chapter-2014-07-23_massey-douglas-s.md index 733f181..66175ed 100644 --- a/src/content/publications/chapter-2014-07-23_massey-douglas-s.md +++ b/src/content/publications/chapter-2014-07-23_massey-douglas-s.md @@ -7,5 +7,6 @@ citation: > In Lois Ann Lorentzen (Ed.), Hidden Lives and Human Rights in the United States: Undestanding the Constroversies and Tragedies of Undocumented Immigration (pp. 53-70). Santa Barbara, California: Praeger, 2014. +feature: false image: /pubs/hidden-lives.jpg --- diff --git a/src/content/publications/chapter-2015-02-01_durand-jorge-g.md b/src/content/publications/chapter-2015-02-01_durand-jorge-g.md index 53d0c58..59b7187 100644 --- a/src/content/publications/chapter-2015-02-01_durand-jorge-g.md +++ b/src/content/publications/chapter-2015-02-01_durand-jorge-g.md @@ -7,5 +7,6 @@ citation: > tesis sobre el trabajo migrante temporal." In S. M. Lara Flores, J. Pantaleón, y M. J. Sánchez Gómez (coordinadores) 1a ed. Hacia el otro norte. Mexicanos en Canadá (pp. 175-205). Ciudad Autónoma de Buenos Aires: CLACSO, 2015. +feature: false pdf: /pubs/haciaelotronorte.pdf --- diff --git "a/src/content/publications/chapter-2015-03-02_torres-rebecca-mar\303\255a.md" "b/src/content/publications/chapter-2015-03-02_torres-rebecca-mar\303\255a.md" index c56699d..fd30877 100644 --- "a/src/content/publications/chapter-2015-03-02_torres-rebecca-mar\303\255a.md" +++ "b/src/content/publications/chapter-2015-03-02_torres-rebecca-mar\303\255a.md" @@ -7,5 +7,6 @@ citation: > Challenge to the Migration and Development Nexus." In A. Coles, L. Gray, and J. Momsen (Eds.), The Routledge Handbook of Gender and Development. Chapter 37 (pp. 365-373). +feature: false image: /pubs/handbook-gender-dev.jpeg --- diff --git a/src/content/publications/chapter-2015-05-05_massey-douglas-s-and-karen-a-pren.md b/src/content/publications/chapter-2015-05-05_massey-douglas-s-and-karen-a-pren.md index 5171b67..2051ef2 100644 --- a/src/content/publications/chapter-2015-05-05_massey-douglas-s-and-karen-a-pren.md +++ b/src/content/publications/chapter-2015-05-05_massey-douglas-s-and-karen-a-pren.md @@ -8,5 +8,6 @@ citation: > Acosta Arcarazo and Anja Wiesbrock, editors. Global Migration. Old Assumptions, New Dynamics Vol. 2, Chapter 1 (pp. 3-22). Santa Barbara, California: Praeger, 2015. +feature: false image: /pubs/global-migration.jpg --- diff --git a/src/content/publications/chapter-2015-07-07_massey-douglas-s.md b/src/content/publications/chapter-2015-07-07_massey-douglas-s.md index 27355f9..e7a308c 100644 --- a/src/content/publications/chapter-2015-07-07_massey-douglas-s.md +++ b/src/content/publications/chapter-2015-07-07_massey-douglas-s.md @@ -6,5 +6,6 @@ citation: > Massey, Douglas S. (2015). "Uninformed Policies and Reactionary Politics." In Christian Dustmann, editor. Migration: Economic Change, Social Challenge, Chapter 6 (pp. 118-137). Oxford University Press, 2015. +feature: false url: https://global.oup.com/academic/product/migration-9780198729624?cc=us&lang=en& --- diff --git "a/src/content/publications/chapter-2016-01-01_donato-katharine-m-and-gabriela-le\303\263n-p\303\251rez.md" "b/src/content/publications/chapter-2016-01-01_donato-katharine-m-and-gabriela-le\303\263n-p\303\251rez.md" index a65998e..d0b1c40 100644 --- "a/src/content/publications/chapter-2016-01-01_donato-katharine-m-and-gabriela-le\303\263n-p\303\251rez.md" +++ "b/src/content/publications/chapter-2016-01-01_donato-katharine-m-and-gabriela-le\303\263n-p\303\251rez.md" @@ -8,5 +8,6 @@ citation: 'Donato, Katharine M. and Gabriela León-Pérez. (2016). "Educación, Estudios comparados Colombia-América Latina - Proyecto LAMP, 1a edición, Capítulo 7, pp. 179-202. Colección: Ciencias Sociales - Sociología. Cali: Programa Editorial Universidad del Valle, 2016.' +feature: false image: /pubs/migration-international.jpg --- diff --git a/src/content/publications/chapter-2016-01-01_durand-jorge-and-karen-pren.md b/src/content/publications/chapter-2016-01-01_durand-jorge-and-karen-pren.md index d1df5aa..51935f6 100644 --- a/src/content/publications/chapter-2016-01-01_durand-jorge-and-karen-pren.md +++ b/src/content/publications/chapter-2016-01-01_durand-jorge-and-karen-pren.md @@ -8,4 +8,5 @@ citation: > Internacional: patrones y determinantes. Estudios comparados Colombia-América Latina - Proyecto LAMP, 1a edición, Capítulo 1, pp. 17-38. Colección: Ciencias Sociales - Sociología. Cali: Programa Editorial Universidad del Valle, 2016. +feature: false --- diff --git a/src/content/publications/chapter-2016-01-01_riosmena-fernando.md b/src/content/publications/chapter-2016-01-01_riosmena-fernando.md index 620be39..57efeed 100644 --- a/src/content/publications/chapter-2016-01-01_riosmena-fernando.md +++ b/src/content/publications/chapter-2016-01-01_riosmena-fernando.md @@ -9,4 +9,5 @@ citation: > comparados Colombia-América Latina - Proyecto LAMP, 1a edición, Capítulo 10, pp. 263-289. Colección: Ciencias Sociales - Sociología. Cali: Programa Editorial Universidad del Valle, 2016." +feature: false --- diff --git a/src/content/publications/chapter-2016-01-01_schmidt-kerstin.md b/src/content/publications/chapter-2016-01-01_schmidt-kerstin.md index 800c902..4f63142 100644 --- a/src/content/publications/chapter-2016-01-01_schmidt-kerstin.md +++ b/src/content/publications/chapter-2016-01-01_schmidt-kerstin.md @@ -7,4 +7,5 @@ citation: > Related to Climate Stressors: The Case of Mexico." In R. McLeman, J. Schade, and T. Faist (eds.) Environmental Migration and Social Inequality, part II, chapter 8 (pp. 117-128). Springer International Publishing, 2016 +feature: false --- diff --git "a/src/content/publications/chapter-2016-01-01_s\303\241nchez-soto-gabriela.md" "b/src/content/publications/chapter-2016-01-01_s\303\241nchez-soto-gabriela.md" index 214fa16..4585ba5 100644 --- "a/src/content/publications/chapter-2016-01-01_s\303\241nchez-soto-gabriela.md" +++ "b/src/content/publications/chapter-2016-01-01_s\303\241nchez-soto-gabriela.md" @@ -9,4 +9,5 @@ citation: > determinantes. Estudios comparados Colombia-América Latina - Proyecto LAMP, 1a edición, Capítulo 8, pp. 203-236. Colección: Ciencias Sociales - Sociología. Cali: Programa Editorial Universidad del Valle, 2016. +feature: false --- diff --git a/src/content/publications/dissertation-1995-01-01_department-of-economics-georgetown-university.md b/src/content/publications/dissertation-1995-01-01_department-of-economics-georgetown-university.md index 97152ec..cc5d853 100644 --- a/src/content/publications/dissertation-1995-01-01_department-of-economics-georgetown-university.md +++ b/src/content/publications/dissertation-1995-01-01_department-of-economics-georgetown-university.md @@ -3,6 +3,7 @@ classification: Dissertation author: Department of Economics, Georgetown University. pubDate: 1995-01-01 citation: >- - + "Mexican Labor Migration to the United States: Determinants, Labor Market Outcomes, and Dynamics." PhD. Dissertation, Department of Economics, Georgetown University. +feature: false --- From 8747e0e0df6ae38f904376e665c47e5b1e7c3f91 Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Mon, 15 Jul 2024 09:48:46 -0400 Subject: [PATCH 03/12] feat: add featured pubs section above search --- src/components/Publications.tsx | 108 +++++++++++++++++++++----------- 1 file changed, 70 insertions(+), 38 deletions(-) diff --git a/src/components/Publications.tsx b/src/components/Publications.tsx index 97f9721..9c3cd3b 100644 --- a/src/components/Publications.tsx +++ b/src/components/Publications.tsx @@ -20,12 +20,14 @@ const PublicationSection: React.FC = ({ publications }) => { ] as const const [searchInput, setSearchInput] = useState("") - const [classificationFilter, setClassificationFilter] = - useState>(classificationOptions) + const [classificationFilter, setClassificationFilter] = useState< + Readonly<{ value: Classification; label: string }[]> + >([]) const handleChange = (e: React.ChangeEvent) => { e.preventDefault() setSearchInput(e.target.value) } + const featuredPubs = publications.filter((pub) => pub.feature) const shownPubs = publications.filter( (pub) => @@ -34,7 +36,36 @@ const PublicationSection: React.FC = ({ publications }) => { ) return ( <> +
+

Featured Publications

+ {featuredPubs.map((publication, i) => { + return ( +
+
+ {publication.image ? ( + + ) : ( + + )} +
+ +
+

{publication.citation}

+ {publication.pdf && ( + + )} +
+
+ ) + })} +
+

All Publications

= ({ publications }) => { isMulti isSearchable={false} closeMenuOnSelect={false} - defaultValue={classificationOptions} styles={{ control: (baseStyles) => ({ ...baseStyles, @@ -75,43 +105,45 @@ const PublicationSection: React.FC = ({ publications }) => { {shownPubs && (
{classificationOptions.map((option) => { - return ( -
-

{option.label}

-
- {shownPubs.map((publication, i) => { - if (publication.classification === option.value) { - return ( -
-
- {publication.image ? ( - - ) : ( - - )} -
+ if (classificationFilter.find((e) => e.label === option.label)) { + return ( +
+

{option.label}

+
+ {shownPubs.map((publication, i) => { + if (publication.classification === option.value) { + return ( +
+
+ {publication.image ? ( + + ) : ( + + )} +
-
-

{publication.citation}

- {publication.pdf && ( - - )} +
+

{publication.citation}

+ {publication.pdf && ( + + )} +
-
- ) - } - })} -
-
- ) + ) + } + })} +
+
+ ) + } })}
)} From 27c016005d033298450a689e7de6f926e05242f8 Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Mon, 15 Jul 2024 10:05:51 -0400 Subject: [PATCH 04/12] feat: images only for books --- src/components/Publications.tsx | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/src/components/Publications.tsx b/src/components/Publications.tsx index 9c3cd3b..97e9e92 100644 --- a/src/components/Publications.tsx +++ b/src/components/Publications.tsx @@ -41,14 +41,6 @@ const PublicationSection: React.FC = ({ publications }) => { {featuredPubs.map((publication, i) => { return (
-
- {publication.image ? ( - - ) : ( - - )} -
-

{publication.citation}

{publication.pdf && ( @@ -114,16 +106,18 @@ const PublicationSection: React.FC = ({ publications }) => { if (publication.classification === option.value) { return (
-
- {publication.image ? ( - - ) : ( - - )} -
+ {option.label === "Books" && ( +
+ {publication.image ? ( + + ) : ( + + )} +
+ )}

{publication.citation}

From 88c7516b85aafe903d897cf5c70afca904ac59ca Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Mon, 15 Jul 2024 10:42:15 -0400 Subject: [PATCH 05/12] fix: type singlevalue --- src/components/Publications.tsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/Publications.tsx b/src/components/Publications.tsx index 97e9e92..4b2b4a8 100644 --- a/src/components/Publications.tsx +++ b/src/components/Publications.tsx @@ -1,5 +1,5 @@ import React, { useState } from "react" -import Select from "react-select" +import Select, { type SingleValue } from "react-select" import type { InferEntrySchema } from "astro:content" import type { Classification } from "../content/config.ts" import PubPlaceholder from "./svg/PubPlaceholder.tsx" @@ -21,8 +21,8 @@ const PublicationSection: React.FC = ({ publications }) => { const [searchInput, setSearchInput] = useState("") const [classificationFilter, setClassificationFilter] = useState< - Readonly<{ value: Classification; label: string }[]> - >([]) + SingleValue> + >({ value: "Book", label: "Books" }) const handleChange = (e: React.ChangeEvent) => { e.preventDefault() setSearchInput(e.target.value) @@ -31,7 +31,8 @@ const PublicationSection: React.FC = ({ publications }) => { const shownPubs = publications.filter( (pub) => - classificationFilter.map((item) => item.value).includes(pub.classification) && + classificationFilter && + classificationFilter.value.includes(pub.classification) && pub.citation.toLowerCase().includes(searchInput.toLowerCase()) ) return ( @@ -72,9 +73,9 @@ const PublicationSection: React.FC = ({ publications }) => { -
-
- - +
+
+ + -
-
- - + "cursor-pointer bg-white rounded-full shadow-inner min-w-60 w-max py-3 px-5", + placeholder: () => "cursor-pointer text-neutral-300", + indicatorsContainer: () => "cursor-pointer text-neutral-300 hover:bg-neutral-200", + multiValueRemove: () => "hover:bg-neutral-100", + valueContainer: () => "gap-2 cursor-pointer", + multiValue: () => + "cursor-pointer flex items-center gap-2 text-primary-500 bg-neutral-50 px-2 rounded-lg", + menu: () => "cursor-pointr rounded-lg bg-white p-2", + // See CSS file for other overrides + option: () => "rounded-sm p-1 hover:text-primary-500 hover:bg-neutral-50", + }} + styles={{ + control: (baseStyles) => ({ ...baseStyles, minHeight: 0 }), + option: (baseStyles) => ({ ...baseStyles, cursor: "pointer" }), + }} + onChange={(option) => setClassificationFilter(option)} + /> +
+ {pubsByYear && (
@@ -121,8 +130,8 @@ const PublicationSection: React.FC = ({ publications }) => { if (classificationFilter && classificationFilter.label === option.label) { return (
-

{option.label}

-
+

{option.label}

+
{pubsByYear.map((cat, i) => { return (
@@ -132,16 +141,14 @@ const PublicationSection: React.FC = ({ publications }) => {
{option.label === "Books" && ( -
+
{pub.image ? ( ) : ( @@ -151,14 +158,14 @@ const PublicationSection: React.FC = ({ publications }) => { )}
-

{pub.citation}

+

{pub.citation}

{pub.pdf && ( - + )}
From 2bf36f1adc069faf34242798b394e7182bc39fc1 Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Mon, 15 Jul 2024 12:36:20 -0400 Subject: [PATCH 08/12] styles: hierarchy between view pdf and citations --- src/components/Publications.tsx | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/components/Publications.tsx b/src/components/Publications.tsx index 61ea05a..aef7582 100644 --- a/src/components/Publications.tsx +++ b/src/components/Publications.tsx @@ -5,7 +5,7 @@ import { Form } from "@radix-ui/react-form" import { MagnifyingGlassIcon } from "@radix-ui/react-icons" import type { Classification } from "../content/config.ts" import PubPlaceholder from "./svg/PubPlaceholder.tsx" -import { CustomInput } from "./CustomInput.tsx" +import { Input } from "./Input.tsx" interface PubProps { publications: InferEntrySchema<"publications">[] @@ -80,7 +80,7 @@ const PublicationSection: React.FC = ({ publications }) => {
- } @@ -131,17 +131,17 @@ const PublicationSection: React.FC = ({ publications }) => { return (

{option.label}

-
+
{pubsByYear.map((cat, i) => { return ( -
-

{cat[0]}

+
+

{cat[0]}

{cat[1].map((pub) => { return (
{option.label === "Books" && ( @@ -157,15 +157,17 @@ const PublicationSection: React.FC = ({ publications }) => {
)} -
-

{pub.citation}

+
+

{pub.citation}

{pub.pdf && ( - - View PDF - + )}
From df4882429fa7ae3408675462abc4887cb3ae39b6 Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Mon, 15 Jul 2024 12:43:01 -0400 Subject: [PATCH 09/12] style: fix overflow of input on sm screen --- src/components/Publications.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Publications.tsx b/src/components/Publications.tsx index aef7582..98dd41c 100644 --- a/src/components/Publications.tsx +++ b/src/components/Publications.tsx @@ -78,7 +78,7 @@ const PublicationSection: React.FC = ({ publications }) => { ) })}
- +
= ({ publications }) => { placeholder="Durand, Jorge..." value={searchInput} onChange={handleChange} - className="min-w-96" + className="md:min-w-96" />
From 99fd58faf5c7d00006c84a74b899a197577104b5 Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Mon, 15 Jul 2024 12:45:33 -0400 Subject: [PATCH 10/12] chore: remove logs --- src/components/Publications.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/Publications.tsx b/src/components/Publications.tsx index 98dd41c..3f29c88 100644 --- a/src/components/Publications.tsx +++ b/src/components/Publications.tsx @@ -12,7 +12,6 @@ interface PubProps { } const PublicationSection: React.FC = ({ publications }) => { - //console.log(publications) const classificationOptions = [ { value: "Book", label: "Books" }, { @@ -41,7 +40,6 @@ const PublicationSection: React.FC = ({ publications }) => { classificationFilter.value.includes(pub.classification) && pub.citation.toLowerCase().includes(searchInput.toLowerCase()) ) - console.log(shownPubs) const categoryByYear: Record[]> = shownPubs.reduce( (pub, i) => { @@ -55,7 +53,7 @@ const PublicationSection: React.FC = ({ publications }) => { const pubsByYear = Object.entries(categoryByYear).sort( (a, b) => new Date(b[0]).getTime() - new Date(a[0]).getTime() ) - console.log(pubsByYear) + return ( <>
From 589f1277747ae32b9f61f4733690a04b09ee815a Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Mon, 15 Jul 2024 13:02:36 -0400 Subject: [PATCH 11/12] styles: close menu on select, grid featured --- src/components/Publications.tsx | 35 +++++++++++++++++---------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/components/Publications.tsx b/src/components/Publications.tsx index 3f29c88..8e4282c 100644 --- a/src/components/Publications.tsx +++ b/src/components/Publications.tsx @@ -58,23 +58,25 @@ const PublicationSection: React.FC = ({ publications }) => { <>

Featured Publications

- {featuredPubs.map((publication, i) => { - return ( -
-
-

{publication.citation}

- {publication.pdf && ( - - )} +
+ {featuredPubs.map((publication, i) => { + return ( +
+
+

{publication.citation}

+ {publication.pdf && ( + + )} +
-
- ) - })} + ) + })} +
@@ -96,7 +98,6 @@ const PublicationSection: React.FC = ({ publications }) => { id="classification" options={classificationOptions} isSearchable={false} - closeMenuOnSelect={false} defaultValue={classificationFilter} unstyled className="cursor-pointer" From 47093139c15ccedf9e4d63992d68896eb2ccfbd4 Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Mon, 15 Jul 2024 13:09:29 -0400 Subject: [PATCH 12/12] refactor: match View Pdf a tags --- src/components/Publications.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Publications.tsx b/src/components/Publications.tsx index 8e4282c..b3349df 100644 --- a/src/components/Publications.tsx +++ b/src/components/Publications.tsx @@ -65,12 +65,12 @@ const PublicationSection: React.FC = ({ publications }) => {

{publication.citation}

{publication.pdf && ( - + )}