Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review #2

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72,337 changes: 36,162 additions & 36,175 deletions package-lock.json

Large diffs are not rendered by default.

190 changes: 97 additions & 93 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,95 +1,99 @@
{
"name": "blog-customizer",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"devDependencies": {
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
"@storybook/addon-essentials": "^7.6.10",
"@storybook/addon-interactions": "^7.6.10",
"@storybook/addon-links": "^7.6.10",
"@storybook/addon-onboarding": "^1.0.10",
"@storybook/addon-styling-webpack": "^0.0.6",
"@storybook/blocks": "^7.6.10",
"@storybook/react": "^7.6.10",
"@storybook/react-webpack5": "^7.6.10",
"@storybook/test": "^7.6.10",
"@svgr/webpack": "^8.0.1",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.1",
"@typescript-eslint/eslint-plugin": "^5.59.11",
"@typescript-eslint/parser": "^5.59.11",
"autoprefixer": "^10.4.14",
"clean-webpack-plugin": "^4.0.0",
"commitizen": "^4.3.0",
"cross-env": "^7.0.3",
"css-loader": "^6.8.1",
"cssnano": "^6.0.1",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"html-webpack-plugin": "^5.5.1",
"husky": "^8.0.3",
"lint-staged": "^13.2.2",
"merge": "^2.1.1",
"mini-css-extract-plugin": "^2.7.6",
"postcss-loader": "^7.3.3",
"prettier": "^2.8.8",
"react-refresh": "^0.14.0",
"resolve-url-loader": "^5.0.0",
"sass": "^1.69.7",
"sass-loader": "^13.3.3",
"storybook": "^7.6.10",
"style-loader": "^3.3.3",
"stylelint": "^16.1.0",
"stylelint-config-standard-scss": "^13.0.0",
"stylelint-order": "^6.0.3",
"ts-loader": "^9.4.3",
"typescript": "^5.0.4",
"typescript-plugin-css-modules": "^5.0.1",
"url-loader": "^4.1.1",
"webpack": "^5.81.0",
"webpack-cli": "^5.0.2",
"webpack-dev-server": "^4.15.0"
},
"scripts": {
"build": "cross-env NODE_ENV=production webpack --config webpack/webpack.config.js --env env=prod",
"start": "webpack serve --config webpack/webpack.config.js --env env=dev",
"stylelint": "stylelint \"src/**/*.scss\"",
"stylelint:fix": "stylelint \"src/**/*.scss\" --fix",
"lint": "eslint --fix \"./src/**/*.{js,jsx,ts,tsx,json}\"",
"format": "prettier --write \"./src/**/*.{js,jsx,ts,tsx,json,css,scss,md}\" --ignore-path ./.prettierignore",
"test": "npm run stylelint:fix && npm run lint && npm run format",
"prepare": "husky install",
"commit": "npm run test && cz",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"eslintConfig": {
"extends": [
"plugin:storybook/recommended"
]
},
"dependencies": {
"clsx": "^2.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"lint-staged": {
"*.{css,scss}": "yarn stylelint:fix",
"*.{js,jsx,ts,tsx}": "yarn lint",
"*.{js,jsx,ts,tsx,json,css,scss,md}": "yarn format"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"homepage": "./"
"name": "blog-customizer",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"devDependencies": {
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
"@storybook/addon-essentials": "^7.6.10",
"@storybook/addon-interactions": "^7.6.10",
"@storybook/addon-links": "^7.6.10",
"@storybook/addon-onboarding": "^1.0.10",
"@storybook/addon-styling-webpack": "^0.0.6",
"@storybook/blocks": "^7.6.10",
"@storybook/react": "^7.6.10",
"@storybook/react-webpack5": "^7.6.10",
"@storybook/test": "^7.6.10",
"@svgr/webpack": "^8.0.1",
"@types/node": "^20.12.7",
"@types/react": "^18.2.79",
"@types/react-dom": "^18.2.25",
"@typescript-eslint/eslint-plugin": "^5.59.11",
"@typescript-eslint/parser": "^5.59.11",
"autoprefixer": "^10.4.14",
"clean-webpack-plugin": "^4.0.0",
"commitizen": "^4.3.0",
"cross-env": "^7.0.3",
"css-loader": "^6.8.1",
"cssnano": "^6.0.1",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"html-webpack-plugin": "^5.5.1",
"husky": "^8.0.3",
"lint-staged": "^13.2.2",
"merge": "^2.1.1",
"mini-css-extract-plugin": "^2.7.6",
"postcss-loader": "^7.3.3",
"prettier": "^2.8.8",
"react-refresh": "^0.14.0",
"resolve-url-loader": "^5.0.0",
"sass": "^1.69.7",
"sass-loader": "^13.3.3",
"storybook": "^7.6.10",
"style-loader": "^3.3.3",
"stylelint": "^16.1.0",
"stylelint-config-standard-scss": "^13.0.0",
"stylelint-order": "^6.0.3",
"ts-loader": "^9.5.1",
"typescript": "^5.4.5",
"typescript-plugin-css-modules": "^5.0.1",
"url-loader": "^4.1.1",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.0"
},
"scripts": {
"build": "cross-env NODE_ENV=production webpack --config webpack/webpack.config.js --env env=prod",
"start": "webpack serve --config webpack/webpack.config.js --env env=dev",
"stylelint": "stylelint \"src/**/*.scss\"",
"stylelint:fix": "stylelint \"src/**/*.scss\" --fix",
"lint": "eslint --fix \"./src/**/*.{js,jsx,ts,tsx,json}\"",
"format": "prettier --write \"./src/**/*.{js,jsx,ts,tsx,json,css,scss,md}\" --ignore-path ./.prettierignore",
"test": "npm run stylelint:fix && npm run lint && npm run format",
"prepare": "husky install",
"commit": "npm run test && cz",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"eslintConfig": {
"extends": [
"plugin:storybook/recommended"
]
},
"dependencies": {
"clsx": "^2.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"lint-staged": {
"*.{css,scss}": "yarn stylelint:fix",
"*.{js,jsx,ts,tsx}": "yarn lint",
"*.{js,jsx,ts,tsx,json,css,scss,md}": "yarn format"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"homepage": "http://./",
"description": "[Макет проекта](https://www.figma.com/file/FEeiiGLOsE7ktXbPpBxYoD/Custom-dropdown?type=design&node-id=0%3A1&mode=design&t=eXRJnWC6Xsuw0qR4-1)",
"keywords": [],
"author": ""
}
9 changes: 9 additions & 0 deletions src/components/arrow-button/ArrowButton.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
transition: transform 0.5s ease;
}

.container:hover {
background-color: #ffc802;
}

.container:active {
background-color: #787878;
}

.container_open {
transform: translate(616px);
}
Expand All @@ -27,4 +35,5 @@

.arrow_open {
transform: rotate(0deg);
transition: transform 0.5s ease;
}
4 changes: 2 additions & 2 deletions src/components/arrow-button/ArrowButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ export default meta;
type Story = StoryObj<typeof ArrowButton>;

export const ArrowButtonStory: Story = {
render: () => {
render: ({ onClick, isOpen }) => {
return (
<>
<ArrowButton />
<ArrowButton onClick={onClick} isOpen={isOpen} />
</>
);
},
Expand Down
35 changes: 30 additions & 5 deletions src/components/arrow-button/ArrowButton.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,44 @@
import arrow from 'src/images/arrow.svg';

import styles from './ArrowButton.module.scss';
import { SyntheticEvent, useState } from 'react';
import { clsx } from 'clsx';

/** Функция для обработки открытия/закрытия формы */
export type OnClick = () => void;
export type TArrowButtonProps = {
onClick: (evt: SyntheticEvent) => void;
isOpen: boolean;
};

export const ArrowButton = ({ onClick, isOpen }: TArrowButtonProps) => {
const [isHovering, setIsHovering] = useState(false);

const handleMouseEnter = () => {
setIsHovering(true);
};

const handleMouseLeave = () => {
setIsHovering(false);
};

export const ArrowButton = () => {
return (
/* Не забываем указаывать role и aria-label атрибуты для интерактивных элементов */
<div
role='button'
aria-label='Открыть/Закрыть форму параметров статьи'
tabIndex={0}
className={styles.container}>
<img src={arrow} alt='иконка стрелочки' className={styles.arrow} />
className={clsx(styles.container, { [styles.container_open]: isOpen })}
onClick={onClick}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
style={{ cursor: `${isHovering ? `pointer` : `default`}` }}>
<img
src={arrow}
alt='иконка стрелочки'
className={clsx({
[styles.arrow]: !isOpen,
[styles.arrow_open]: isOpen,
})}
/>
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
padding: 50px 31px;
background-color: #ffffff;
border-right: 1px solid #000000;
gap: 50px;
}

.bottomContainer {
display: flex;
justify-content: space-between;
margin-top: auto;
margin-top: 157px;
}
Loading
Loading