Skip to content

Commit

Permalink
chore: linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-Liendo committed Sep 5, 2024
1 parent a38c095 commit cbf5cd9
Show file tree
Hide file tree
Showing 26 changed files with 220 additions and 219 deletions.
1 change: 1 addition & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},
"javascript": {
"formatter": {
"jsxQuoteStyle": "single",
"quoteStyle": "single"
}
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function App() {
<>
<AuthProvider>
<LinksProvider>
<ThemeProvider defaultTheme="dark" storageKey="vite-ui-theme">
<ThemeProvider defaultTheme='dark' storageKey='vite-ui-theme'>
<Routes />
</ThemeProvider>
</LinksProvider>
Expand Down
20 changes: 10 additions & 10 deletions client/src/components/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
export default function Navbar() {
return (
<>
<nav className="p-4 border-b-2 border-blue-500">
<div className="container mx-auto flex justify-between items-center">
<div className="text-slate-950 text-2xl font-bold">
<nav className='p-4 border-b-2 border-blue-500'>
<div className='container mx-auto flex justify-between items-center'>
<div className='text-slate-950 text-2xl font-bold'>
<img
className="w-20"
src="/public/logotypeLinx.png"
alt="Logotype Linx"
className='w-20'
src='/public/logotypeLinx.png'
alt='Logotype Linx'
/>
</div>
<ul className="flex space-x-4">
<ul className='flex space-x-4'>
<li>
<a href="#product" className="text-slate-950 hover:text-blue-700">
<a href='#product' className='text-slate-950 hover:text-blue-700'>
Product
</a>
</li>
<li>
<a href="#login" className="text-slate-950 hover:text-blue-700">
<a href='#login' className='text-slate-950 hover:text-blue-700'>
Login
</a>
</li>
<li>
<a href="#signup" className="text-slate-950 hover:text-blue-700">
<a href='#signup' className='text-slate-950 hover:text-blue-700'>
Sign Up
</a>
</li>
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/data-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ export function DataTable<TData, TValue>({
});

return (
<div className="space-y-4">
<div className='space-y-4'>
<DataTableToolbar table={table} />
<div className="rounded-md border">
<div className='rounded-md border'>
<Table>
<TableHeader>
{table.getHeaderGroups().map((headerGroup) => (
Expand Down Expand Up @@ -109,7 +109,7 @@ export function DataTable<TData, TValue>({
<TableRow>
<TableCell
colSpan={columns.length}
className="h-24 text-center"
className='h-24 text-center'
>
No results.
</TableCell>
Expand Down
46 changes: 23 additions & 23 deletions client/src/components/datagrids/links/links-columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ export const linksColumns: ColumnDef<z.infer<typeof LinkSchema>>[] = [
(table.getIsSomePageRowsSelected() && 'indeterminate')
}
onCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)}
aria-label="Select all"
className="translate-y-[2px]"
aria-label='Select all'
className='translate-y-[2px]'
/>
),
cell: ({ row }) => (
<Checkbox
checked={row.getIsSelected()}
onCheckedChange={(value) => row.toggleSelected(!!value)}
aria-label="Select row"
className="translate-y-[2px]"
aria-label='Select row'
className='translate-y-[2px]'
/>
),
enableSorting: false,
Expand All @@ -38,22 +38,22 @@ export const linksColumns: ColumnDef<z.infer<typeof LinkSchema>>[] = [
{
accessorKey: 'shorter_name',
header: ({ column }) => (
<DataTableColumnHeader column={column} title="Shorter Name" />
<DataTableColumnHeader column={column} title='Shorter Name' />
),
cell: ({ row }) => {
const { toast } = useToast();
return (
<div className="flex items-center space-x-2">
<div className='flex items-center space-x-2'>
<Clipboard
className="w-4"
className='w-4'
onClick={() => {
copyTextToClipboard(row.original.shorter_name);
toast({ title: 'Copied to clipboard' });
}}
/>
<span
title={row.original.shorter_name}
className="max-w-[500px] truncate font-medium"
className='max-w-[500px] truncate font-medium'
>
{row.original.shorter_name}
</span>
Expand All @@ -64,26 +64,26 @@ export const linksColumns: ColumnDef<z.infer<typeof LinkSchema>>[] = [
{
accessorKey: 'shorter_url',
header: ({ column }) => (
<DataTableColumnHeader column={column} title="Shorter URL" />
<DataTableColumnHeader column={column} title='Shorter URL' />
),
cell: ({ row }) => {
const { toast } = useToast();

const shorter_url = `${import.meta.env.VITE_API_URL}/${row.original.shorter_name}`;
return (
<div className="flex items-center space-x-2">
<div className='flex items-center space-x-2'>
<Clipboard
className="w-4"
className='w-4'
onClick={() => {
copyTextToClipboard(shorter_url);
toast({ title: 'Copied to clipboard' });
}}
/>
<span
title={row.original.shorter_name}
className="max-w-[500px] truncate font-medium"
className='max-w-[500px] truncate font-medium'
>
<a className="underline text-blue-500" href={shorter_url}>
<a className='underline text-blue-500' href={shorter_url}>
{shorter_url}
</a>
</span>
Expand All @@ -94,13 +94,13 @@ export const linksColumns: ColumnDef<z.infer<typeof LinkSchema>>[] = [
{
accessorKey: 'url',
header: ({ column }) => (
<DataTableColumnHeader column={column} title="Destination URL" />
<DataTableColumnHeader column={column} title='Destination URL' />
),
cell: ({ row }) => {
return (
<div className="flex space-x-2">
<span className="max-w-[500px] truncate font-medium">
<a className="underline text-blue-500" href={row.original.url}>
<div className='flex space-x-2'>
<span className='max-w-[500px] truncate font-medium'>
<a className='underline text-blue-500' href={row.original.url}>
{row.original.url}
</a>
</span>
Expand All @@ -111,12 +111,12 @@ export const linksColumns: ColumnDef<z.infer<typeof LinkSchema>>[] = [
{
accessorKey: 'created_at',
header: ({ column }) => (
<DataTableColumnHeader column={column} title="Created at" />
<DataTableColumnHeader column={column} title='Created at' />
),
cell: ({ row }) => {
return (
<div className="flex space-x-2">
<span className="max-w-[500px] truncate font-medium">
<div className='flex space-x-2'>
<span className='max-w-[500px] truncate font-medium'>
{row.original.created_at.toLocaleString([], {
month: '2-digit',
day: '2-digit',
Expand All @@ -133,12 +133,12 @@ export const linksColumns: ColumnDef<z.infer<typeof LinkSchema>>[] = [
{
accessorKey: 'updated_at',
header: ({ column }) => (
<DataTableColumnHeader column={column} title="Update date" />
<DataTableColumnHeader column={column} title='Update date' />
),
cell: ({ row }) => {
return (
<div className="flex space-x-2">
<span className="max-w-[500px] truncate font-medium">
<div className='flex space-x-2'>
<span className='max-w-[500px] truncate font-medium'>
{row.original.updated_at.toLocaleString([], {
month: '2-digit',
day: '2-digit',
Expand Down
20 changes: 10 additions & 10 deletions client/src/components/datagrids/links/links-table-column-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,32 +36,32 @@ export function DataTableColumnHeader<TData, TValue>({
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button
variant="ghost"
size="sm"
className="-ml-3 h-8 data-[state=open]:bg-accent"
variant='ghost'
size='sm'
className='-ml-3 h-8 data-[state=open]:bg-accent'
>
<span>{title}</span>
{column.getIsSorted() === 'desc' ? (
<ArrowDownIcon className="ml-2 h-4 w-4" />
<ArrowDownIcon className='ml-2 h-4 w-4' />
) : column.getIsSorted() === 'asc' ? (
<ArrowUpIcon className="ml-2 h-4 w-4" />
<ArrowUpIcon className='ml-2 h-4 w-4' />
) : (
<CaretSortIcon className="ml-2 h-4 w-4" />
<CaretSortIcon className='ml-2 h-4 w-4' />
)}
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="start">
<DropdownMenuContent align='start'>
<DropdownMenuItem onClick={() => column.toggleSorting(false)}>
<ArrowUpIcon className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
<ArrowUpIcon className='mr-2 h-3.5 w-3.5 text-muted-foreground/70' />
Asc
</DropdownMenuItem>
<DropdownMenuItem onClick={() => column.toggleSorting(true)}>
<ArrowDownIcon className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
<ArrowDownIcon className='mr-2 h-3.5 w-3.5 text-muted-foreground/70' />
Desc
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem onClick={() => column.toggleVisibility(false)}>
<EyeNoneIcon className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
<EyeNoneIcon className='mr-2 h-3.5 w-3.5 text-muted-foreground/70' />
Hide
</DropdownMenuItem>
</DropdownMenuContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,23 @@ export function DataTableFacetedFilter<TData, TValue>({
return (
<Popover>
<PopoverTrigger asChild>
<Button variant="outline" size="sm" className="h-8 border-dashed">
<PlusCircledIcon className="mr-2 h-4 w-4" />
<Button variant='outline' size='sm' className='h-8 border-dashed'>
<PlusCircledIcon className='mr-2 h-4 w-4' />
{title}
{selectedValues?.size > 0 && (
<>
<Separator orientation="vertical" className="mx-2 h-4" />
<Separator orientation='vertical' className='mx-2 h-4' />
<Badge
variant="secondary"
className="rounded-sm px-1 font-normal lg:hidden"
variant='secondary'
className='rounded-sm px-1 font-normal lg:hidden'
>
{selectedValues.size}
</Badge>
<div className="hidden space-x-1 lg:flex">
<div className='hidden space-x-1 lg:flex'>
{selectedValues.size > 2 ? (
<Badge
variant="secondary"
className="rounded-sm px-1 font-normal"
variant='secondary'
className='rounded-sm px-1 font-normal'
>
{selectedValues.size} selected
</Badge>
Expand All @@ -63,9 +63,9 @@ export function DataTableFacetedFilter<TData, TValue>({
.filter((option) => selectedValues.has(option.value))
.map((option) => (
<Badge
variant="secondary"
variant='secondary'
key={option.value}
className="rounded-sm px-1 font-normal"
className='rounded-sm px-1 font-normal'
>
{option.label}
</Badge>
Expand All @@ -76,7 +76,7 @@ export function DataTableFacetedFilter<TData, TValue>({
)}
</Button>
</PopoverTrigger>
<PopoverContent className="w-[200px] p-0" align="start">
<PopoverContent className='w-[200px] p-0' align='start'>
<Command>
<CommandInput placeholder={title} />
<CommandList>
Expand Down Expand Up @@ -110,11 +110,11 @@ export function DataTableFacetedFilter<TData, TValue>({
<CheckIcon className={cn('h-4 w-4')} />
</div>
{option.icon && (
<option.icon className="mr-2 h-4 w-4 text-muted-foreground" />
<option.icon className='mr-2 h-4 w-4 text-muted-foreground' />
)}
<span>{option.label}</span>
{facets?.get(option.value) && (
<span className="ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs">
<span className='ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs'>
{facets.get(option.value)}
</span>
)}
Expand All @@ -128,7 +128,7 @@ export function DataTableFacetedFilter<TData, TValue>({
<CommandGroup>
<CommandItem
onSelect={() => column?.setFilterValue(undefined)}
className="justify-center text-center"
className='justify-center text-center'
>
Clear filters
</CommandItem>
Expand Down
Loading

0 comments on commit cbf5cd9

Please sign in to comment.