Skip to content

Commit

Permalink
aesirxio#214: improve UI
Browse files Browse the repository at this point in the history
  • Loading branch information
trangiahuy031099 committed Feb 18, 2023
1 parent dba688a commit 678e69c
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 16 deletions.
10 changes: 5 additions & 5 deletions src/components/ChooseAnAction/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React, { useMemo } from 'react';
import { Dropdown } from 'react-bootstrap';
import { useTranslation } from 'react-i18next';
import { useDamViewModel } from 'store/DamStore/DamViewModelContextProvider';

import styles from './index.module.scss';
// eslint-disable-next-line react/display-name
const CustomToggle = React.forwardRef(({ onClick }, ref) => {
const { t } = useTranslation('common');
Expand All @@ -17,9 +17,9 @@ const CustomToggle = React.forwardRef(({ onClick }, ref) => {
e.preventDefault();
onClick(e);
}}
className="d-flex align-items-center text-decoration-none cursor-pointer choose-an-action justify-content-between w-100"
className="d-flex align-items-center text-decoration-none cursor-pointer choose-an-action justify-content-between w-100 h-100 mt-n1"
>
<div className="text-body pe-3 pe-none">
<div className="pe-3 pe-none">
<p className="mb-0 text-blue-0 fw-semibold fs-14">{t('choose_an_action')}</p>
</div>
<i className="icons text-green pe-none">
Expand Down Expand Up @@ -95,15 +95,15 @@ const ChooseAction = observer(() => {
as={CustomToggle}
id="dropdown-custom-components position-relative pe-none"
></Dropdown.Toggle>
<Dropdown.Menu className="shadow border-0">
<Dropdown.Menu className="shadow border-0 w-100 border-top">
<div className="">
<ul className="list-unstyled ps-0 mb-0 list_menu_avatar">
{Action.options.map((value, index) => {
return (
<li key={index}>
<Dropdown.Item
as={'p'}
className="cursor-pointer text-body d-block rounded-1 text-decoration-none mb-0"
className={`cursor-pointer text-blue-0 d-block rounded-1 text-decoration-none mb-0 ${styles.dropdown_item}`}
onClick={value?.onSelect}
>
{t(value.label)}
Expand Down
8 changes: 8 additions & 0 deletions src/components/ChooseAnAction/index.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@import '../../scss/utils/bootstrap.scss';

.dropdown_item {
&:hover {
background-color: transparent;
color: $green !important;
}
}
3 changes: 2 additions & 1 deletion src/components/Select/customStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const customStyles = (isBorder, isShadow = true) => {

backgroundColor: 'var(--bs-white)',
cursor: 'pointer',
borderRadius: 0,
borderRadius: 5,
width: 'auto',
};
},
Expand Down Expand Up @@ -46,6 +46,7 @@ const customStyles = (isBorder, isShadow = true) => {
color: 'var(--dropdown-item-hover-color)',
backgroundColor: 'var(--dropdown-item-hover-bg)',
},
fontWeight: state.isSelected ? 600 : 400,
};
},
indicatorSeparator: () => ({ display: 'none' }),
Expand Down
2 changes: 1 addition & 1 deletion src/components/Table/Thumb.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const FakeThumb = observer(({ id, index, isList }) => {
className={`position-absolute top-0 start-0 w-100 h-100 pe-none user-select-none ${
isSelect ? 'border border-success bg-gray-dark' : ''
} ${checkBorderBottom ? 'border-bottom-0' : ''} ${checkBorderTop ? 'border-top-0' : ''} ${
isList && isSelect ? 'bg-success-10' : ''
isList && isSelect ? 'bg-success-05' : ''
}`}
></span>
);
Expand Down
12 changes: 7 additions & 5 deletions src/components/Table/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ const Table = ({
</div>
{listViewModel?.damLinkFolder.split('/').length > 1 && (
<div
className={`col_thumb ${styles.col_thumb} col-${
className={`col_thumb ${styles.col_thumb_folder} col-${
!thumbColumnsNumber ? '3' : thumbColumnsNumber
} mb-4 zindex-2`}
>
Expand All @@ -319,7 +319,7 @@ const Table = ({
</div>
{index === 0 && listViewModel?.damLinkFolder.split('/').length > 1 && (
<div
className={`col_thumb ${styles.col_thumb} col-${
className={`col_thumb ${styles.col_thumb_folder} col-${
!thumbColumnsNumber ? '3' : thumbColumnsNumber
} mb-4 zindex-2`}
>
Expand All @@ -337,9 +337,11 @@ const Table = ({
)}
<Thumb
{...row.getRowProps()}
className={`col_thumb ${styles.col_thumb} col-${
!thumbColumnsNumber ? '3' : thumbColumnsNumber
} mb-4 zindex-2`}
className={`col_thumb ${
!isList && !row.original[DAM_ASSETS_FIELD_KEY.TYPE]
? styles.col_thumb_folder
: styles.col_thumb
} col-${!thumbColumnsNumber ? '3' : thumbColumnsNumber} mb-4 zindex-2`}
newRowCells={newRowCells}
index={index}
row={row}
Expand Down
4 changes: 3 additions & 1 deletion src/components/Table/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
display: none !important;
}
}

.col_thumb_folder {
height: 220px;
}
.col_thumb {
height: 248px;
}
Expand Down
2 changes: 1 addition & 1 deletion src/scss/utils/utilities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ $utilities: map-merge(
'red-2': rgba($red, 0.15),
'transparent': transparent,
'sidebar': #0c1215,
'success-10': rgba($success, 0.1),
'success-05': rgba($success, 0.05),
)
),
),
Expand Down
2 changes: 1 addition & 1 deletion src/scss/utils/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ $form-check-radio-checked-bg-image: url("data:image/svg+xml,<svg xmlns='http://w
// for react-select
:root {
--dropdown-item-hover-color: #1ab394;
--dropdown-item-hover-bg: #e8e9ec;
// --dropdown-item-hover-bg: #e8e9ec;
--view-active-bg: #e8e9ec;
--text-title-color: $color-blue;
--dropdown-bg: #fff;
Expand Down
2 changes: 1 addition & 1 deletion src/store/DamStore/DamListViewModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DamListViewModel {
'filter[search]': '',
};

isList = true;
isList = false;
damIdsSelected = null;
isSearch = false;
subscription = null;
Expand Down

0 comments on commit 678e69c

Please sign in to comment.