-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from brown-ccv/pubs-page
feat: init pubs page
- Loading branch information
Showing
42 changed files
with
457 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
import React, { useState } from "react" | ||
import Select from "react-select" | ||
import type { InferEntrySchema } from "astro:content" | ||
import type { Classification } from "../content/config.ts" | ||
import PubPlaceholder from "./svg/PubPlaceholder.tsx" | ||
|
||
interface PubProps { | ||
publications: InferEntrySchema<"publications">[] | ||
} | ||
|
||
const PublicationSection: React.FC<PubProps> = ({ publications }) => { | ||
const classificationOptions = [ | ||
{ value: "Book", label: "Books" }, | ||
{ | ||
value: "Article", | ||
label: "Articles", | ||
}, | ||
{ value: "Dissertation", label: "Dissertations" }, | ||
{ value: "Chapter", label: "Chapters" }, | ||
] as const | ||
|
||
const [searchInput, setSearchInput] = useState("") | ||
const [classificationFilter, setClassificationFilter] = | ||
useState<Readonly<{ value: Classification; label: string }[]>>(classificationOptions) | ||
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => { | ||
e.preventDefault() | ||
setSearchInput(e.target.value) | ||
} | ||
|
||
const shownPubs = publications.filter( | ||
(pub) => | ||
classificationFilter.map((item) => item.value).includes(pub.classification) && | ||
pub.citation.toLowerCase().includes(searchInput.toLowerCase()) | ||
) | ||
return ( | ||
<> | ||
<section className="flex flex-col lg:flex-row gap-4 py-14"> | ||
<div> | ||
<label className="pl-1">Search for a Publication</label> | ||
<input | ||
type="text" | ||
placeholder="🔍 Search here" | ||
onChange={handleChange} | ||
value={searchInput} | ||
className="min-w-[460px]" | ||
/> | ||
</div> | ||
<div> | ||
<label className="pl-1">Show</label> | ||
<Select | ||
options={classificationOptions} | ||
isMulti | ||
isSearchable={false} | ||
closeMenuOnSelect={false} | ||
defaultValue={classificationOptions} | ||
styles={{ | ||
control: (baseStyles) => ({ | ||
...baseStyles, | ||
minWidth: "526px", | ||
borderRadius: "9999px", | ||
background: "#FAFAFA", | ||
boxShadow: | ||
"var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)", | ||
paddingTop: ".75rem", | ||
paddingBottom: ".75rem", | ||
paddingLeft: "2rem", | ||
paddingRight: "2rem", | ||
}), | ||
}} | ||
onChange={(option) => setClassificationFilter(option)} | ||
/> | ||
</div> | ||
</section> | ||
|
||
{shownPubs && ( | ||
<section className="flex flex-col gap-6"> | ||
{classificationOptions.map((option) => { | ||
return ( | ||
<article key={option.value}> | ||
<h2 className="py-2">{option.label}</h2> | ||
<div className="grid grid-cols-1 lg:grid-cols-2 gap-12"> | ||
{shownPubs.map((publication, i) => { | ||
if (publication.classification === option.value) { | ||
return ( | ||
<div key={i} className="grid grid-cols-1 md:grid-cols-2 gap-2"> | ||
<div className="hidden md:block drop-shadow-md"> | ||
{publication.image ? ( | ||
<img | ||
className="drop-shadow-md object-cover w-48 h-72" | ||
src={publication.image} | ||
/> | ||
) : ( | ||
<PubPlaceholder /> | ||
)} | ||
</div> | ||
|
||
<div className="flex flex-col gap-8 "> | ||
<p>{publication.citation}</p> | ||
{publication.pdf && ( | ||
<button | ||
className="bg-neutral-500 text-neutral-50 rounded-full py-3 px-7 w-2/3" | ||
onClick={() => window.open(`${publication.pdf}`, "_blank")} | ||
> | ||
View PDF | ||
</button> | ||
)} | ||
</div> | ||
</div> | ||
) | ||
} | ||
})} | ||
</div> | ||
</article> | ||
) | ||
})} | ||
</section> | ||
)} | ||
</> | ||
) | ||
} | ||
|
||
export default PublicationSection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import React from "react" | ||
|
||
const PubPlaceholder: React.FC = () => { | ||
return ( | ||
<> | ||
<svg | ||
width="232" | ||
height="342" | ||
viewBox="0 0 232 342" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<g filter="url(#filter0_dd_313_544)"> | ||
<rect width="200" height="310" transform="translate(12 12)" fill="#A7998B" /> | ||
<rect width="143" height="30" transform="translate(29 32)" fill="#D4CDC4" /> | ||
<rect width="143" height="12" transform="translate(29 72)" fill="#D4CDC4" /> | ||
<rect width="143" height="12" transform="translate(29 94)" fill="#D4CDC4" /> | ||
</g> | ||
<defs> | ||
<filter | ||
id="filter0_dd_313_544" | ||
x="0" | ||
y="0" | ||
width="232" | ||
height="342" | ||
filterUnits="userSpaceOnUse" | ||
color-interpolation-filters="sRGB" | ||
> | ||
<feFlood flood-opacity="0" result="BackgroundImageFix" /> | ||
<feColorMatrix | ||
in="SourceAlpha" | ||
type="matrix" | ||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" | ||
result="hardAlpha" | ||
/> | ||
<feOffset dx="12" dy="12" /> | ||
<feGaussianBlur stdDeviation="2" /> | ||
<feComposite in2="hardAlpha" operator="out" /> | ||
<feColorMatrix | ||
type="matrix" | ||
values="0 0 0 0 0.654902 0 0 0 0 0.6 0 0 0 0 0.545098 0 0 0 0.35 0" | ||
/> | ||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_313_544" /> | ||
<feColorMatrix | ||
in="SourceAlpha" | ||
type="matrix" | ||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" | ||
result="hardAlpha" | ||
/> | ||
<feMorphology | ||
radius="4" | ||
operator="dilate" | ||
in="SourceAlpha" | ||
result="effect2_dropShadow_313_544" | ||
/> | ||
<feOffset dx="4" dy="4" /> | ||
<feGaussianBlur stdDeviation="6" /> | ||
<feComposite in2="hardAlpha" operator="out" /> | ||
<feColorMatrix | ||
type="matrix" | ||
values="0 0 0 0 0.654902 0 0 0 0 0.6 0 0 0 0 0.545098 0 0 0 0.35 0" | ||
/> | ||
<feBlend | ||
mode="normal" | ||
in2="effect1_dropShadow_313_544" | ||
result="effect2_dropShadow_313_544" | ||
/> | ||
<feBlend | ||
mode="normal" | ||
in="SourceGraphic" | ||
in2="effect2_dropShadow_313_544" | ||
result="shape" | ||
/> | ||
</filter> | ||
</defs> | ||
</svg> | ||
</> | ||
) | ||
} | ||
|
||
export default PubPlaceholder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
--- | ||
type: Leadership | ||
type: Advisors | ||
name: David Lindstrom | ||
title: Advisor | ||
avatar: /public/images/david-lindstrom-1-.jpg | ||
institution: Brown University | ||
org: Brown University | ||
startDate: "2024" | ||
endDate: "2024" | ||
--- |
8 changes: 8 additions & 0 deletions
8
src/content/publications/article-2021-09-01_rodilitz-scott-and-edward-h-kaplan.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
classification: Article | ||
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' | ||
url: https://pubmed.ncbi.nlm.nih.gov/33373472/ | ||
--- |
10 changes: 10 additions & 0 deletions
10
...0-01-01_donato-katharine-m-jonathan-hiskey-jorge-durand-and-douglas-s-massey.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
classification: Book | ||
author: Donato, Katharine M., Jonathan Hiskey, Jorge Durand, and Douglas S. Massey. | ||
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. | ||
image: /pubs/salvando_fronteras.jpg | ||
pdf: /pubs/donato_hiskey_durand_massey_2010-salvando-fronteras.pdf | ||
--- |
Oops, something went wrong.