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

make visibility chip smaller and fix build failed issue #848

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions src/constants/iconsSizes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// icon styles, setting general height and width properties to solves scaling and consistency problems

export const iconXSmall = {
height: 16,
width: 16
};

export const iconSmall = {
height: 20,
width: 20
Expand Down
2 changes: 2 additions & 0 deletions src/custom/UserSearchField/UserSearchField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ const UserShareSearch: React.FC<UserSearchFieldProps> = ({
<Autocomplete
id="user-search-field"
sx={{ width: 'auto' }}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
filterOptions={(x) => x}
options={options}
disableClearable
Expand Down
13 changes: 7 additions & 6 deletions src/custom/VisibilityChipMenu/VisibilityChipMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
import { Theme } from '@mui/material';
import { MouseEvent, useState } from 'react';
import { Button, Menu, MenuItem } from '../../base';
import { iconSmall } from '../../constants/iconsSizes';
import { iconXSmall } from '../../constants/iconsSizes';
import { ALICE_BLUE, CHINESE_SILVER, NOT_FOUND, styled } from '../../theme';

interface VisibilityChipMenuProps {
Expand Down Expand Up @@ -43,8 +43,9 @@ const StyledButton = styled(Button)(() => ({
}));

const StyledDiv = styled('div')(({ theme, enabled }: { theme?: Theme; enabled: boolean }) => ({
paddingLeft: '0.5rem',
paddingRight: enabled ? '0' : '0.5rem',
paddingLeft: '0.3rem',
height: '1.5rem',
paddingRight: enabled ? '0' : '0.3rem',
borderRadius: '0.25rem',
border: `1px solid ${NOT_FOUND}`,
background:
Expand All @@ -55,7 +56,7 @@ const StyledDiv = styled('div')(({ theme, enabled }: { theme?: Theme; enabled: b
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
width: '4.5rem',
width: '3.8rem',
fontSize: '0.75rem',
fontFamily: theme?.typography.fontFamily
}));
Expand Down Expand Up @@ -99,8 +100,8 @@ const VisibilityChipMenu: React.FC<VisibilityChipMenuProps> = ({
data-testid={`design-visibility-${value.toLowerCase()}`}
>
<StyledDiv enabled={enabled}>
<span>{value}</span>
{enabled && <ArrowDropDownIcon {...iconSmall} />}
<span style={{ fontSize: '0.7rem' }}>{value}</span>
{enabled && <ArrowDropDownIcon style={{ ...iconXSmall }} />}
</StyledDiv>
</StyledButton>

Expand Down
Loading