diff --git a/.prettierrc b/.prettierrc index 377f844..8bf79ee 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,8 +1,8 @@ { "trailingComma": "es5", - "semi": true, + "semi": false, "tabWidth": 2, "singleQuote": true, "jsxSingleQuote": true, - "plugins": ["prettier-plugin-organize-imports"] + "plugins": ["prettier-plugin-organize-imports", "prettier-plugin-tailwindcss"] } diff --git a/next.config.mjs b/next.config.mjs index 4678774..1d61478 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,4 +1,4 @@ /** @type {import('next').NextConfig} */ -const nextConfig = {}; +const nextConfig = {} -export default nextConfig; +export default nextConfig diff --git a/package-lock.json b/package-lock.json index 4b46b24..ee2a799 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,6 @@ "next": "14.1.0", "next-mdx-remote": "^4.4.1", "next-themes": "^0.2.1", - "prettier": "^3.2.5", "prettier-plugin-organize-imports": "^3.2.4", "pretty-quick": "^4.0.0", "react": "^18", @@ -51,6 +50,8 @@ "eslint-config-next": "14.1.0", "husky": "^9.0.11", "postcss": "^8", + "prettier": "^3.2.5", + "prettier-plugin-tailwindcss": "^0.5.11", "tailwindcss": "^3.3.0", "typescript": "^5" } @@ -6486,6 +6487,75 @@ } } }, + "node_modules/prettier-plugin-tailwindcss": { + "version": "0.5.11", + "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.5.11.tgz", + "integrity": "sha512-AvI/DNyMctyyxGOjyePgi/gqj5hJYClZ1avtQvLlqMT3uDZkRbi4HhGUpok3DRzv9z7Lti85Kdj3s3/1CeNI0w==", + "dev": true, + "engines": { + "node": ">=14.21.3" + }, + "peerDependencies": { + "@ianvs/prettier-plugin-sort-imports": "*", + "@prettier/plugin-pug": "*", + "@shopify/prettier-plugin-liquid": "*", + "@trivago/prettier-plugin-sort-imports": "*", + "prettier": "^3.0", + "prettier-plugin-astro": "*", + "prettier-plugin-css-order": "*", + "prettier-plugin-import-sort": "*", + "prettier-plugin-jsdoc": "*", + "prettier-plugin-marko": "*", + "prettier-plugin-organize-attributes": "*", + "prettier-plugin-organize-imports": "*", + "prettier-plugin-style-order": "*", + "prettier-plugin-svelte": "*" + }, + "peerDependenciesMeta": { + "@ianvs/prettier-plugin-sort-imports": { + "optional": true + }, + "@prettier/plugin-pug": { + "optional": true + }, + "@shopify/prettier-plugin-liquid": { + "optional": true + }, + "@trivago/prettier-plugin-sort-imports": { + "optional": true + }, + "prettier-plugin-astro": { + "optional": true + }, + "prettier-plugin-css-order": { + "optional": true + }, + "prettier-plugin-import-sort": { + "optional": true + }, + "prettier-plugin-jsdoc": { + "optional": true + }, + "prettier-plugin-marko": { + "optional": true + }, + "prettier-plugin-organize-attributes": { + "optional": true + }, + "prettier-plugin-organize-imports": { + "optional": true + }, + "prettier-plugin-style-order": { + "optional": true + }, + "prettier-plugin-svelte": { + "optional": true + }, + "prettier-plugin-twig-melody": { + "optional": true + } + } + }, "node_modules/pretty-quick": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/pretty-quick/-/pretty-quick-4.0.0.tgz", diff --git a/package.json b/package.json index 600f3ee..f23e130 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ "next": "14.1.0", "next-mdx-remote": "^4.4.1", "next-themes": "^0.2.1", - "prettier": "^3.2.5", "prettier-plugin-organize-imports": "^3.2.4", "pretty-quick": "^4.0.0", "react": "^18", @@ -54,6 +53,8 @@ "eslint-config-next": "14.1.0", "husky": "^9.0.11", "postcss": "^8", + "prettier": "^3.2.5", + "prettier-plugin-tailwindcss": "^0.5.11", "tailwindcss": "^3.3.0", "typescript": "^5" } diff --git a/postcss.config.js b/postcss.config.js index 12a703d..33ad091 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -3,4 +3,4 @@ module.exports = { tailwindcss: {}, autoprefixer: {}, }, -}; +} diff --git a/src/app/analytics/page.tsx b/src/app/analytics/page.tsx index c454aa4..23057d7 100644 --- a/src/app/analytics/page.tsx +++ b/src/app/analytics/page.tsx @@ -1,22 +1,22 @@ -import AnalyticsDashboard from '@/components/AnalyticsDashboard'; -import { getDate } from '@/utils'; -import { analytics } from '@/utils/analytics'; +import AnalyticsDashboard from '@/components/AnalyticsDashboard' +import { getDate } from '@/utils' +import { analytics } from '@/utils/analytics' const Page = async () => { - const TRACKING_DAYS = 7; + const TRACKING_DAYS = 7 - const pageviews = await analytics.retrieveDays('pageview', TRACKING_DAYS); + const pageviews = await analytics.retrieveDays('pageview', TRACKING_DAYS) const totalPageviews = pageviews.reduce((acc, curr) => { return ( acc + curr.events.reduce((acc, curr) => { - return acc + Object.values(curr)[0]!; + return acc + Object.values(curr)[0]! }, 0) - ); - }, 0); + ) + }, 0) - const avgVisitorsPerDay = (totalPageviews / TRACKING_DAYS).toFixed(1); + const avgVisitorsPerDay = (totalPageviews / TRACKING_DAYS).toFixed(1) const amtVisitorsToday = pageviews .filter((ev) => ev.date === getDate()) @@ -24,31 +24,31 @@ const Page = async () => { return ( acc + curr.events.reduce((acc, curr) => acc + Object.values(curr)[0]!, 0) - ); - }, 0); + ) + }, 0) - const topCountriesMap = new Map(); + const topCountriesMap = new Map() for (let i = 0; i < pageviews.length; i++) { - const day = pageviews[i]; - if (!day) continue; + const day = pageviews[i] + if (!day) continue for (let j = 0; j < day.events.length; j++) { - const event = day.events[j]; - if (!event) continue; + const event = day.events[j] + if (!event) continue - const key = Object.keys(event)[0]!; - const value = Object.values(event)[0]!; + const key = Object.keys(event)[0]! + const value = Object.values(event)[0]! - const parsedKey = JSON.parse(key); - const country = parsedKey?.country; + const parsedKey = JSON.parse(key) + const country = parsedKey?.country if (country) { if (topCountriesMap.has(country)) { - const prevValue = topCountriesMap.get(country)!; - topCountriesMap.set(country, prevValue + value); + const prevValue = topCountriesMap.get(country)! + topCountriesMap.set(country, prevValue + value) } else { - topCountriesMap.set(country, value); + topCountriesMap.set(country, value) } } } @@ -56,14 +56,14 @@ const Page = async () => { const topCountries = [...topCountriesMap.entries()] .sort((a, b) => { - if (a[1] > b[1]) return -1; - else return 1; + if (a[1] > b[1]) return -1 + else return 1 }) - .slice(0, 5); + .slice(0, 5) return ( -
-
+
+
{ />
- ); -}; + ) +} -export default Page; +export default Page diff --git a/src/app/blog/[slug]/page.tsx b/src/app/blog/[slug]/page.tsx index 8b82d74..7476ad0 100644 --- a/src/app/blog/[slug]/page.tsx +++ b/src/app/blog/[slug]/page.tsx @@ -1,51 +1,51 @@ -import { MDX } from '@/components/markdown/mdx'; -import { Button } from '@/components/ui/button'; -import { getBlogPostByName, getSortedBlogPosts } from '@/lib/blog'; -import Link from 'next/link'; -import { notFound } from 'next/navigation'; +import { MDX } from '@/components/markdown/mdx' +import { Button } from '@/components/ui/button' +import { getBlogPostByName, getSortedBlogPosts } from '@/lib/blog' +import Link from 'next/link' +import { notFound } from 'next/navigation' const getBlogPost = async (slug: string) => { - const blogPost = await getBlogPostByName(slug); + const blogPost = await getBlogPostByName(slug) if (!blogPost) { - notFound(); + notFound() } - return blogPost; -}; + return blogPost +} export async function generateStaticParams() { - const blogPosts = await getSortedBlogPosts(); + const blogPosts = await getSortedBlogPosts() return blogPosts.map((post) => ({ slug: post.id, - })); + })) } export async function generateMetadata({ params, }: { - params: { slug: string }; + params: { slug: string } }) { - const blogPost = await getBlogPost(params.slug); + const blogPost = await getBlogPost(params.slug) return { title: blogPost.title, description: blogPost.description, keywords: blogPost.keywords, - }; + } } export default async function BlogPost({ params, }: { - params: { slug: string }; + params: { slug: string } }) { - const { markdown } = await getBlogPost(params.slug); + const { markdown } = await getBlogPost(params.slug) return (
-
- ); + ) } diff --git a/src/app/blog/page.tsx b/src/app/blog/page.tsx index 4114faa..752e19f 100644 --- a/src/app/blog/page.tsx +++ b/src/app/blog/page.tsx @@ -4,20 +4,20 @@ import { CardFooter, CardHeader, CardTitle, -} from '@/components/ui/card'; -import { getSortedBlogPosts } from '@/lib/blog'; -import Link from 'next/link'; +} from '@/components/ui/card' +import { getSortedBlogPosts } from '@/lib/blog' +import Link from 'next/link' export function generateMetadata() { return { title: 'Blog', description: '', keywords: [], - }; + } } export default async function Blogs() { - const blogPosts = await getSortedBlogPosts(); + const blogPosts = await getSortedBlogPosts() return ( <>
    @@ -36,5 +36,5 @@ export default async function Blogs() { ))}
- ); + ) } diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 09ca525..ce697bd 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,22 +1,22 @@ -import Footer from '@/components/Footer'; -import { Header } from '@/components/Header'; -import { ThemeProvider } from '@/components/theme/theme-provider'; -import { cn } from '@/lib/utils'; -import type { Metadata } from 'next'; -import { Space_Grotesk } from 'next/font/google'; -import './globals.css'; +import Footer from '@/components/Footer' +import { Header } from '@/components/Header' +import { ThemeProvider } from '@/components/theme/theme-provider' +import { cn } from '@/lib/utils' +import type { Metadata } from 'next' +import { Space_Grotesk } from 'next/font/google' +import './globals.css' -const spaceGrotesk = Space_Grotesk({ subsets: ['latin'] }); +const spaceGrotesk = Space_Grotesk({ subsets: ['latin'] }) export const metadata: Metadata = { title: 'Create Next App', description: 'Generated by create next app', -}; +} export default function RootLayout({ children, }: Readonly<{ - children: React.ReactNode; + children: React.ReactNode }>) { return ( @@ -34,5 +34,5 @@ export default function RootLayout({ - ); + ) } diff --git a/src/app/page.tsx b/src/app/page.tsx index 5628183..fb66508 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,5 +1,5 @@ -import { Body } from '@/components/Body'; +import { Body } from '@/components/Body' export default function Home() { - return ; + return } diff --git a/src/app/projects/page.tsx b/src/app/projects/page.tsx index 814e2de..431e3bd 100644 --- a/src/app/projects/page.tsx +++ b/src/app/projects/page.tsx @@ -1,11 +1,11 @@ -'use client'; +'use client' -import { ComboBox } from '@/components/Combobox'; -import { Button } from '@/components/ui/button'; -import { Input } from '@/components/ui/input'; -import { useProjects } from '@/hooks'; -import { ProjectStatus, ProjectTags } from '@/types'; -import { useEffect } from 'react'; +import { ComboBox } from '@/components/Combobox' +import { Button } from '@/components/ui/button' +import { Input } from '@/components/ui/input' +import { useProjects } from '@/hooks' +import { ProjectStatus, ProjectTags } from '@/types' +import { useEffect } from 'react' export default function Categories() { const { @@ -16,28 +16,28 @@ export default function Categories() { setTagFilter, setStatusFilter, resetFilter, - } = useProjects(); + } = useProjects() const tagValues = Object.values(ProjectTags).map((tag) => ({ value: tag.toLowerCase(), label: tag, - })); + })) const statusValues = Object.values(ProjectStatus).map((status) => ({ value: status.toLowerCase(), label: status, - })); + })) useEffect(() => { return () => { - resetFilter(); - }; - }, [resetFilter]); + resetFilter() + } + }, [resetFilter]) return (
{filter.tag} -
+
Discover SEI's most innovating projects -
+
Search through our leading platform to find new innovations in this fast growing ecosystem
@@ -62,7 +62,7 @@ export default function Categories() { selectPlaceHolder='Select Status...' searchPlaceHolder='Search Status...' > -
+
{filteredProjects.map((project, index) => (
- ); + ) } diff --git a/src/components/AnalyticsDashboard.tsx b/src/components/AnalyticsDashboard.tsx index 5cc159a..16edd4d 100644 --- a/src/components/AnalyticsDashboard.tsx +++ b/src/components/AnalyticsDashboard.tsx @@ -1,31 +1,31 @@ -'use client'; +'use client' -import { analytics } from '@/utils/analytics'; -import { BarChart, Card } from '@tremor/react'; -import { ArrowDownRight, ArrowRight, ArrowUpRight } from 'lucide-react'; -import ReactCountryFlag from 'react-country-flag'; +import { analytics } from '@/utils/analytics' +import { BarChart, Card } from '@tremor/react' +import { ArrowDownRight, ArrowRight, ArrowUpRight } from 'lucide-react' +import ReactCountryFlag from 'react-country-flag' interface AnalyticsDashboardProps { - avgVisitorsPerDay: string; - amtVisitorsToday: number; - timeseriesPageviews: Awaited>; - topCountries: [string, number][]; + avgVisitorsPerDay: string + amtVisitorsToday: number + timeseriesPageviews: Awaited> + topCountries: [string, number][] } const Badge = ({ percentage }: { percentage: number }) => { - const isPositive = percentage > 0; - const isNeutral = percentage === 0; - const isNegative = percentage < 0; + const isPositive = percentage > 0 + const isNeutral = percentage === 0 + const isNegative = percentage < 0 - if (isNaN(percentage)) return null; + if (isNaN(percentage)) return null - const positiveClassname = 'bg-green-900/25 text-green-400 ring-green-400/25'; - const neutralClassname = 'bg-zinc-900/25 text-zinc-400 ring-zinc-400/25'; - const negativeClassname = 'bg-red-900/25 text-red-400 ring-red-400/25'; + const positiveClassname = 'bg-green-900/25 text-green-400 ring-green-400/25' + const neutralClassname = 'bg-zinc-900/25 text-zinc-400 ring-zinc-400/25' + const negativeClassname = 'bg-red-900/25 text-red-400 ring-red-400/25' return ( { {isNegative ? : null} {percentage.toFixed(0)}% - ); -}; + ) +} const AnalyticsDashboard = ({ avgVisitorsPerDay, @@ -49,17 +49,17 @@ const AnalyticsDashboard = ({ }: AnalyticsDashboardProps) => { return (
-
+

Avg. visitors/day

-

+

{avgVisitorsPerDay}

-

+

Visitors today

-

+

{amtVisitorsToday}

- -

+ +

This weeks top visitors:

-
+
{topCountries?.map(([countryCode, number]) => { return (
-

+

{countryCode}

- ); + ) })}
@@ -110,7 +110,7 @@ const AnalyticsDashboard = ({ data={timeseriesPageviews.map((day) => ({ name: day.date, Visitors: day.events.reduce((acc, curr) => { - return acc + Object.values(curr)[0]!; + return acc + Object.values(curr)[0]! }, 0), }))} categories={['Visitors']} @@ -119,7 +119,7 @@ const AnalyticsDashboard = ({ ) : null}
- ); -}; + ) +} -export default AnalyticsDashboard; +export default AnalyticsDashboard diff --git a/src/components/Body.tsx b/src/components/Body.tsx index c17ca9e..ec49dbf 100644 --- a/src/components/Body.tsx +++ b/src/components/Body.tsx @@ -1,23 +1,23 @@ -import { Paintbrush2Icon } from 'lucide-react'; -import ImageSlider from './ImageSlider'; -import CardComponent from './ProjectCard'; -import { Avatar, AvatarFallback, AvatarImage } from './ui/avatar'; -import { Button } from './ui/button'; +import { Paintbrush2Icon } from 'lucide-react' +import ImageSlider from './ImageSlider' +import CardComponent from './ProjectCard' +import { Avatar, AvatarFallback, AvatarImage } from './ui/avatar' +import { Button } from './ui/button' export const Body = () => { return (
-
-
+
+
-
+
@@ -39,66 +39,66 @@ export const Body = () => {
-
+
-
-
+
+
-
+

124k

Artworks

-
-
-
-
+
+
+
-
+

24k

Sales

-
-
-
-
+
+
+
-
+

94k

Colections

-
-
-
-
+
+
+
-
+

164

Projects

-
@@ -106,8 +106,8 @@ export const Body = () => {
-
-

Highlights

+
+

Highlights

{ buttonLabel='View' /> -
-

Discover

+
+

Discover

- ); -}; + ) +} diff --git a/src/components/Combobox.tsx b/src/components/Combobox.tsx index 2086cfd..42feb85 100644 --- a/src/components/Combobox.tsx +++ b/src/components/Combobox.tsx @@ -1,4 +1,4 @@ -'use client'; +'use client' import { Command, @@ -6,27 +6,27 @@ import { CommandGroup, CommandInput, CommandItem, -} from '@/components/ui/command'; +} from '@/components/ui/command' import { Popover, PopoverContent, PopoverTrigger, -} from '@/components/ui/popover'; +} from '@/components/ui/popover' -import { Button } from '@/components/ui/button'; -import { cn } from '@/lib/utils'; -import { Check, ChevronsUpDown } from 'lucide-react'; -import { useState } from 'react'; +import { Button } from '@/components/ui/button' +import { cn } from '@/lib/utils' +import { Check, ChevronsUpDown } from 'lucide-react' +import { useState } from 'react' interface ComboBoxProps { items: { - value: string; - label: T; - }[]; - value: T | null; - setValue: (value: T | null) => void; - selectPlaceHolder: string; - searchPlaceHolder: string; + value: string + label: T + }[] + value: T | null + setValue: (value: T | null) => void + selectPlaceHolder: string + searchPlaceHolder: string } export const ComboBox = ({ items, @@ -35,7 +35,7 @@ export const ComboBox = ({ selectPlaceHolder, searchPlaceHolder, }: ComboBoxProps) => { - const [open, setOpen] = useState(false); + const [open, setOpen] = useState(false) return ( @@ -66,8 +66,8 @@ export const ComboBox = ({ onSelect={() => { setValue( items[index]?.label === value ? null : items[index]!.label - ); - setOpen(false); + ) + setOpen(false) }} > ({ - ); -}; + ) +} diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index bb2d6c1..3e15d6d 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -1,29 +1,29 @@ -'use client'; +'use client' -import React from 'react'; +import React from 'react' const Footer: React.FC = () => { return ( -