From 8e769597795daa8337823f9b843caa4995f1d799 Mon Sep 17 00:00:00 2001 From: bakhirev Date: Sat, 10 Aug 2024 21:25:36 +0300 Subject: [PATCH] update --- public/assets/list/arrow.svg | 2 +- .../CustomSelect/components/Icon.tsx | 31 +++++++++++++++++++ src/ts/components/CustomSelect/index.tsx | 6 ++++ .../CustomSelect/styles/icon.module.scss | 28 +++++++++++++++++ .../CustomSelect/styles/index.module.scss | 4 +++ .../UiKit/styles/button.module.scss | 12 ++++--- .../components/UiKit/styles/index.module.scss | 6 ++-- .../UiKit/styles/switch.module.scss | 2 +- 8 files changed, 82 insertions(+), 9 deletions(-) create mode 100644 src/ts/components/CustomSelect/components/Icon.tsx create mode 100644 src/ts/components/CustomSelect/styles/icon.module.scss diff --git a/public/assets/list/arrow.svg b/public/assets/list/arrow.svg index 45c385d..da2cee8 100644 --- a/public/assets/list/arrow.svg +++ b/public/assets/list/arrow.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/src/ts/components/CustomSelect/components/Icon.tsx b/src/ts/components/CustomSelect/components/Icon.tsx new file mode 100644 index 0000000..d97b9d7 --- /dev/null +++ b/src/ts/components/CustomSelect/components/Icon.tsx @@ -0,0 +1,31 @@ +import React from 'react'; + +import style from '../styles/icon.module.scss'; + +interface UiKitSelectIconProps { + openSearch: boolean; + setOpenSearch: Function; +} + +function UiKitSelectIcon({ + openSearch, + setOpenSearch, +}: UiKitSelectIconProps) { + const className = [style.ui_kit_select_icon_button]; + if (openSearch) { + className.push(style.ui_kit_select_icon_button_open); + } + + return ( +
+ setOpenSearch(!openSearch)} + /> +
+ ); +} + + +export default UiKitSelectIcon; diff --git a/src/ts/components/CustomSelect/index.tsx b/src/ts/components/CustomSelect/index.tsx index 566a8f7..2c502ab 100644 --- a/src/ts/components/CustomSelect/index.tsx +++ b/src/ts/components/CustomSelect/index.tsx @@ -3,6 +3,7 @@ import React, { useMemo, useState } from 'react'; import UiKitSelectValue from './components/Value'; import UiKitSelectSearch from './components/Search'; import UiKitSelectList from './components/List'; +import UiKitSelectIcon from './components/Icon'; import { getOption, getTitle } from './helpers'; import style from './styles/index.module.scss'; @@ -55,6 +56,11 @@ function UiKitSelect({ /> ) : null} + + {openSearch ? (