From 45a7dcb39a07d557c1a7deba5028efc14c252c4a Mon Sep 17 00:00:00 2001 From: galenwinsor Date: Thu, 8 Aug 2024 10:23:56 -0400 Subject: [PATCH 1/3] chore: add tailwind prettier plugin --- .prettierrc | 2 +- package-lock.json | 27 +- package.json | 3 +- src/components/ActivityPage.tsx | 2 +- src/components/ActivityTable.tsx | 10 +- src/components/Card.tsx | 6 +- src/components/DataForm.tsx | 2 +- src/components/DataTable.tsx | 10 +- src/components/HeaderLink.astro | 2 +- src/components/Input.tsx | 4 +- src/components/Login.tsx | 2 +- src/components/Publications.tsx | 14 +- src/components/Textarea.tsx | 4 +- src/content/news/first-post.md | 8 +- src/content/news/markdown-style-guide.md | 49 ++-- src/content/news/second-post.md | 8 +- src/content/news/third-post.md | 8 +- src/content/news/using-mdx.mdx | 10 +- src/content/pages/data.md | 2 +- src/content/pages/documentation.md | 2 +- src/content/pages/home.md | 1 - src/content/pages/study-design.md | 1 - src/firebase-config.json | 2 +- src/styles/global.css | 304 +++++++++++------------ 24 files changed, 254 insertions(+), 229 deletions(-) diff --git a/.prettierrc b/.prettierrc index b18bf8a..79047be 100644 --- a/.prettierrc +++ b/.prettierrc @@ -5,7 +5,7 @@ "singleQuote": false, "tabWidth": 2, "trailingComma": "es5", - "plugins": ["prettier-plugin-astro"], + "plugins": ["prettier-plugin-astro", "prettier-plugin-tailwind-css"], "overrides": [ { "files": "*.astro", diff --git a/package-lock.json b/package-lock.json index 13a302d..a727e4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,7 +38,8 @@ "eslint": "^8.56.0", "eslint-plugin-astro": "^0.31.4", "prettier": "^3.2.5", - "prettier-plugin-astro": "^0.13.0" + "prettier-plugin-astro": "^0.13.0", + "prettier-plugin-tailwind-css": "^1.5.0" } }, "node_modules/@alloc/quick-lru": { @@ -14867,6 +14868,30 @@ "integrity": "sha512-o/ObKgtMzl8SlpIdzaxFnt7SATKPxu4oIP/1NL+HDJRzxfJcAkOTAb/ZKMRyULbz4q+1t2/DAebs2Z1QairkZw==", "devOptional": true }, + "node_modules/prettier-plugin-tailwind-css": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/prettier-plugin-tailwind-css/-/prettier-plugin-tailwind-css-1.5.0.tgz", + "integrity": "sha512-LUbINk8O0l+r7iPO6fUOQtoZdF7lQ0SGZTrlAl6IjW8zc5URMGqdW2QVoIK2de2HQeKvb9X2xv8aUzf+v2UVYw==", + "dev": true, + "dependencies": { + "prettier": "^2.0.5" + } + }, + "node_modules/prettier-plugin-tailwind-css/node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/prismjs": { "version": "1.29.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", diff --git a/package.json b/package.json index 0164f15..1e95510 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "eslint": "^8.56.0", "eslint-plugin-astro": "^0.31.4", "prettier": "^3.2.5", - "prettier-plugin-astro": "^0.13.0" + "prettier-plugin-astro": "^0.13.0", + "prettier-plugin-tailwind-css": "^1.5.0" } } diff --git a/src/components/ActivityPage.tsx b/src/components/ActivityPage.tsx index 8e244b9..7cca99e 100644 --- a/src/components/ActivityPage.tsx +++ b/src/components/ActivityPage.tsx @@ -24,7 +24,7 @@ const ActivityPage = () => { {user && activityData && (

- {activityData.length} download(s) + {activityData.length} download(s)

diff --git a/src/components/ActivityTable.tsx b/src/components/ActivityTable.tsx index 363de19..b93351b 100644 --- a/src/components/ActivityTable.tsx +++ b/src/components/ActivityTable.tsx @@ -7,10 +7,10 @@ export interface ActivityTableProps { const ActivityTable: React.FC = ({ data }) => { return ( -
- +
+
- + @@ -28,8 +28,8 @@ const ActivityTable: React.FC = ({ data }) => {
Description User Download Date
-

{name}

-

+

{name}

+

{email}

{institution}

diff --git a/src/components/Card.tsx b/src/components/Card.tsx index b3b230e..d9ce65f 100644 --- a/src/components/Card.tsx +++ b/src/components/Card.tsx @@ -14,11 +14,11 @@ const Card: React.FC = ({ link, image, title, name, institution, bio // strip 'public/' from the avatar string since astro's public folder is available without this in the link const imageURL = image?.replace("/public", "") return ( -
+
{image && (
{name} @@ -27,7 +27,7 @@ const Card: React.FC = ({ link, image, title, name, institution, bio
diff --git a/src/components/DataForm.tsx b/src/components/DataForm.tsx index eaaa7ea..ffa3aa6 100644 --- a/src/components/DataForm.tsx +++ b/src/components/DataForm.tsx @@ -23,7 +23,7 @@ const DataForm = () => { return ( = ({ allFiles, updateFileList }) => { handleSelect(selected, i)} > @@ -71,15 +71,15 @@ const DataTable: React.FC = ({ allFiles, updateFileList }) => { }) return ( -
- +
+
- +
diff --git a/src/components/HeaderLink.astro b/src/components/HeaderLink.astro index 4f8e1f8..b9d11b0 100644 --- a/src/components/HeaderLink.astro +++ b/src/components/HeaderLink.astro @@ -15,7 +15,7 @@ const isActive = href === pathname || href === "/" + subpath?.[0] class:list={[ className, "hover:underline underline-offset-8", - isActive ? "text-neutral-900 font-semibold underline" : "no-underline", + isActive ? "text-neutral-900 font-semibold underline" : "no-underline", ]} {...props} > diff --git a/src/components/Input.tsx b/src/components/Input.tsx index 1e097b5..3a8d66c 100644 --- a/src/components/Input.tsx +++ b/src/components/Input.tsx @@ -14,14 +14,14 @@ export const Input = React.forwardRef( return ( {label} -
+
{icon && {icon}}
- + Please enter your {label} {match !== undefined && ( diff --git a/src/components/Login.tsx b/src/components/Login.tsx index 1bff73a..859b9fb 100644 --- a/src/components/Login.tsx +++ b/src/components/Login.tsx @@ -34,7 +34,7 @@ const Login: React.FC = ({ currentUser, setUserFunction }) => { )}
- {message &&

{message}

} + {message &&

{message}

} ) } diff --git a/src/components/Publications.tsx b/src/components/Publications.tsx index b3349df..b36c864 100644 --- a/src/components/Publications.tsx +++ b/src/components/Publications.tsx @@ -58,7 +58,7 @@ const PublicationSection: React.FC = ({ publications }) => { <>

Featured Publications

-
+
{featuredPubs.map((publication, i) => { return (
@@ -66,7 +66,7 @@ const PublicationSection: React.FC = ({ publications }) => {

{publication.citation}

{publication.pdf && ( View PDF @@ -78,12 +78,12 @@ const PublicationSection: React.FC = ({ publications }) => { })}
-
+
} + icon={} placeholder="Durand, Jorge..." value={searchInput} onChange={handleChange} @@ -144,10 +144,10 @@ const PublicationSection: React.FC = ({ publications }) => { } > {option.label === "Books" && ( -
+
{pub.image ? ( ) : ( @@ -161,7 +161,7 @@ const PublicationSection: React.FC = ({ publications }) => { {pub.pdf && (
View PDF diff --git a/src/components/Textarea.tsx b/src/components/Textarea.tsx index 2ead700..cb532ae 100644 --- a/src/components/Textarea.tsx +++ b/src/components/Textarea.tsx @@ -14,14 +14,14 @@ export const Textarea = React.forwardRef( return ( {label} - + {characterCount}/{maxLength}