Skip to content

Commit

Permalink
Big refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
sonic16x committed Nov 30, 2024
1 parent 1920b5e commit d3f19db
Show file tree
Hide file tree
Showing 255 changed files with 2,972 additions and 2,736 deletions.
4 changes: 4 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ export default [{
"no-console": "error",
"import/first": "off",
"react/react-in-jsx-scope": "off",
"quotes": [2, "single", { "avoidEscape": true }],
"no-useless-escape": "off",
"no-duplicate-imports": "error",
"no-fallthrough": "off",
"no-misleading-character-class": "off",
"react/prop-types": "off",
Expand All @@ -79,6 +81,8 @@ export default [{
}],

"eol-last": ["error", "always"],
"max-len": ["error", 120],
"semi": ["error", "never"],
"newline-before-return": ["error"],

indent: ["error", 4, {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"storybook": "storybook dev -p 6006",
"test:pw": "playwright test",
"test:unit": "jest --logHeapUsage --coverage --config jest-config.json",
"test:dictionary": "cross-env NODE_ENV=production UPDATE_SNAPSHOT=false ts-node -r tsconfig-paths/register ./src/services/dictionary-test",
"test:dictionary-update-shanshot": "cross-env NODE_ENV=production UPDATE_SNAPSHOT=false ts-node -r tsconfig-paths/register ./src/services/dictionary-test"
"test:dictionary": "cross-env NODE_ENV=production UPDATE_SNAPSHOT=false tsx -r tsconfig-paths/register ./src/services/dictionary-test",
"test:dictionary-update-shanshot": "cross-env NODE_ENV=production UPDATE_SNAPSHOT=false tsx -r tsconfig-paths/register ./src/services/dictionary-test"
},
"pre-commit": [
"lint:fix",
Expand Down
50 changes: 25 additions & 25 deletions src/actions/actions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IModalDialog } from 'reducers';
import { IModalDialog } from 'reducers'

export enum ActionTypes {
LANG = 'LANG',
Expand Down Expand Up @@ -32,165 +32,165 @@ export function langAction(data: {from: string, to: string}) {
return {
type: ActionTypes.LANG,
data,
};
}
}

export function showModalDialog(data: IModalDialog) {
return {
type: ActionTypes.SHOW_MODAL_DIALOG,
data,
};
}
}

export function hideModalDialog() {
return {
type: ActionTypes.HIDE_MODAL_DIALOG,
};
}
}

export function setNotificationAction(data) {
return {
type: ActionTypes.SET_NOTIFICATION,
data,
};
}
}

export function setAlphabetTypeAction(data: number) {
return {
type: ActionTypes.ALPHABET_TYPE,
data,
};
}
}

export function setSearchExpand(data) {
return {
type: ActionTypes.SET_SEARCH_EXPAND,
data,
};
}
}

export function fromTextAction(data: string) {
return {
type: ActionTypes.FROM_TEXT,
data,
};
}
}

export function searchTypeAction(data: string) {
return {
type: ActionTypes.SEARCH_TYPE,
data,
};
}
}

export function changeCardViewAction() {
return {
type: ActionTypes.CHANGE_CARD_VIEW,
};
}
}

export function flavorisationTypeAction(data: string) {
return {
type: ActionTypes.FLAVORISATION_TYPE,
data,
};
}
}

export function setPageAction(data: string) {
return {
type: ActionTypes.SET_PAGE,
data,
};
}
}

export function isLoadingAction(data: boolean) {
return {
type: ActionTypes.IS_LOADING,
data,
};
}
}

export function loadingProgressAction(data: number) {
return {
type: ActionTypes.LOADING_PROGRESS,
data,
};
}
}

export function setInterfaceLang(data: string) {
return {
type: ActionTypes.SET_INTERFACE_LANG,
data,
};
}
}

export function changeIsvSearchLetters(data: string) {
return {
type: ActionTypes.CHANGE_ISV_SEARCH_LETTERS,
data,
};
}
}

export function changeIsvSearchByWordForms(data: boolean) {
return {
type: ActionTypes.CHANGE_ISV_SEARCH_BY_WORDFORMS,
data,
};
}
}

export function posFilterAction(data: string) {
return {
type: ActionTypes.POS_FILTER,
data,
};
}
}

export function runSearch() {
return {
type: ActionTypes.RUN_SEARCH,
};
}
}

export function setAlphabets(data) {
return {
type: ActionTypes.SET_ALPHABETS,
data,
};
}
}

export function changeOrderOfCases(data) {
return {
type: ActionTypes.CHANGE_ORDER_OF_CASES,
data,
};
}
}

export function changeCaseQuestions(data) {
return {
type: ActionTypes.CHANGE_CASE_QUESTIONS,
data,
};
}
}

export function changeDictionaryLangAction(data) {
return {
type: ActionTypes.DICTIONARY_LANGUAGES,
data,
};
}
}

export function togglePage(data) {
return {
type: ActionTypes.TOGGLE_PAGE,
data,
};
}
}

export function setBadges(data) {
return {
type: ActionTypes.SET_BADGES,
data,
};
}
}

export function toggleThemeAction(data: 'dark' | 'light') {
Expand Down
2 changes: 1 addition & 1 deletion src/actions/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './actions';
export * from './actions'
2 changes: 2 additions & 0 deletions src/colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ body {
--input-border-color: #E0E0E0;
--shadow: 0 8px 16px rgb(0 0 0 / 5%);
--border: 1px solid var(--input-border-color);
--outline: 2px solid var(--primary-color);
--table-highlighted-cell: #81D4FA;
--table-border-color: var(--gray-9);
--overlay-color: #000;
Expand All @@ -50,6 +51,7 @@ body {
--input-border-color: #444;
--shadow: 0 8px 16px rgb(0 0 0 / 5%);
--border: 1px solid var(--input-border-color);
--outline: 2px solid var(--primary-color);
--table-highlighted-cell: #1976D2;
--table-border-color: var(--gray-9);
--overlay-color: #000;
Expand Down
26 changes: 13 additions & 13 deletions src/components/Button/Button.stories.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button } from './Button';
import type { Meta, StoryObj } from '@storybook/react';
import { fn } from '@storybook/test';
import { Button } from './Button'
import type { Meta, StoryObj } from '@storybook/react'
import { fn } from '@storybook/test'

const meta = {
title: 'Components/Button',
Expand All @@ -13,63 +13,63 @@ const meta = {

},
args: { onClick: fn() },
} satisfies Meta<typeof Button>;
} satisfies Meta<typeof Button>

export default meta;
export default meta
type Story = StoryObj<typeof meta>;

export const Primary: Story = {
args: {
title: 'Button',
type: 'primary',
},
};
}

export const Error: Story = {
args: {
title: 'Button',
type: 'error',
},
};
}

export const Muter: Story = {
args: {
title: 'Button',
type: 'muted',
},
};
}

export const Small: Story = {
args: {
title: 'Button',
size: 'S',
},
};
}

export const Medium: Story = {
args: {
title: 'Button',
size: 'M',
},
};
}

export const Large: Story = {
args: {
title: 'Button',
size: 'L',
},
};
}

export const NotFill: Story = {
args: {
title: 'Button',
fill: false,
},
};
}

export const Disabled: Story = {
args: {
title: 'Button',
disabled: true,
},
};
}
12 changes: 6 additions & 6 deletions src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import classNames from 'classnames';
import classNames from 'classnames'

import './Button.scss';
import './Button.scss'

interface IButtonProps {
size?: 'S' | 'M' | 'L';
Expand All @@ -27,7 +27,7 @@ export const Button = (
className,
}: IButtonProps,
) => {
const clsName = classNames(['button', `button-${size}`, type, className], { disabled, fill });
const clsName = classNames(['button', `button-${size}`, type, className], { disabled, fill })

if (href) {
return (
Expand All @@ -39,7 +39,7 @@ export const Button = (
>
{title}
</a>
);
)
}

return (
Expand All @@ -50,5 +50,5 @@ export const Button = (
>
{title}
</button>
);
};
)
}
2 changes: 1 addition & 1 deletion src/components/Button/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './Button';
export * from './Button'
6 changes: 3 additions & 3 deletions src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import classNames from 'classnames';
import classNames from 'classnames'

import './Card.scss';
import './Card.scss'

interface ICardProps {
title: string;
Expand All @@ -17,4 +17,4 @@ export const Card =
{children}
</div>
</div>
);
)
2 changes: 1 addition & 1 deletion src/components/Card/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './Card';
export * from './Card'
Loading

0 comments on commit d3f19db

Please sign in to comment.