diff --git a/.env.example b/.env.example deleted file mode 100644 index 23a838c..0000000 --- a/.env.example +++ /dev/null @@ -1,2 +0,0 @@ -NEXT_PUBLIC_API_URL= -NEXT_PUBLIC_MAILCHIMP_URL= \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 73133b5..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,53 +0,0 @@ -module.exports = { - extends: ['next', 'next/core-web-vitals', 'airbnb', 'airbnb-typescript'], - plugins: ['@typescript-eslint', 'simple-import-sort'], - overrides: [ - { - files: ['*.ts', '*.tsx'], // Your TypeScript files extension - parserOptions: { - tsconfigRootDir: __dirname, - project: ['./tsconfig.json'], // Specify it only for TypeScript files - }, - }, - ], - rules: { - 'no-restricted-imports': ['error', '@mui/material'], // Enforce tree shaking - 'no-console': 'off', - '@typescript-eslint/comma-dangle': 'off', - 'import/newline-after-import': ['error', { count: 1 }], - 'object-curly-newline': 'off', - 'react/react-in-jsx-scope': 'off', - 'react/jsx-props-no-spreading': 'off', - 'import/no-extraneous-dependencies': 'off', - 'react/prop-types': 'off', - 'implicit-arrow-linebreak': 0, - 'function-paren-newline': 0, - '@typescript-eslint/no-unused-vars': 1, - 'no-confusing-arrow': 0, - 'operator-linebreak': 0, - 'arrow-body-style': 0, - 'react/no-unescaped-entities': 0, - 'react/require-default-props': 0, - 'react/no-unused-prop-types': 0, - 'simple-import-sort/imports': [ - 'error', - { - groups: [ - // Packages `react` related packages come first. - ['^react'], - // MUI imports - ['^(@mui)(/.*|$)'], - // Other packages come after. - ['^@', '^\\w'], - // Parent imports. Put `..` last. - ['^\\.\\.(?!/?$)', '^\\.\\./?$'], - // Other relative imports. Put same-folder imports and `.` last. - ['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'], - // Style imports. - ['^.+\\.?(css)$'], - ], - }, - ], - }, - parser: '@typescript-eslint/parser', -}; diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..3722418 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": ["next/core-web-vitals", "next/typescript"] +} diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 00b40c8..0000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @utmmcss/executives \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index e9893e5..0000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,13 +0,0 @@ -# What's Inside - -- [ ] Placeholder 1 -- [ ] Placeholder 2 - -... full details of acceptance criteria documented in the linked GitHub issue - -[//]: <> 'Self Checklist When Opening a Pull Request' - -[//]: # 'Pull Request Title Follows MCSS-: , e.g. MCSS-123: Example Title (Commit messages do not need to follow convention but recommended)' -[//]: # 'All ticket requirements are met. If not, then create a draft PR' -[//]: # 'GitHub Issue Pre-Linked to Branch' -[//]: # 'Correct Label to this Branch (Can be done after PR is created)' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index e9fbab2..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: CI - -on: - push: - branches: - - master - pull_request: - -jobs: - test: - name: Linting and Check-types - runs-on: ubuntu-latest - steps: - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: 16 - - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Cache dependencies - uses: actions/cache@v2 - with: - path: | - **/node_modules - key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} - - - name: Install dependencies - run: yarn install - - - name: Run lint command - run: yarn lint - - - name: Run check-types command - run: yarn check-types diff --git a/.gitignore b/.gitignore index 4250019..d32cc78 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,12 @@ # dependencies /node_modules /.pnp -.pnp.js +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/versions # testing /coverage @@ -24,12 +29,12 @@ npm-debug.log* yarn-debug.log* yarn-error.log* -# local env files -.env.local -.env.development.local -.env.test.local -.env.production.local +# env files (can opt-in for committing if needed) +.env* # vercel .vercel +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/.husky/pre-push b/.husky/pre-push deleted file mode 100755 index e0aeffb..0000000 --- a/.husky/pre-push +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -# Check ESLint Standards -npm run lint || -( - echo 'πŸ˜€πŸ€πŸ‘‹πŸ˜€ Failed linting! πŸ˜€πŸ€πŸ‘‹πŸ˜€ - ESLint Check Failed. Make the required changes listed above, add changes and try to commit again.' - false; -) - -# Check tsconfig standards -npm run check-types || -( - echo '😳πŸ˜₯❌😳 Failed Type check! 😳πŸ˜₯❌😳 - Make the changes required above.' - false; -) - -# If everything passes... Now we can commit -echo 'βœ…βœ…βœ…βœ… Looks good to me, I am pushing this now... βœ…βœ…βœ…βœ…' diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index b512c09..0000000 --- a/.prettierignore +++ /dev/null @@ -1 +0,0 @@ -node_modules \ No newline at end of file diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 039eada..0000000 --- a/.prettierrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "printWidth": 100, - "singleQuote": true, - "overrides": [ - { - "files": ["*.css", "*.scss"], - "options": { - "parser": "css" - } - } - ] -} diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index da2c59b..0000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "recommendations": [ - // Required Extensions - "dbaeumer.vscode-eslint", - "esbenp.prettier-vscode", - "streetsidesoftware.code-spell-checker", - "usernamehw.errorlens", - // Extra - "ms-vsliveshare.vsliveshare", - "alefragnani.Bookmarks", - "Postman.postman-for-vscode", - "GitHub.vscode-github-actions", - "davidanson.vscode-markdownlint" - ] -} diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 1756547..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - // Spell checker - "cSpell.words": ["Deerfield", "Esports", "linebreak", "Mailchimp", "MCSS", "rehype"], - "cSpell.language": "en", - // Use prettier for code formatting - "editor.defaultFormatter": "esbenp.prettier-vscode", - // Fix all autofixable errors on file save - "editor.codeActionsOnSave": { - "source.fixAll": true - }, - // Fix formatting issues on file save - "editor.formatOnSave": true, - "eslint.format.enable": true, - // Enable code suggestions - "editor.quickSuggestions": { - "comments": "on", - "strings": "on", - "other": "on" - }, - // Auto save files after TS refactoring - "files.refactoring.autoSave": true, - "typescript.tsdk": "node_modules/typescript/lib", - "typescript.validate.enable": true, - "typescript.format.enable": true, - "typescript.suggest.autoImports": true, - "typescript.suggest.completeJSDocs": true, - "javascript.validate.enable": true, - "typescript.preferences.importModuleSpecifier": "non-relative", - // Exclude files from watcher - "files.watcherExclude": { - "**/.git/objects/**": true, - "**/.git/subtree-cache/**": true, - "node_modules/**": true - }, - "files.exclude": { - "**/.git": true, - "**/.DS_Store": true - }, - "files.eol": "\n", - "search.exclude": { - "node_modules": true, - "build/**": true - } -} diff --git a/LICENSE b/LICENSE deleted file mode 100644 index d29d65b..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 UTM MCSS - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md index 3e1798e..e215bc4 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,36 @@ -# MCSS Website - -

- MCSS Logo -

- -

- - Build Status - - - Website Status - - - License - -

- -This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). - -## Setup - -1. run `git clone ` to clone the repo -2. run `yarn install` to install dependencies -3. add the .env file(s) from the tech team google drive and put it in the root of the project -4. install all the workspace @recommended extensions +This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). ## Getting Started First, run the development server: ```bash +npm run dev +# or yarn dev +# or +pnpm dev +# or +bun dev ``` Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. -You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. +You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. + +This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! + +## Deploy on Vercel -[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.tsx`. +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. -The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. +Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. diff --git a/api/client.ts b/api/client.ts deleted file mode 100644 index a64773f..0000000 --- a/api/client.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { - InvalidateOptions, - InvalidateQueryFilters, - QueryClient, - QueryKey, - useQuery as __useQuery, - UseQueryOptions, -} from '@tanstack/react-query'; - -import { APITemplate, ClientQueries, InferHandlerInput, QueryPaths } from './types'; - -const validateApiError = () => { - return (apiError: any) => { - throw new Error(apiError.toString()); - }; -}; - -export default class API { - public queryClient: QueryClient; - - private contract: APISchema; - - constructor(contract: APISchema) { - this.queryClient = new QueryClient(); - this.contract = contract; - } - - public useQuery< - TPath extends QueryPaths & string, - TQueryOutput extends ClientQueries[TPath]['awaitedResponse'], - TQueryInput extends InferHandlerInput - >(pathAndInput: [path: TPath, args: TQueryInput], opts?: UseQueryOptions) { - const [path, args] = pathAndInput; - const endpoint = this.contract[path]; - - return __useQuery( - pathAndInput as QueryKey, - () => endpoint(args).catch(validateApiError()), - opts - ); - } - - public invalidateQueries< - TPath extends QueryPaths & string, - TQueryInput extends InferHandlerInput - >( - filters: InvalidateQueryFilters & { queryKey: [path: TPath, args: Partial] }, - options?: InvalidateOptions - ) { - return this.queryClient.invalidateQueries(filters, options); - } -} diff --git a/api/schema.ts b/api/schema.ts deleted file mode 100644 index 325c2db..0000000 --- a/api/schema.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { CategoryResponse, DataAttributes } from '../types'; -import { APIResponseBlog } from '../types/Blogs'; -import { APIResponseEvent } from '../types/Events'; -import { MemberResponse } from '../types/Members'; -import { APIResponseSponsor } from '../types/Sponsors'; - -import { CustomFetch } from './useFetch'; - -const blogs = (customFetch: CustomFetch) => - ({ - blogsList: async () => { - const res = await customFetch('CMS', 'blogs?populate=*'); - return res.data as APIResponseBlog; - }, - } as const); - -const events = (customFetch: CustomFetch) => - ({ - eventsList: async () => { - const res = await customFetch('CMS', 'events?populate=*'); - return res.data as APIResponseEvent; - }, - } as const); - -const members = (customFetch: CustomFetch) => ({ - membersList: async () => { - const res = await customFetch('CMS', 'team-members?populate=*'); - return res.data as DataAttributes; - }, -}); - -const sponsors = (customFetch: CustomFetch) => - ({ - sponsorsList: async () => { - const res = await customFetch('CMS', 'sponsors?populate=*'); - return res.data as APIResponseSponsor; - }, - } as const); - -const config = (customFetch: CustomFetch) => - ({ - ...blogs(customFetch), - ...events(customFetch), - ...members(customFetch), - ...sponsors(customFetch), - } as const); - -export default config; diff --git a/api/types.ts b/api/types.ts deleted file mode 100644 index 96f9597..0000000 --- a/api/types.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** template all api in schema should follow */ -export interface APITemplate { - [methodName: string]: (...args: any) => Promise -} - -const querySuffixes = ['Get', 'List'] as const; -type QuerySuffix = (typeof querySuffixes)[number]; - -/** api paths that are queries (end in querySuffixes) */ -export type QueryPaths = { - [QueryName in keyof Contract]-?: QueryName extends `${string}${QuerySuffix}` - ? Contract[QueryName] extends Function - ? QueryName - : never - : never -}[keyof Contract]; - -export type Awaited = T extends PromiseLike ? Awaited : T; - -/** api query paths mapped to args, response, and whatever awaitedResponse is */ -export type ClientQueries = { - [Query in QueryPaths]: { - args: Parameters[0] - response: ReturnType - awaitedResponse: Awaited> - } -}; - -/** args to send with provided api path */ -export type InferHandlerInput = TProcedure extends ( - args: infer TInput, - headers?: any -) => Promise - ? undefined extends TInput // ? is input optional - ? unknown extends TInput // ? is input unset - ? null | undefined // -> there is no input - : TInput | null | undefined // -> there is optional input - : TInput // -> input is required - : undefined | null;// -> there is no input diff --git a/api/useFetch.ts b/api/useFetch.ts deleted file mode 100644 index 45c6c79..0000000 --- a/api/useFetch.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { useCallback } from 'react'; - -const baseURLKeys = ['CMS', 'CUSTOM'] as const; -type BaseURL = (typeof baseURLKeys)[number]; - -const CMS_BASE_URL = process.env.NEXT_PUBLIC_API_URL; - -type Props = { - base: BaseURL; - url: string; -}; - -const fetchHelper = async (props: Props): Promise<{ data: any; error: any; statusCode: any }> => { - const { base, url } = props; - - const api = () => { - switch (base) { - case 'CMS': - return `${CMS_BASE_URL}/api/${url}`; - default: - return url; - } - }; - - const req = { - method: 'GET', - headers: { - 'Content-Type': 'application/json', - }, - }; - - const resp = await fetch(api(), req); - - const response: { error: any; data: unknown; statusCode: any } = { - error: { data: undefined }, - data: undefined, - statusCode: resp.status, - }; - - if (resp.status !== 200) { - const error = await resp.json(); - response.error.data = error; - } else { - const data = await resp.json(); - response.data = data; - } - return response; -}; - -/** DO NOT use this directly, use useAPI */ -const useFetch = () => { - return useCallback(async (base: BaseURL, url: string) => { - try { - return await fetchHelper({ - base, - url, - }); - } catch (error) { - console.log(error); - throw error; - } - }, []); -}; - -export type CustomFetch = ReturnType; - -export default useFetch; diff --git a/app/favicon.ico b/app/favicon.ico new file mode 100644 index 0000000..718d6fe Binary files /dev/null and b/app/favicon.ico differ diff --git a/app/fonts/GeistMonoVF.woff b/app/fonts/GeistMonoVF.woff new file mode 100644 index 0000000..f2ae185 Binary files /dev/null and b/app/fonts/GeistMonoVF.woff differ diff --git a/app/fonts/GeistVF.woff b/app/fonts/GeistVF.woff new file mode 100644 index 0000000..1b62daa Binary files /dev/null and b/app/fonts/GeistVF.woff differ diff --git a/app/globals.css b/app/globals.css new file mode 100644 index 0000000..a23ac26 --- /dev/null +++ b/app/globals.css @@ -0,0 +1,72 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +body { + font-family: Arial, Helvetica, sans-serif; +} + +@layer base { + :root { + --background: 0 0% 100%; + --foreground: 0 0% 3.9%; + --card: 0 0% 100%; + --card-foreground: 0 0% 3.9%; + --popover: 0 0% 100%; + --popover-foreground: 0 0% 3.9%; + --primary: 0 0% 9%; + --primary-foreground: 0 0% 98%; + --secondary: 0 0% 96.1%; + --secondary-foreground: 0 0% 9%; + --muted: 0 0% 96.1%; + --muted-foreground: 0 0% 45.1%; + --accent: 0 0% 96.1%; + --accent-foreground: 0 0% 9%; + --destructive: 0 84.2% 60.2%; + --destructive-foreground: 0 0% 98%; + --border: 0 0% 89.8%; + --input: 0 0% 89.8%; + --ring: 0 0% 3.9%; + --chart-1: 12 76% 61%; + --chart-2: 173 58% 39%; + --chart-3: 197 37% 24%; + --chart-4: 43 74% 66%; + --chart-5: 27 87% 67%; + --radius: 0.5rem; + } + .dark { + --background: 0 0% 3.9%; + --foreground: 0 0% 98%; + --card: 0 0% 3.9%; + --card-foreground: 0 0% 98%; + --popover: 0 0% 3.9%; + --popover-foreground: 0 0% 98%; + --primary: 0 0% 98%; + --primary-foreground: 0 0% 9%; + --secondary: 0 0% 14.9%; + --secondary-foreground: 0 0% 98%; + --muted: 0 0% 14.9%; + --muted-foreground: 0 0% 63.9%; + --accent: 0 0% 14.9%; + --accent-foreground: 0 0% 98%; + --destructive: 0 62.8% 30.6%; + --destructive-foreground: 0 0% 98%; + --border: 0 0% 14.9%; + --input: 0 0% 14.9%; + --ring: 0 0% 83.1%; + --chart-1: 220 70% 50%; + --chart-2: 160 60% 45%; + --chart-3: 30 80% 55%; + --chart-4: 280 65% 60%; + --chart-5: 340 75% 55%; + } +} + +@layer base { + * { + @apply border-border; + } + body { + @apply bg-background text-foreground; + } +} diff --git a/app/layout.tsx b/app/layout.tsx new file mode 100644 index 0000000..a36cde0 --- /dev/null +++ b/app/layout.tsx @@ -0,0 +1,35 @@ +import type { Metadata } from "next"; +import localFont from "next/font/local"; +import "./globals.css"; + +const geistSans = localFont({ + src: "./fonts/GeistVF.woff", + variable: "--font-geist-sans", + weight: "100 900", +}); +const geistMono = localFont({ + src: "./fonts/GeistMonoVF.woff", + variable: "--font-geist-mono", + weight: "100 900", +}); + +export const metadata: Metadata = { + title: "Create Next App", + description: "Generated by create next app", +}; + +export default function RootLayout({ + children, +}: Readonly<{ + children: React.ReactNode; +}>) { + return ( + + + {children} + + + ); +} diff --git a/app/page.tsx b/app/page.tsx new file mode 100644 index 0000000..c3c9a70 --- /dev/null +++ b/app/page.tsx @@ -0,0 +1,10 @@ +import { Hero } from "@/components/Hero"; +import { Button } from "@/components/ui/button"; + +export default function Home() { + return ( +
+ +
+ ); +} diff --git a/components.json b/components.json new file mode 100644 index 0000000..dea737b --- /dev/null +++ b/components.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "new-york", + "rsc": true, + "tsx": true, + "tailwind": { + "config": "tailwind.config.ts", + "css": "app/globals.css", + "baseColor": "neutral", + "cssVariables": true, + "prefix": "" + }, + "aliases": { + "components": "@/components", + "utils": "@/lib/utils", + "ui": "@/components/ui", + "lib": "@/lib", + "hooks": "@/hooks" + }, + "iconLibrary": "lucide" +} \ No newline at end of file diff --git a/components/Blogs/BlogHighlightSection.tsx b/components/Blogs/BlogHighlightSection.tsx deleted file mode 100644 index c0780da..0000000 --- a/components/Blogs/BlogHighlightSection.tsx +++ /dev/null @@ -1,105 +0,0 @@ -import { FC } from 'react'; - -import Button from '@mui/material/Button'; - -import MaterialCard from '@components/Common/MaterialCard'; -import MediaQueryContainer from '@components/Common/MediaQueryContainer'; -import Slider from '@components/Common/Slider'; -import Tag from '@components/Common/Tag'; -import { useAppSelector } from '@store/hooks'; -import { formatDate } from '@utils/helper'; -import Image from 'next/image'; -import { useRouter } from 'next/router'; - -const BlogHighlightSection: FC = () => { - const { blogs } = useAppSelector((state) => state.blogs); - const router = useRouter(); - - const blogCardInfos = Object.entries(blogs) - .filter(([, { featured }]) => featured) - .slice(0, 3) - .map(([id, { title, author, updatedDatetime, coverImageUrl, tags, description }]) => ({ - id, - title, - author, - updatedDatetime: formatDate(updatedDatetime, { - month: 'short', - day: 'numeric', - year: 'numeric', - hour: 'numeric', - minute: 'numeric', - }), - coverImageUrl, - tags: tags.map((t) => t.Tag), - description, - })); - - return ( -
- - - {blogCardInfos.map(({ id, coverImageUrl, author, title, description, tags }) => ( -
- router.push(`Blogs/${id}`)} - > - -
- -
-
-

{`By: ${author}`}

-

{title}

-

{description}

-
-
-
- ))} -
-
- -
- {blogCardInfos.map(({ id, title, updatedDatetime, coverImageUrl, tags, author }) => ( - router.push(`Blogs/${id}`)} - > - -
-
- -
-
-
-

Last Updated

-

{updatedDatetime}

- {author &&

Creator

} -

{author}

-
-
-
-

{title}

-
-
- -
-
-
-
-
- ))} -
-
-
- ); -}; - -export default BlogHighlightSection; diff --git a/components/Blogs/BlogListSection.tsx b/components/Blogs/BlogListSection.tsx deleted file mode 100644 index 372b151..0000000 --- a/components/Blogs/BlogListSection.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import { FC } from 'react'; - -import MaterialCard from '@components/Common/MaterialCard'; -import Tag from '@components/Common/Tag'; -import { useAppSelector } from '@store/hooks'; -import { formatDate } from '@utils/helper'; -import classNames from 'classnames'; -import Image from 'next/image'; -import { useRouter } from 'next/router'; -import _ from 'underscore'; - -interface IProps { - selectedCategories: string[]; -} - -const BlogListSection: FC = ({ selectedCategories }) => { - const { blogs } = useAppSelector((state) => state.blogs); - const router = useRouter(); - const blogCardInfos = Object.entries(blogs) - .filter( - ([, { tags }]) => - selectedCategories.includes('All') || - !_.isEmpty(tags.filter((category) => selectedCategories.includes(category.Tag))) - ) - .map(([id, { title, author, updatedDatetime, coverImageUrl, tags, description }]) => ({ - id, - title, - author, - updatedDatetime: formatDate(updatedDatetime, { - month: 'short', - day: 'numeric', - year: 'numeric', - hour: 'numeric', - minute: 'numeric', - }), - coverImageUrl, - tags: tags.map((t) => t.Tag), - description, - })); - - return ( -
-
- {blogCardInfos.map(({ id, title, author, description, coverImageUrl, tags }) => ( -
selectedCategories.includes(category))), - })} - key={id} - > - router.push(`Blogs/${id}`)} - > - -
- -
-
- {author &&

{`By: ${author}`}

} -

{title}

-

{description}

-
-
-
- ))} -
-
- ); -}; - -export default BlogListSection; diff --git a/components/Common/Card.tsx b/components/Common/Card.tsx deleted file mode 100644 index b8d5dfe..0000000 --- a/components/Common/Card.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { FC } from 'react'; - -type CardProps = { - children: React.ReactNode; - className?: string; -}; - -/** @deprecated - * use MaterialCard instead - */ -const Card: FC = ({ children, className }) => ( -
{children}
-); - -export default Card; diff --git a/components/Common/DetailPageContainer.tsx b/components/Common/DetailPageContainer.tsx deleted file mode 100644 index dcbb9bc..0000000 --- a/components/Common/DetailPageContainer.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { ReactNode } from 'react'; - -import Container from '@mui/material/Container'; - -type Props = { - children: ReactNode; -}; - -const DetailPageContainer = (props: Props) => { - const { children } = props; - return ( - - {children} - - ); -}; - -export default DetailPageContainer; diff --git a/components/Common/Filter.tsx b/components/Common/Filter.tsx deleted file mode 100644 index 858cd16..0000000 --- a/components/Common/Filter.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { FC } from 'react'; - -interface FilterProps { - options: Omit[]; - selectedOptions: string[]; -} - -interface Option { - name: string; - onClick: () => void; - clicked: boolean; -} - -const OptionButton: FC