mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-14 04:08:32 +03:00
Possible small optimization for name-text
This commit is contained in:
parent
8018d06cdf
commit
fea1d77342
1 changed files with 4 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
|||
import './name-text.css';
|
||||
|
||||
import { memo } from 'preact/compat';
|
||||
|
||||
import states from '../utils/states';
|
||||
|
||||
import Avatar from './avatar';
|
||||
|
@ -43,6 +45,7 @@ function NameText({
|
|||
onClick={(e) => {
|
||||
if (external) return;
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
if (onClick) return onClick(e);
|
||||
states.showAccount = {
|
||||
account,
|
||||
|
@ -85,4 +88,4 @@ function NameText({
|
|||
);
|
||||
}
|
||||
|
||||
export default NameText;
|
||||
export default memo(NameText);
|
||||
|
|
Loading…
Add table
Reference in a new issue