mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
added new flow presets
This commit is contained in:
parent
4e5a6d727a
commit
5cd1064140
18 changed files with 64 additions and 45 deletions
|
@ -3,24 +3,22 @@ import React, { forwardRef, useCallback } from 'react';
|
|||
import classNames from 'classnames';
|
||||
|
||||
import { Square } from '~/components/common/Square';
|
||||
import { PRESETS } from '~/constants/urls';
|
||||
import { ImagePresets } from '~/constants/urls';
|
||||
import { getURLFromString } from '~/utils/dom';
|
||||
import { DivProps } from '~/utils/types';
|
||||
import { openUserProfile } from '~/utils/user';
|
||||
|
||||
import styles from './styles.module.scss';
|
||||
|
||||
|
||||
|
||||
interface Props extends DivProps {
|
||||
url?: string;
|
||||
username?: string;
|
||||
size?: number;
|
||||
preset?: typeof PRESETS[keyof typeof PRESETS];
|
||||
preset?: typeof ImagePresets[keyof typeof ImagePresets];
|
||||
}
|
||||
|
||||
const Avatar = forwardRef<HTMLDivElement, Props>(
|
||||
({ url, username, size, className, preset = PRESETS.avatar, ...rest }, ref) => {
|
||||
({ url, username, size, className, preset = ImagePresets.avatar, ...rest }, ref) => {
|
||||
const onOpenProfile = useCallback(() => openUserProfile(username), [username]);
|
||||
|
||||
return (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue