@ant-design/icons#RestFilled TypeScript Examples

The following examples show how to use @ant-design/icons#RestFilled. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DesktopUserMenu.tsx    From condo with MIT License 5 votes vote down vote up
DesktopUserMenu: React.FC = () => {
    const intl = useIntl()
    const SignInMessage = intl.formatMessage({ id: 'SignIn' })
    const GuestUsernameMessage = intl.formatMessage({ id: 'baselayout.menuheader.GuestUsername' })
    const SignOutMessage = intl.formatMessage({ id: 'SignOut' })
    const auth = useAuth()

    const userName = useMemo(() => {
        if (auth.user) {
            return formatUserName(auth.user.name)
        } else {
            return GuestUsernameMessage
        }
    }, [auth.user])

    const DropdownOverlay = (
        <StyledMenu>
            <StyledMenuItem key='signout' onClick={auth.signout}>
                <Space size={16}>
                    <RestFilled style={MENU_ICON_STYLES}/>
                    {SignOutMessage}
                </Space>
            </StyledMenuItem>
        </StyledMenu>
    )

    return (
        <UserMenuWrapper>
            {
                auth.isAuthenticated
                    ? (
                        <Dropdown overlay={DropdownOverlay} placement='bottomCenter'>
                            <UserMenuContainer>
                                <Button
                                    type='link'
                                    style={{ paddingRight: 0, color: green[6], fontSize: '12px' }}
                                    onClick={goToUserProfile}
                                >
                                    <Space size={16}>
                                        <AvatarContainer>
                                            <UserAvatar iconSize={'6px'}/>
                                        </AvatarContainer>
                                        {userName}
                                    </Space>
                                </Button>
                            </UserMenuContainer>
                        </Dropdown>
                    )
                    : <TopMenuItem onClick={goToSignin}>
                        <span className='link'>{SignInMessage}</span>
                    </TopMenuItem>
            }
        </UserMenuWrapper>
    )
}