Skip to content

Commit

Permalink
style: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
kamiya10 committed Dec 6, 2024
1 parent 836dae5 commit 10b0fba
Show file tree
Hide file tree
Showing 14 changed files with 62 additions and 121 deletions.
2 changes: 1 addition & 1 deletion src/app/downloads/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { useEffect, useState } from 'react';
import { Select, SelectContent, SelectItem, SelectTrigger } from '@/components/ui/select';
import AnimatedCounter from '@/lib/counter';
import { Button } from '@/components/ui/button';
import VersionBadge from '@/components/dialogs/version';
import PackageSizeChart from '@/components/size_chart';
import VersionBadge from '@/components/dialogs/version';

interface SystemInfo {
os: 'windows' | 'mac' | 'linux' | 'unknown';
Expand Down
69 changes: 35 additions & 34 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,51 +11,52 @@ body {
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 240 10% 3.9%;
--foreground: 20 14.3% 4.1%;
--card: 0 0% 100%;
--card-foreground: 240 10% 3.9%;
--card-foreground: 20 14.3% 4.1%;
--popover: 0 0% 100%;
--popover-foreground: 240 10% 3.9%;
--primary: 240 5.9% 10%;
--primary-foreground: 0 0% 98%;
--secondary: 240 4.8% 95.9%;
--secondary-foreground: 240 5.9% 10%;
--muted: 240 4.8% 95.9%;
--muted-foreground: 240 3.8% 46.1%;
--accent: 240 4.8% 95.9%;
--accent-foreground: 240 5.9% 10%;
--popover-foreground: 20 14.3% 4.1%;
--primary: 47.9 95.8% 53.1%;
--primary-foreground: 26 83.3% 14.1%;
--secondary: 60 4.8% 95.9%;
--secondary-foreground: 24 9.8% 10%;
--muted: 60 4.8% 95.9%;
--muted-foreground: 25 5.3% 44.7%;
--accent: 60 4.8% 95.9%;
--accent-foreground: 24 9.8% 10%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 0 0% 98%;
--border: 240 5.9% 90%;
--input: 240 5.9% 90%;
--ring: 240 10% 3.9%;
--destructive-foreground: 60 9.1% 97.8%;
--border: 20 5.9% 90%;
--input: 20 5.9% 90%;
--ring: 20 14.3% 4.1%;
--radius: 0.75rem;
--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: 240 10% 3.9%;
--foreground: 0 0% 98%;
--card: 240 10% 3.9%;
--card-foreground: 0 0% 98%;
--popover: 240 10% 3.9%;
--popover-foreground: 0 0% 98%;
--primary: 0 0% 98%;
--primary-foreground: 240 5.9% 10%;
--secondary: 240 3.7% 15.9%;
--secondary-foreground: 0 0% 98%;
--muted: 240 3.7% 15.9%;
--muted-foreground: 240 5% 64.9%;
--accent: 240 3.7% 15.9%;
--accent-foreground: 0 0% 98%;
--background: 20 14.3% 4.1%;
--foreground: 60 9.1% 97.8%;
--card: 20 14.3% 4.1%;
--card-foreground: 60 9.1% 97.8%;
--popover: 20 14.3% 4.1%;
--popover-foreground: 60 9.1% 97.8%;
--primary: 47.9 95.8% 53.1%;
--primary-foreground: 26 83.3% 14.1%;
--secondary: 12 6.5% 15.1%;
--secondary-foreground: 60 9.1% 97.8%;
--muted: 12 6.5% 15.1%;
--muted-foreground: 24 5.4% 63.9%;
--accent: 12 6.5% 15.1%;
--accent-foreground: 60 9.1% 97.8%;
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 0 0% 98%;
--border: 240 3.7% 15.9%;
--input: 240 3.7% 15.9%;
--ring: 240 4.9% 83.9%;
--destructive-foreground: 60 9.1% 97.8%;
--border: 12 6.5% 15.1%;
--input: 12 6.5% 15.1%;
--ring: 35.5 91.7% 32.9%;
--chart-1: 220 70% 50%;
--chart-2: 160 60% 45%;
--chart-3: 30 80% 55%;
Expand Down
31 changes: 7 additions & 24 deletions src/app/plugins/client.tsx
Original file line number Diff line number Diff line change
@@ -1,37 +1,20 @@
'use client';

import { SiGithub } from '@icons-pack/react-simple-icons';
import {
CheckCircle,
Clock,
Download,
Lock,
RefreshCw,
Shield,
ShieldCheck,
Star,
Tag,
} from 'lucide-react';
import Link from 'next/link';
import { CheckCircle, Clock, Download, Lock, RefreshCw, Shield, ShieldCheck, Star, Tag } from 'lucide-react';
import { Suspense, useEffect, useState } from 'react';
import { useRouter, useSearchParams } from 'next/navigation';
import Link from 'next/link';
import { SiGithub } from '@icons-pack/react-simple-icons';

import ActivityHeatmap from '@/components/activity_chart';
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
DialogTrigger,
} from '@/components/ui/dialog';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog';
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
import { formatNumber, formatTimeString, getRelativeTime } from '@/lib/utils';
import ActivityHeatmap from '@/components/activity_chart';
import GithubPeople from '@/components/github_people';
import { InstallButtons } from '@/components/install';
import PluginPageTab from '@/components/plugin_page';
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
import UnsafePluginWarning from '@/components/dialogs/warn';
import { formatNumber, formatTimeString, getRelativeTime } from '@/lib/utils';

import type Plugin from '@/modal/plugin';

Expand Down
2 changes: 1 addition & 1 deletion src/components/install.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { useEffect, useState } from 'react';
import { AlertCircle, Download, X } from 'lucide-react';
import { useEffect, useState } from 'react';

import {
Dialog,
Expand Down
52 changes: 6 additions & 46 deletions src/components/plugin_card.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { SiGithub } from '@icons-pack/react-simple-icons';
import { CheckCircle, Clock, Download, ShieldCheck, Tag } from 'lucide-react';
import { SiGithub } from '@icons-pack/react-simple-icons';
import { useRouter } from 'next/navigation';

import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card';
import { formatNumber, formatTimeString, getRelativeTime } from '@/lib/utils';

import GithubPeople from './github_people';
import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip';
import GithubPeople from './github_people';

import type Plugin from '@/modal/plugin';

Expand All @@ -28,16 +28,16 @@ export default function PluginCard({ plugin }: Props) {
className={`
flex h-full cursor-pointer flex-col
transition-[color_background-color_border-color]
dark:hover:bg-primary/[.08] dark:glow:bg-primary/[.12]
glow:border-primary/40 glow:bg-primary/[.08]
hover:border-primary/20 hover:bg-primary/[.04]
dark:hover:bg-primary/[.08]
glow:border-primary glow:bg-primary/[.08]
hover:border-primary/40 hover:bg-primary/[.04]
`}
>
<CardHeader>
<div className="flex justify-between">
<div className="flex flex-col gap-2">
<div className="flex items-center gap-2">
<CardTitle className="text-xl font-bold">{plugin.name}</CardTitle>
<CardTitle className="text-xl font-bold text-primary">{plugin.name}</CardTitle>
{isVerified && (
<div className="flex translate-y-[1px] items-center gap-2">
<CheckCircle
Expand Down Expand Up @@ -114,46 +114,6 @@ export default function PluginCard({ plugin }: Props) {
<span>{formatNumber(plugin.repository.releases.total_downloads)}</span>
</div>
</div>
{/* {plugin.repository.releases.releases.length > 0
&& (
<div className="flex" onClick={(e) => e.stopPropagation()}>
<Button
className={plugin.repository.releases.releases.length > 1
? `rounded-e-none`
: ''}
asChild
>
<a
href={`https://github.com/${plugin.repository.full_name}/releases/latest/download/${plugin.name}.trem`}
download
>
下載
</a>
</Button>
{plugin.repository.releases.releases.length > 1
&& (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button size="icon" className="w-6 rounded-s-none">
<ChevronDown size={16} />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent>
{plugin.repository.releases.releases.map((release) => (
<DropdownMenuItem key={release.tag_name} asChild>
<a
href={`https://github.com/${plugin.repository.full_name}/releases/download/${release.tag_name}/${plugin.name}.trem`}
download
>
{release.tag_name}
</a>
</DropdownMenuItem>
))}
</DropdownMenuContent>
</DropdownMenu>
)}
</div>
)} */}
</div>
</CardFooter>
</Card>
Expand Down
2 changes: 1 addition & 1 deletion src/components/plugin_page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { Card, CardContent } from '@/components/ui/card';
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
import Plugin from '@/modal/plugin';

import VersionList from './version_list';
import ReadmeTab from './readme';
import VersionList from './version_list';

const PluginPageTab = ({ plugin, allPlugins, version }: { plugin: Plugin; allPlugins: Plugin[];version: string }) => {
const router = useRouter();
Expand Down
4 changes: 2 additions & 2 deletions src/components/traffic_chart.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use client';

import { Loader2Icon } from 'lucide-react';
import React, { useCallback, useEffect, useState } from 'react';
import { Legend, Line, LineChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
import { useCallback, useEffect, useState } from 'react';
import { Loader2Icon } from 'lucide-react';

import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { formatTimeString } from '@/lib/utils';
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { Slot } from '@radix-ui/react-slot';
import { cva } from 'class-variance-authority';
import * as React from 'react';

import { cn } from '@/lib/utils';

Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import * as React from 'react';
import * as DialogPrimitive from '@radix-ui/react-dialog';
import * as React from 'react';
import { X } from 'lucide-react';

import { cn } from '@/lib/utils';
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/dropdown-menu.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use client';

import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
import { Check, ChevronRight, Circle } from 'lucide-react';
import * as React from 'react';
import { Check, ChevronRight, Circle } from 'lucide-react';

import { cn } from '@/lib/utils';

Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/select.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use client';

import * as React from 'react';
import * as SelectPrimitive from '@radix-ui/react-select';
import { Check, ChevronDown, ChevronUp } from 'lucide-react';
import * as React from 'react';

import { cn } from '@/lib/utils';

Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import * as TabsPrimitive from '@radix-ui/react-tabs';
import * as React from 'react';
import * as TabsPrimitive from '@radix-ui/react-tabs';

import { cn } from '@/lib/utils';

Expand Down
4 changes: 2 additions & 2 deletions src/components/ui/tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use client';

import { Provider, Root, Trigger, Content, Portal } from '@radix-ui/react-tooltip';
import { Content, Portal, Provider, Root, Trigger } from '@radix-ui/react-tooltip';
import { forwardRef } from 'react';

import { cn } from '@/lib/utils';

import type { ElementRef, ComponentPropsWithoutRef } from 'react';
import type { ComponentPropsWithoutRef, ElementRef } from 'react';

const TooltipProvider = Provider;

Expand Down
7 changes: 2 additions & 5 deletions src/components/version_list.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import React from 'react';

import { Card, CardContent } from '@/components/ui/card';
import { Button } from '@/components/ui/button';
import {
Card,
CardContent,
} from '@/components/ui/card';
import { TabsContent } from '@/components/ui/tabs';
import { formatNumber } from '@/lib/utils';
import VersionBadge from '@/components/dialogs/version';
import { formatNumber } from '@/lib/utils';

import type Plugin from '@/modal/plugin';
import type Release from '@/modal/release';
Expand Down

0 comments on commit 10b0fba

Please sign in to comment.