You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
spa_instat_tv/src/features/UserAccount/components/LogoutButton/index.tsx

52 lines
1.0 KiB

import styled, { css } from 'styled-components/macro'
import { isMobileDevice } from 'config/userAgent'
import { devices } from 'config'
import { useAuthStore } from 'features/AuthStore'
import { T9n } from 'features/T9n'
const Button = styled.button`
border: none;
background-color: transparent;
padding: 0;
cursor: pointer;
display: flex;
align-items: center;
font-weight: 500;
font-size: 1.2rem;
color: #FFFFFF;
@media ${devices.tablet} {
font-size: 2.8rem;
position: static;
}
`
const ExitIcon = styled.span`
width: 24px;
height: 24px;
background-image: url(/images/logout.svg);
background-repeat: no-repeat;
background-size: contain;
background-position: left;
margin-right: 15px;
${isMobileDevice
? css`
width: 19px;
height: 19px;
`
: ''};
`
export const LogoutButton = () => {
const { logout } = useAuthStore()
return (
<Button onClick={() => logout()} id='personal_log_out'>
<ExitIcon />
<T9n t='logout' />
</Button>
)
}