mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
style(console): username (#3025)
This commit is contained in:
parent
28023a5f26
commit
7d89a55a7c
2 changed files with 19 additions and 5 deletions
|
@ -4,13 +4,22 @@
|
|||
font: var(--body-medium);
|
||||
color: var(--color-text);
|
||||
|
||||
.userId {
|
||||
.title {
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
@include _.text-ellipsis;
|
||||
margin-right: _.unit(1);
|
||||
}
|
||||
|
||||
.id {
|
||||
display: inline-block;
|
||||
font: var(--body-small);
|
||||
color: var(--color-text-secondary);
|
||||
margin-left: _.unit(1);
|
||||
@include _.text-ellipsis;
|
||||
}
|
||||
|
||||
.link {
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
color: var(--color-text-link);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import type { User } from '@logto/schemas';
|
||||
import classNames from 'classnames';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Link } from 'react-router-dom';
|
||||
import useSWR from 'swr';
|
||||
|
@ -26,13 +27,17 @@ const UserName = ({ userId, isLink = false }: Props) => {
|
|||
return (
|
||||
<div className={styles.userName}>
|
||||
{isLink ? (
|
||||
<Link to={`/users/${userId}`} target="_blank" className={styles.link}>
|
||||
<Link
|
||||
to={`/users/${userId}`}
|
||||
target="_blank"
|
||||
className={classNames(styles.title, styles.link)}
|
||||
>
|
||||
{name}
|
||||
</Link>
|
||||
) : (
|
||||
<span>{name}</span>
|
||||
<div className={styles.title}>{name}</div>
|
||||
)}
|
||||
<span className={styles.userId}>{userId}</span>
|
||||
<div className={styles.id}>{userId}</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue