website refactor
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import { Card } from '@/ui/Card';
|
||||
import { Box } from '@/ui/Box';
|
||||
import { Stack } from '@/ui/Stack';
|
||||
import { Text } from '@/ui/Text';
|
||||
@@ -10,8 +9,7 @@ import { Grid } from '@/ui/Grid';
|
||||
import { GridItem } from '@/ui/GridItem';
|
||||
import { Icon } from '@/ui/Icon';
|
||||
import { Surface } from '@/ui/Surface';
|
||||
import { Settings, Users, Trophy, Shield, Clock, LucideIcon } from 'lucide-react';
|
||||
import { DateDisplay } from '@/lib/display-objects/DateDisplay';
|
||||
import { Settings, Users, Trophy, Shield, Clock, type LucideIcon } from 'lucide-react';
|
||||
import type { LeagueSettingsViewData } from '@/lib/view-data/leagues/LeagueSettingsViewData';
|
||||
|
||||
interface LeagueSettingsTemplateProps {
|
||||
@@ -20,76 +18,69 @@ interface LeagueSettingsTemplateProps {
|
||||
|
||||
export function LeagueSettingsTemplate({ viewData }: LeagueSettingsTemplateProps) {
|
||||
return (
|
||||
<Stack gap={6}>
|
||||
<Box>
|
||||
<Heading level={2}>League Settings</Heading>
|
||||
<Text size="sm" color="text-gray-400" block mt={1}>
|
||||
Manage your league configuration and preferences
|
||||
</Text>
|
||||
</Box>
|
||||
|
||||
<Stack gap={8}>
|
||||
<Stack gap={6}>
|
||||
{/* League Information */}
|
||||
<Card>
|
||||
<Stack gap={4}>
|
||||
<Surface variant="dark" border rounded="lg" padding={6}>
|
||||
<Stack gap={6}>
|
||||
<Stack direction="row" align="center" gap={3}>
|
||||
<Surface variant="muted" rounded="lg" padding={2} bg="bg-blue-500/10">
|
||||
<Icon icon={Settings} size={5} color="#3b82f6" />
|
||||
</Surface>
|
||||
<Box p={2} bg="bg-primary-blue/10" rounded="md" border borderColor="border-primary-blue/20">
|
||||
<Icon icon={Settings} size={5} color="text-primary-blue" />
|
||||
</Box>
|
||||
<Box>
|
||||
<Heading level={3}>League Information</Heading>
|
||||
<Text size="sm" color="text-gray-400">Basic league details</Text>
|
||||
<Heading level={5} color="text-primary-blue">LEAGUE INFORMATION</Heading>
|
||||
<Text size="xs" color="text-gray-500">Basic league details and identification</Text>
|
||||
</Box>
|
||||
</Stack>
|
||||
|
||||
<Grid cols={2} gap={4}>
|
||||
<Grid cols={1} mdCols={2} gap={6}>
|
||||
<InfoItem label="Name" value={viewData.league.name} />
|
||||
<InfoItem label="Visibility" value={viewData.league.visibility} capitalize />
|
||||
<GridItem colSpan={2}>
|
||||
<InfoItem label="Description" value={viewData.league.description} />
|
||||
</GridItem>
|
||||
<InfoItem label="Created" value={DateDisplay.formatShort(viewData.league.createdAt)} />
|
||||
<InfoItem label="Created" value={new Date(viewData.league.createdAt).toLocaleDateString()} />
|
||||
<InfoItem label="Owner ID" value={viewData.league.ownerId} />
|
||||
</Grid>
|
||||
</Stack>
|
||||
</Card>
|
||||
</Surface>
|
||||
|
||||
{/* Configuration */}
|
||||
<Card>
|
||||
<Stack gap={4}>
|
||||
<Surface variant="dark" border rounded="lg" padding={6}>
|
||||
<Stack gap={6}>
|
||||
<Stack direction="row" align="center" gap={3}>
|
||||
<Surface variant="muted" rounded="lg" padding={2} bg="bg-green-500/10">
|
||||
<Icon icon={Trophy} size={5} color="#10b981" />
|
||||
</Surface>
|
||||
<Box p={2} bg="bg-performance-green/10" rounded="md" border borderColor="border-performance-green/20">
|
||||
<Icon icon={Trophy} size={5} color="text-performance-green" />
|
||||
</Box>
|
||||
<Box>
|
||||
<Heading level={3}>Configuration</Heading>
|
||||
<Text size="sm" color="text-gray-400">League rules and limits</Text>
|
||||
<Heading level={5} color="text-performance-green">CONFIGURATION</Heading>
|
||||
<Text size="xs" color="text-gray-500">League rules and participation limits</Text>
|
||||
</Box>
|
||||
</Stack>
|
||||
|
||||
<Grid cols={2} gap={4}>
|
||||
<Grid cols={1} mdCols={2} gap={6}>
|
||||
<ConfigItem icon={Users} label="Max Drivers" value={viewData.config.maxDrivers} />
|
||||
<ConfigItem icon={Shield} label="Require Approval" value={viewData.config.requireApproval ? 'Yes' : 'No'} />
|
||||
<ConfigItem icon={Clock} label="Allow Late Join" value={viewData.config.allowLateJoin ? 'Yes' : 'No'} />
|
||||
<ConfigItem icon={Trophy} label="Scoring Preset" value={viewData.config.scoringPresetId} />
|
||||
</Grid>
|
||||
</Stack>
|
||||
</Card>
|
||||
</Surface>
|
||||
|
||||
{/* Note about forms */}
|
||||
<Card>
|
||||
<Stack align="center" py={8} gap={4}>
|
||||
<Surface variant="muted" rounded="full" padding={4} bg="bg-amber-500/10">
|
||||
<Icon icon={Settings} size={8} color="#f59e0b" />
|
||||
</Surface>
|
||||
<Surface variant="dark" border rounded="lg" padding={8}>
|
||||
<Stack align="center" gap={4}>
|
||||
<Box p={4} bg="bg-warning-amber/10" rounded="full" border borderColor="border-warning-amber/20">
|
||||
<Icon icon={Settings} size={8} color="text-warning-amber" />
|
||||
</Box>
|
||||
<Box textAlign="center">
|
||||
<Heading level={3}>Settings Management</Heading>
|
||||
<Text size="sm" color="text-gray-400" block mt={2}>
|
||||
<Text size="sm" color="text-gray-400" mt={2} display="block">
|
||||
Form-based editing and ownership transfer functionality will be implemented in future updates.
|
||||
</Text>
|
||||
</Box>
|
||||
</Stack>
|
||||
</Card>
|
||||
</Surface>
|
||||
</Stack>
|
||||
</Stack>
|
||||
);
|
||||
@@ -98,19 +89,21 @@ export function LeagueSettingsTemplate({ viewData }: LeagueSettingsTemplateProps
|
||||
function InfoItem({ label, value, capitalize }: { label: string, value: string, capitalize?: boolean }) {
|
||||
return (
|
||||
<Box>
|
||||
<Text size="sm" weight="medium" color="text-gray-400" block mb={1}>{label}</Text>
|
||||
<Text color="text-white">{capitalize ? value.toUpperCase() : value}</Text>
|
||||
<Text size="xs" weight="bold" color="text-gray-500" display="block" mb={1} letterSpacing="wider">{label.toUpperCase()}</Text>
|
||||
<Text color="text-white" weight="medium">{capitalize ? value.toUpperCase() : value}</Text>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
function ConfigItem({ icon, label, value }: { icon: LucideIcon, label: string, value: string | number }) {
|
||||
return (
|
||||
<Stack direction="row" align="center" gap={3}>
|
||||
<Icon icon={icon} size={5} color="#9ca3af" />
|
||||
<Stack direction="row" align="center" gap={4}>
|
||||
<Box center w={10} h={10} rounded="lg" bg="bg-white/5">
|
||||
<Icon icon={icon} size={5} color="text-gray-400" />
|
||||
</Box>
|
||||
<Box>
|
||||
<Text size="sm" weight="medium" color="text-gray-400" block>{label}</Text>
|
||||
<Text color="text-white">{value}</Text>
|
||||
<Text size="xs" weight="bold" color="text-gray-500" display="block" letterSpacing="wider">{label.toUpperCase()}</Text>
|
||||
<Text color="text-white" weight="medium">{value}</Text>
|
||||
</Box>
|
||||
</Stack>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user