removed unused files, unnecessary exports and renamed ownProps (#1225)

* remove unused files and rename ownProps

* restore unused icons
This commit is contained in:
Weiko
2023-08-15 17:02:02 -07:00
committed by GitHub
parent c9549c3833
commit aa1f9bcab3
41 changed files with 117 additions and 543 deletions

View File

@ -7,9 +7,10 @@ import { stringToHslColor } from '~/utils/string-to-hsl';
import { getImageAbsoluteURIOrBase64 } from '../utils/getProfilePictureAbsoluteURI';
export type AvatarType = 'squared' | 'rounded';
export type AvatarSize = 'xl' | 'lg' | 'md' | 'sm' | 'xs';
type OwnProps = {
export type AvatarProps = {
avatarUrl: string | null | undefined;
size: AvatarSize;
placeholder: string;
@ -17,7 +18,7 @@ type OwnProps = {
type?: AvatarType;
};
export const StyledAvatar = styled.div<OwnProps & { colorId: string }>`
const StyledAvatar = styled.div<AvatarProps & { colorId: string }>`
align-items: center;
background-color: ${({ avatarUrl, colorId }) =>
!isNonEmptyString(avatarUrl) ? stringToHslColor(colorId, 75, 85) : 'none'};
@ -86,7 +87,7 @@ export function Avatar({
placeholder,
colorId = placeholder,
type = 'squared',
}: OwnProps) {
}: AvatarProps) {
const noAvatarUrl = !isNonEmptyString(avatarUrl);
const [isInvalidAvatarUrl, setIsInvalidAvatarUrl] = useState(false);

View File

@ -1,12 +1,12 @@
import { EntityChip } from '@/ui/chip/components/EntityChip';
export type UserChipPropsType = {
export type UserChipProps = {
id: string;
name: string;
pictureUrl?: string;
};
export function UserChip({ id, name, pictureUrl }: UserChipPropsType) {
export function UserChip({ id, name, pictureUrl }: UserChipProps) {
return (
<EntityChip
entityId={id}

View File

@ -6,7 +6,7 @@ import { Entity } from '@/ui/input/relation-picker/types/EntityTypeForSelect';
import { useRecoilScopedState } from '@/ui/utilities/recoil-scope/hooks/useRecoilScopedState';
import { useSearchUserQuery } from '~/generated/graphql';
export type OwnProps = {
export type UserPickerProps = {
userId: string;
onSubmit: (newUser: EntityForSelect | null) => void;
onCancel?: () => void;
@ -17,7 +17,12 @@ type UserForSelect = EntityForSelect & {
entityType: Entity.User;
};
export function UserPicker({ userId, onSubmit, onCancel, width }: OwnProps) {
export function UserPicker({
userId,
onSubmit,
onCancel,
width,
}: UserPickerProps) {
const [searchFilter] = useRecoilScopedState(
relationPickerSearchFilterScopedState,
);