Skip to content

Commit 12bded0

Browse files
authored
Merge pull request #848 from amitamrutiya/fix-build
make visibility chip smaller and fix build failed issue
2 parents 01d06d5 + dd6270e commit 12bded0

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

src/constants/iconsSizes.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
// icon styles, setting general height and width properties to solves scaling and consistency problems
22

3+
export const iconXSmall = {
4+
height: 16,
5+
width: 16
6+
};
7+
38
export const iconSmall = {
49
height: 20,
510
width: 20

src/custom/UserSearchField/UserSearchField.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ const UserShareSearch: React.FC<UserSearchFieldProps> = ({
136136
<Autocomplete
137137
id="user-search-field"
138138
sx={{ width: 'auto' }}
139+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
140+
// @ts-ignore
139141
filterOptions={(x) => x}
140142
options={options}
141143
disableClearable

src/custom/VisibilityChipMenu/VisibilityChipMenu.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
22
import { Theme } from '@mui/material';
33
import { MouseEvent, useState } from 'react';
44
import { Button, Menu, MenuItem } from '../../base';
5-
import { iconSmall } from '../../constants/iconsSizes';
5+
import { iconXSmall } from '../../constants/iconsSizes';
66
import { ALICE_BLUE, CHINESE_SILVER, NOT_FOUND, styled } from '../../theme';
77

88
interface VisibilityChipMenuProps {
@@ -43,8 +43,9 @@ const StyledButton = styled(Button)(() => ({
4343
}));
4444

4545
const StyledDiv = styled('div')(({ theme, enabled }: { theme?: Theme; enabled: boolean }) => ({
46-
paddingLeft: '0.5rem',
47-
paddingRight: enabled ? '0' : '0.5rem',
46+
paddingLeft: '0.3rem',
47+
height: '1.5rem',
48+
paddingRight: enabled ? '0' : '0.3rem',
4849
borderRadius: '0.25rem',
4950
border: `1px solid ${NOT_FOUND}`,
5051
background:
@@ -55,7 +56,7 @@ const StyledDiv = styled('div')(({ theme, enabled }: { theme?: Theme; enabled: b
5556
display: 'flex',
5657
justifyContent: 'center',
5758
alignItems: 'center',
58-
width: '4.5rem',
59+
width: '3.8rem',
5960
fontSize: '0.75rem',
6061
fontFamily: theme?.typography.fontFamily
6162
}));
@@ -99,8 +100,8 @@ const VisibilityChipMenu: React.FC<VisibilityChipMenuProps> = ({
99100
data-testid={`design-visibility-${value.toLowerCase()}`}
100101
>
101102
<StyledDiv enabled={enabled}>
102-
<span>{value}</span>
103-
{enabled && <ArrowDropDownIcon {...iconSmall} />}
103+
<span style={{ fontSize: '0.7rem' }}>{value}</span>
104+
{enabled && <ArrowDropDownIcon style={{ ...iconXSmall }} />}
104105
</StyledDiv>
105106
</StyledButton>
106107

0 commit comments

Comments
 (0)