+
All Posts
+
{posts.length === 0
? Array(8)
.fill(0)
diff --git a/frontend/src/utils/category-colors.ts b/frontend/src/utils/category-colors.ts
new file mode 100644
index 00000000..92fda076
--- /dev/null
+++ b/frontend/src/utils/category-colors.ts
@@ -0,0 +1,17 @@
+type CategoryColors = Map;
+
+const categoryColors: CategoryColors = new Map([
+ ['Travel', ['bg-pink-200 dark:bg-pink-900', 'bg-pink-500/80']],
+ ['Nature', ['bg-green-200 dark:bg-green-900', 'bg-green-500/80']],
+ ['City', ['bg-yellow-200 dark:bg-yellow-900', 'bg-yellow-500/80']],
+ ['Adventure', ['bg-blue-200 dark:bg-blue-900', 'bg-blue-500/80']],
+ ['Beaches', ['bg-purple-200 dark:bg-purple-900', 'bg-purple-500/80']],
+ ['Landmarks', ['bg-red-200 dark:bg-red-900', 'bg-red-500/80']],
+]);
+
+export const categories: string[] = Array.from(categoryColors.keys());
+
+export function getCategoryColors(category: string): [string, string] {
+ const colorTuple: [string, string] | undefined = categoryColors.get(category);
+ return colorTuple ?? ['bg-cyan-200 dark:bg-cyan-900', 'bg-cyan-500/80'];
+}
diff --git a/frontend/src/utils/category-props.tsx b/frontend/src/utils/category-props.tsx
deleted file mode 100644
index bc4d7272..00000000
--- a/frontend/src/utils/category-props.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-let commonProps: string = 'px-3 py-1 rounded-3xl font-normal text-sm';
-export const categoryProps = (category: string, selected: boolean = false) => {
- switch (category) {
- case 'Travel':
- return `${commonProps} ${selected ? `bg-pink-500` : `bg-pink-100`}`;
-
- case 'Nature':
- return `${commonProps} ${selected ? `bg-green-500` : `bg-green-100`}`;
-
- case 'City':
- return `${commonProps} ${selected ? `bg-yellow-500` : `bg-yellow-100`}`;
-
- case 'Adventure':
- return `${commonProps} ${selected ? `bg-blue-500` : `bg-blue-100`}`;
-
- case 'Beaches':
- return `${commonProps} ${selected ? `bg-purple-500` : `bg-purple-100`}`;
-
- case 'Landmarks':
- return `${commonProps} ${selected ? `bg-red-500` : `bg-red-100`}`;
-
- default:
- return `${commonProps} ${selected ? `bg-orange-500` : `bg-orange-100`}`;
- }
-};
diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js
index c47db360..c483bb89 100644
--- a/frontend/tailwind.config.js
+++ b/frontend/tailwind.config.js
@@ -1,4 +1,7 @@
/** @type {import('tailwindcss').Config} */
+const colors = require('tailwindcss/colors');
+const defaultTheme = require('tailwindcss/defaultTheme');
+
export default {
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
darkMode: 'media',
@@ -6,9 +9,27 @@ export default {
extend: {
colors: {
dark: {
- DEFAULT: 'var(--color-dark-background)',
- textfield: 'var(--color-dark-textfield-card)',
+ DEFAULT: colors.slate[900],
+ primary: colors.slate[50],
+ secondary: colors.slate[300],
+ tertiary: colors.slate[400],
+ card: colors.slate[800],
+ title: colors.slate[50],
+ description: colors.slate[400],
+ info: colors.slate[500],
},
+ light: {
+ DEFAULT: colors.slate[50],
+ primary: colors.slate[900],
+ secondary: colors.slate[600],
+ tertiary: colors.slate[500],
+ title: colors.slate[900],
+ description: colors.slate[700],
+ info: colors.slate[500],
+ },
+ },
+ fontFamily: {
+ sans: ['Poppins', ...defaultTheme.fontFamily.sans],
},
},
},
diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json
index 52dd6bf6..a527a08a 100644
--- a/frontend/tsconfig.json
+++ b/frontend/tsconfig.json
@@ -2,9 +2,7 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
- "@/*": [
- "./src/*"
- ]
+ "@/*": ["./src/*"]
},
"target": "ES2020",
"useDefineForClassFields": true,