aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/user/UserInfoCard.tsx
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-06-04 00:18:50 +0800
committercrupest <crupest@outlook.com>2020-06-04 00:18:50 +0800
commit3aa87cc26fd58836b82c067b58a47e08e30a7784 (patch)
treeba9cf1918d210896ab10bed484a8ddf7c7935e0c /Timeline/ClientApp/src/user/UserInfoCard.tsx
parent1e90a93049cd57098608de72f02bfaabfadd32b6 (diff)
downloadtimeline-3aa87cc26fd58836b82c067b58a47e08e30a7784.tar.gz
timeline-3aa87cc26fd58836b82c067b58a47e08e30a7784.tar.bz2
timeline-3aa87cc26fd58836b82c067b58a47e08e30a7784.zip
refactor(front): Make codes lint-clean!
Diffstat (limited to 'Timeline/ClientApp/src/user/UserInfoCard.tsx')
-rw-r--r--Timeline/ClientApp/src/user/UserInfoCard.tsx20
1 files changed, 5 insertions, 15 deletions
diff --git a/Timeline/ClientApp/src/user/UserInfoCard.tsx b/Timeline/ClientApp/src/user/UserInfoCard.tsx
index 280cddce..3f812a8b 100644
--- a/Timeline/ClientApp/src/user/UserInfoCard.tsx
+++ b/Timeline/ClientApp/src/user/UserInfoCard.tsx
@@ -39,6 +39,7 @@ const UserInfoCard: React.FC<UserInfoCardProps> = (props) => {
props.timeline.owner._links.avatar
);
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const containerRef = React.useRef<HTMLDivElement>(null!);
const notifyHeight = React.useCallback((): void => {
@@ -59,17 +60,6 @@ const UserInfoCard: React.FC<UserInfoCardProps> = (props) => {
(): void => setManageDropdownOpen((old) => !old),
[]
);
- const onManageProperty = React.useCallback(
- (): void => onManage!('property'),
- [onManage]
- );
- const onManageAvatar = React.useCallback((): void => onManage!('avatar'), [
- onManage,
- ]);
- const onManageNickname = React.useCallback(
- (): void => onManage!('nickname'),
- [onManage]
- );
return (
<div
@@ -93,19 +83,19 @@ const UserInfoCard: React.FC<UserInfoCardProps> = (props) => {
{t(timelineVisibilityTooltipTranslationMap[props.timeline.visibility])}
</small>
<div className="text-right mt-2">
- {props.onManage != null ? (
+ {onManage != null ? (
<Dropdown isOpen={manageDropdownOpen} toggle={toggleManageDropdown}>
<DropdownToggle outline color="primary">
{t('timeline.manage')}
</DropdownToggle>
<DropdownMenu>
- <DropdownItem onClick={onManageNickname}>
+ <DropdownItem onClick={() => onManage('nickname')}>
{t('timeline.manageItem.nickname')}
</DropdownItem>
- <DropdownItem onClick={onManageAvatar}>
+ <DropdownItem onClick={() => onManage('avatar')}>
{t('timeline.manageItem.avatar')}
</DropdownItem>
- <DropdownItem onClick={onManageProperty}>
+ <DropdownItem onClick={() => onManage('property')}>
{t('timeline.manageItem.property')}
</DropdownItem>
<DropdownItem onClick={props.onMember}>