-
{category.name}
+
+
{category.name}
{isEditing && (
)}
-
+
{category.websites.map((website) => (
{
isEditing={isEditing}
onEdit={setEditingWebsite}
onMove={handleMoveWebsite}
- className={getTileSizeClass(config.tileSize)}
+ tileSize={config.tileSize}
/>
))}
{isEditing && (
diff --git a/components/ConfigurationModal.tsx b/components/ConfigurationModal.tsx
index 97a9a83..a4fcbcb 100644
--- a/components/ConfigurationModal.tsx
+++ b/components/ConfigurationModal.tsx
@@ -20,6 +20,7 @@ const ConfigurationModal: React.FC = ({ onClose, onSave
subtitleSize: currentConfig.subtitleSize || 'medium',
alignment: currentConfig.alignment || 'middle',
tileSize: currentConfig.tileSize || 'medium',
+ horizontalAlignment: currentConfig.horizontalAlignment || 'middle',
wallpaperBlur: currentConfig.wallpaperBlur || 0,
wallpaperBrightness: currentConfig.wallpaperBrightness || 100,
wallpaperOpacity: currentConfig.wallpaperOpacity || 100,
@@ -328,6 +329,19 @@ const ConfigurationModal: React.FC = ({ onClose, onSave
]}
/>
+
+
+
+
)}
diff --git a/components/WebsiteTile.tsx b/components/WebsiteTile.tsx
index 82e9c27..e90966c 100755
--- a/components/WebsiteTile.tsx
+++ b/components/WebsiteTile.tsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import React, { useState } from 'react';
import { Website } from '../types';
import { icons, ArrowLeft, ArrowRight, Pencil } from 'lucide-react';
@@ -7,30 +7,85 @@ interface WebsiteTileProps {
isEditing: boolean;
onEdit: (website: Website) => void;
onMove: (website: Website, direction: 'left' | 'right') => void;
- className?: string;
+ tileSize?: string;
}
-const WebsiteTile: React.FC
= ({ website, isEditing, onEdit, onMove, className }) => {
+const getTileSizeClass = (size: string | undefined) => {
+ switch (size) {
+ case 'small':
+ return 'w-28 h-28';
+ case 'medium':
+ return 'w-32 h-32';
+ case 'large':
+ return 'w-36 h-36';
+ default:
+ return 'w-32 h-32';
+ }
+};
+
+const getIconSize = (size: string | undefined) => {
+ switch (size) {
+ case 'small':
+ return 8;
+ case 'medium':
+ return 10;
+ case 'large':
+ return 12;
+ default:
+ return 10;
+ }
+}
+
+const WebsiteTile: React.FC = ({ website, isEditing, onEdit, onMove, tileSize }) => {
const LucideIcon = icons[website.icon as keyof typeof icons];
+ const [isLoading, setIsLoading] = useState(false);
+
+ const handleClick = (e: React.MouseEvent) => {
+ if (isEditing) {
+ e.preventDefault();
+ return;
+ }
+ setIsLoading(true);
+
+ // Simulate loading time (dev purpose)
+ // e.preventDefault();
+ // setTimeout(() => {
+ // setIsLoading(false);
+ // }, 3500); // Small delay to show spinner before navigation
+ };
+
+ const iconSizeClass = `w-${getIconSize(tileSize)} h-${getIconSize(tileSize)}`;
+ const iconSizeLoadingClass = `w-${getIconSize(tileSize) - 4} h-${getIconSize(tileSize) - 4}`;
return (
-