-
Research Projects
+
+ Research Projects
+
{projects.length > 0 ? (
{projects.map((project) => (
-
+
-
{project.description}
+
+ {project.description}
+
{isLoggedIn ? (
applications[project.id] ? (
-
Status: {applications[project.id]}
+
+ Status: {applications[project.id]}
+
) : (
-
applyForProject(project.id)}
>
Apply
@@ -122,12 +145,16 @@ const ResearchProjects = () => {
Sign in to apply
)}
- {errorMessages[project.id] && {errorMessages[project.id]}
}
+ {errorMessages[project.id] && (
+
+ {errorMessages[project.id]}
+
+ )}
))}
) : (
-
Working on it...
+
)}
);
diff --git a/lib/utils.js b/lib/utils.js
new file mode 100644
index 0000000..abc308d
--- /dev/null
+++ b/lib/utils.js
@@ -0,0 +1,6 @@
+import { ClassValue, clsx } from "clsx";
+import { twMerge } from "tailwind-merge";
+
+export function cn(...inputs) {
+ return twMerge(clsx(inputs));
+}
diff --git a/package-lock.json b/package-lock.json
index 40ddacc..75c3163 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -22,8 +22,9 @@
"@tippyjs/react": "^4.2.6",
"@vercel/analytics": "^1.2.2",
"@vercel/speed-insights": "^1.0.10",
+ "clsx": "^2.1.1",
"date-fns": "^3.6.0",
- "framer-motion": "^11.2.10",
+ "framer-motion": "^11.3.27",
"moment": "^2.30.1",
"next": "14.2.2",
"react": "^18.3.1",
@@ -40,6 +41,7 @@
"sharp": "^0.33.3",
"slick-carousel": "^1.8.1",
"swiper": "^11.1.1",
+ "tailwind-merge": "^2.5.2",
"tippy.js": "^6.3.7"
},
"devDependencies": {
@@ -2209,9 +2211,9 @@
}
},
"node_modules/framer-motion": {
- "version": "11.2.10",
- "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.2.10.tgz",
- "integrity": "sha512-/gr3PLZUVFCc86a9MqCUboVrALscrdluzTb3yew+2/qKBU8CX6nzs918/SRBRCqaPbx0TZP10CB6yFgK2C5cYQ==",
+ "version": "11.3.27",
+ "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.3.27.tgz",
+ "integrity": "sha512-Uf72PFEZuei/1IeCmGJ236EIl6VUri7SLovtTGg/cOAzMHG01CXXg1aL3ofuTuYr6Sq1QALlcEDaTig0PXb4Dw==",
"dependencies": {
"tslib": "^2.4.0"
},
@@ -3814,6 +3816,15 @@
"resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.2.0.tgz",
"integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew=="
},
+ "node_modules/tailwind-merge": {
+ "version": "2.5.2",
+ "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.5.2.tgz",
+ "integrity": "sha512-kjEBm+pvD+6eAwzJL2Bi+02/9LFLal1Gs61+QB7HvTfQQ0aXwC5LGT8PEt1gS0CWKktKe6ysPTAy3cBC5MeiIg==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/dcastil"
+ }
+ },
"node_modules/tailwindcss": {
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.3.tgz",
diff --git a/package.json b/package.json
index 98970be..32579d5 100644
--- a/package.json
+++ b/package.json
@@ -24,8 +24,9 @@
"@tippyjs/react": "^4.2.6",
"@vercel/analytics": "^1.2.2",
"@vercel/speed-insights": "^1.0.10",
+ "clsx": "^2.1.1",
"date-fns": "^3.6.0",
- "framer-motion": "^11.2.10",
+ "framer-motion": "^11.3.27",
"moment": "^2.30.1",
"next": "14.2.2",
"react": "^18.3.1",
@@ -42,6 +43,7 @@
"sharp": "^0.33.3",
"slick-carousel": "^1.8.1",
"swiper": "^11.1.1",
+ "tailwind-merge": "^2.5.2",
"tippy.js": "^6.3.7"
},
"devDependencies": {
diff --git a/tailwind.config.js b/tailwind.config.js
index b11cf0e..a03be69 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -1,3 +1,9 @@
+const defaultTheme = require("tailwindcss/defaultTheme");
+const colors = require("tailwindcss/colors");
+const {
+ default: flattenColorPalette,
+} = require("tailwindcss/lib/util/flattenColorPalette");
+
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
@@ -13,25 +19,37 @@ module.exports = {
"conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
},
maxWidth: {
- '1440': '1440px'
+ 1440: "1440px",
},
colors: {
- 'cpink': '#FE93B1',
- 'cpinklight': '#FE93B1',
- 'cream': '#F9F4F0',
+ cpink: "#FE93B1",
+ cpinklight: "#FE93B1",
+ cream: "#F9F4F0",
},
keyframes: {
- 'border-spin': {
- '100%': { transform: 'rotate(-360deg)' }
- }
+ "border-spin": {
+ "100%": { transform: "rotate(-360deg)" },
+ },
},
animation: {
- 'border-spin': 'border-spin 4s linear infinite',
- }
+ "border-spin": "border-spin 4s linear infinite",
+ },
},
fontFamily: {
jost: ["Jost", "system-ui", "sans-serif"],
},
},
- plugins: [],
+ plugins: [addVariablesForColors],
};
+
+// This plugin adds each Tailwind color as a global CSS variable, e.g. var(--gray-200).
+function addVariablesForColors({ addBase, theme }) {
+ let allColors = flattenColorPalette(theme("colors"));
+ let newVars = Object.fromEntries(
+ Object.entries(allColors).map(([key, val]) => [`--${key}`, val])
+ );
+
+ addBase({
+ ":root": newVars,
+ });
+}