chore: lint with tabwidth: 2

This commit is contained in:
2023-12-28 12:05:50 +01:00
parent 53be7b5e15
commit d12769107c
78 changed files with 2378 additions and 2414 deletions

View File

@@ -1,5 +1,3 @@
module.exports = {
...require('@it-incubator/prettier-config'),
tabWidth: 4,
//override settings here
}

View File

@@ -11,9 +11,7 @@ const SvgComponent = (props: SVGProps<SVGSVGElement>, ref: Ref<SVGSVGElement>) =
>
<g clipPath={'url(#clip0_5928_3055)'}>
<path
d={
'M10.2733 11.06L7.21998 8L10.2733 4.94L9.33331 4L5.33331 8L9.33331 12L10.2733 11.06Z'
}
d={'M10.2733 11.06L7.21998 8L10.2733 4.94L9.33331 4L5.33331 8L9.33331 12L10.2733 11.06Z'}
fill={'white'}
/>
</g>

View File

@@ -11,9 +11,7 @@ const SvgComponent = (props: SVGProps<SVGSVGElement>, ref: Ref<SVGSVGElement>) =
>
<g clipPath={'url(#clip0_5928_3027)'}>
<path
d={
'M5.72665 11.06L8.77999 8L5.72665 4.94L6.66665 4L10.6667 8L6.66665 12L5.72665 11.06Z'
}
d={'M5.72665 11.06L8.77999 8L5.72665 4.94L6.66665 4L10.6667 8L6.66665 12L5.72665 11.06Z'}
fill={'white'}
/>
</g>

View File

@@ -1,21 +1,23 @@
import { SVGProps, Ref, forwardRef, memo } from "react"
const SvgComponent = (
props: SVGProps<SVGSVGElement>,
ref: Ref<SVGSVGElement>
) => (
import { Ref, SVGProps, forwardRef, memo } from 'react'
const SvgComponent = (props: SVGProps<SVGSVGElement>, ref: Ref<SVGSVGElement>) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width={24}
fill={'none'}
height={24}
fill="none"
ref={ref}
width={24}
xmlns={'http://www.w3.org/2000/svg'}
{...props}
>
<g fill="#000" clipPath="url(#a)">
<path d="M7 6a1 1 0 0 0 0-2H5a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h2a1 1 0 0 0 0-2H6V6h1Zm13.82 5.42-2.82-4a1 1 0 1 0-1.63 1.16L18.09 11H10a1 1 0 0 0 0 2h8l-1.8 2.4a1 1 0 0 0 1.6 1.2l3-4a1 1 0 0 0 .02-1.18Z" />
<g clipPath={'url(#a)'} fill={'#000'}>
<path
d={
'M7 6a1 1 0 0 0 0-2H5a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h2a1 1 0 0 0 0-2H6V6h1Zm13.82 5.42-2.82-4a1 1 0 1 0-1.63 1.16L18.09 11H10a1 1 0 0 0 0 2h8l-1.8 2.4a1 1 0 0 0 1.6 1.2l3-4a1 1 0 0 0 .02-1.18Z'
}
/>
</g>
</svg>
)
const ForwardRef = forwardRef(SvgComponent)
const Memo = memo(ForwardRef)
export default Memo

View File

@@ -38,11 +38,7 @@ export const RecoverPassword = (props: Props) => {
</Typography>
<form onSubmit={handleFormSubmitted}>
<div className={s.form}>
<ControlledTextField
control={control}
name={'email'}
placeholder={'Email'}
/>
<ControlledTextField control={control} name={'email'} placeholder={'Email'} />
</div>
<Typography className={s.instructions} variant={'body2'}>
Enter your email address and we will send you further instructions

View File

@@ -38,12 +38,7 @@ export const DeckDialog = ({
}
return (
<Dialog
{...dialogProps}
onCancel={handleCancel}
onConfirm={onSubmit}
title={'Create new deck'}
>
<Dialog {...dialogProps} onCancel={handleCancel} onConfirm={onSubmit} title={'Create new deck'}>
<form className={s.content} onSubmit={onSubmit}>
<ControlledTextField control={control} label={'Deck name'} name={'name'} />
<ControlledCheckbox

View File

@@ -72,10 +72,7 @@ export const DecksTable = ({ currentUserId, decks, onDeleteClick, onEditClick }:
<Button onClick={handleEditClick(deck.id)} variant={'icon'}>
<Edit2Outline />
</Button>
<Button
onClick={handleDeleteClick(deck.id)}
variant={'icon'}
>
<Button onClick={handleDeleteClick(deck.id)} variant={'icon'}>
<TrashOutline />
</Button>
</>

View File

@@ -1,7 +1,7 @@
import type { Meta, StoryObj } from '@storybook/react'
import { Button } from './'
import {Camera} from "@/assets";
import { Camera } from '@/assets'
const meta = {
argTypes: {
@@ -20,7 +20,11 @@ type Story = StoryObj<typeof meta>
export const Primary: Story = {
args: {
children: <>Turn Camera On <Camera/></>,
children: (
<>
Turn Camera On <Camera />
</>
),
disabled: false,
variant: 'primary',
},
@@ -61,7 +65,7 @@ export const AsLink: Story = {
args: {
as: 'button',
children: 'Link that looks like a button',
variant: 'primary',
href: 'https://google.com',
variant: 'primary',
},
}

View File

@@ -14,9 +14,6 @@ export const Button = <T extends ElementType = 'button'>(props: ButtonProps<T>)
const { as: Component = 'button', className, fullWidth, variant = 'primary', ...rest } = props
return (
<Component
className={`${s[variant]} ${fullWidth ? s.fullWidth : ''} ${className}`}
{...rest}
/>
<Component className={`${s[variant]} ${fullWidth ? s.fullWidth : ''} ${className}`} {...rest} />
)
}

View File

@@ -51,10 +51,7 @@ export const Checkbox: FC<CheckboxProps> = ({
required={required}
>
{checked && (
<CheckboxRadix.Indicator
className={classNames.indicator}
forceMount
>
<CheckboxRadix.Indicator className={classNames.indicator} forceMount>
<Check />
</CheckboxRadix.Indicator>
)}

View File

@@ -153,14 +153,7 @@ const MainPaginationButtons: FC<MainPaginationButtonsProps> = ({
return <Dots key={index} />
}
return (
<PageButton
key={index}
onClick={onClick(page)}
page={page}
selected={isSelected}
/>
)
return <PageButton key={index} onClick={onClick(page)} page={page} selected={isSelected} />
})}
</>
)

View File

@@ -25,9 +25,9 @@ export const Default = {
<TableRow>
<TableCell>Web Basic</TableCell>
<TableCell>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut sed do eiusmod tempoei usmodr sit amet, consectetur
adipiscing elit, sed do...
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut sed do eiusmod tempoei usmodr sit amet, consectetur adipiscing elit, sed
do...
</TableCell>
<TableCell>
<Typography
@@ -36,8 +36,8 @@ export const Default = {
target={'_blank'}
variant={'link1'}
>
Какая-то ссылка кудато на какой-то источник с информациейо ссылка
кудато на какой-то источник
Какая-то ссылка кудато на какой-то источник с информациейо ссылка кудато на какой-то
источник
</Typography>
</TableCell>
<TableCell>Основной</TableCell>
@@ -47,13 +47,13 @@ export const Default = {
<TableRow>
<TableCell>Web Basic</TableCell>
<TableCell>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut sed do eiusmod tempoei usmodr sit amet, consectetur
adipiscing elit, sed do...
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut sed do eiusmod tempoei usmodr sit amet, consectetur adipiscing elit, sed
do...
</TableCell>
<TableCell>
Какая-то ссылка кудато на какой-то источник с информациейо ссылка кудато
на какой-то источник
Какая-то ссылка кудато на какой-то источник с информациейо ссылка кудато на какой-то
источник
</TableCell>
<TableCell>Основной</TableCell>
<TableCell>Читать</TableCell>
@@ -68,8 +68,7 @@ export const Default = {
const data = [
{
category: 'Основной',
description:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor',
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor',
id: '01',
link: 'Какая-то ссылка кудато на какой-то источник с информациейо ссылка кудато на какой-то',
title: 'Web Basic',
@@ -77,8 +76,7 @@ const data = [
},
{
category: 'Основной',
description:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor',
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor',
id: '02',
link: 'Какая-то ссылка куда-то',
title: 'Web Basic',
@@ -86,8 +84,7 @@ const data = [
},
{
category: 'Основной',
description:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor',
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor',
id: '03',
link: 'Какая-то ссылка кудато на какой-то источник с информациейо ссылка кудато на какой-то. Какая-то ссылка кудато на какой-то источник с информациейо ссылка куда-то на какой-то',
title: 'Web Basic',

View File

@@ -119,9 +119,7 @@ export const TableHeader: FC<
{columns.map(({ key, sortable = true, title }) => (
<TableHeadCell key={key} onClick={handleSort(key, sortable)}>
{title}
{sort && sort.key === key && (
<span>{sort.direction === 'asc' ? '▲' : '▼'}</span>
)}
{sort && sort.key === key && <span>{sort.direction === 'asc' ? '▲' : '▼'}</span>}
</TableHeadCell>
))}
</TableRow>

View File

@@ -1,7 +1,6 @@
import { useState } from 'react'
import { Button, Page, Slider, TextField, Typography } from '@/components'
import { DecksTable } from '@/components'
import { Button, DecksTable, Page, Slider, TextField, Typography } from '@/components'
import { DeckDialog } from '@/components/decks/deck-dialog'
import { DeleteDeckDialog } from '@/components/decks/delete-deck-dialog'
import { Pagination } from '@/components/ui/pagination'
@@ -117,12 +116,7 @@ export const DecksPage = () => {
/>
</div>
<div className={s.filters}>
<TextField
onValueChange={setSearch}
placeholder={'Search'}
search
value={search}
/>
<TextField onValueChange={setSearch} placeholder={'Search'} search value={search} />
<Tabs onValueChange={value => setCurrentTab(value as Tab)} value={currentTab}>
<TabsList>
<TabsTrigger value={'my'}>My decks</TabsTrigger>