[ESLint rule]: recoil value and setter should be named after their at… (#1402)

* Override unwanted changes

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Toledodev <rafael.toledo@engenharia.ufjf.br>
Co-authored-by: Rafael Toledo <87545086+Toledodev@users.noreply.github.com>

* Fix the tests

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Toledodev <rafael.toledo@engenharia.ufjf.br>
Co-authored-by: Rafael Toledo <87545086+Toledodev@users.noreply.github.com>

---------

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Toledodev <rafael.toledo@engenharia.ufjf.br>
Co-authored-by: Rafael Toledo <87545086+Toledodev@users.noreply.github.com>
Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com>
This commit is contained in:
gitstart-twenty
2023-09-05 11:34:11 +03:00
committed by GitHub
parent 0ec4b78aee
commit 878302dd31
52 changed files with 400 additions and 281 deletions

View File

@ -54,7 +54,8 @@ export default function NavCollapseButton({
direction = 'left',
hide,
}: CollapseButtonProps) {
const [isNavOpen, setIsNavOpen] = useRecoilState(isNavbarOpenedState);
const [isNavbarOpened, setIsNavbarOpened] =
useRecoilState(isNavbarOpenedState);
const iconSize = useIsMobile()
? navbarIconSize.mobile
@ -65,14 +66,14 @@ export default function NavCollapseButton({
{direction === 'left' ? (
<StyledCollapseButton
hide={hide}
onClick={() => setIsNavOpen(!isNavOpen)}
onClick={() => setIsNavbarOpened(!isNavbarOpened)}
>
<IconLayoutSidebarLeftCollapse size={iconSize} />
</StyledCollapseButton>
) : (
<StyledCollapseButton
hide={hide}
onClick={() => setIsNavOpen(!isNavOpen)}
onClick={() => setIsNavbarOpened(!isNavbarOpened)}
>
<IconLayoutSidebarRightCollapse size={iconSize} />
</StyledCollapseButton>

View File

@ -24,7 +24,7 @@ type NavbarProps = {
};
export function NavbarAnimatedContainer({ children }: NavbarProps) {
const isMenuOpened = useRecoilValue(isNavbarOpenedState);
const isNavbarOpened = useRecoilValue(isNavbarOpenedState);
const [, setIsNavbarSwitchingSize] = useRecoilState(
isNavbarSwitchingSizeState,
);
@ -47,8 +47,8 @@ export function NavbarAnimatedContainer({ children }: NavbarProps) {
setIsNavbarSwitchingSize(false);
}}
animate={{
width: isMenuOpened ? leftBarWidth : '0',
opacity: isMenuOpened ? 1 : 0,
width: isNavbarOpened ? leftBarWidth : '0',
opacity: isNavbarOpened ? 1 : 0,
}}
transition={{
duration: theme.animation.duration.normal,

View File

@ -49,37 +49,37 @@ function configureFront(chatId: string) {
export default function SupportChat() {
const theme = useTheme();
const user = useRecoilValue(currentUserState);
const supportChatConfig = useRecoilValue(supportChatState);
const currentUser = useRecoilValue(currentUserState);
const supportChat = useRecoilValue(supportChatState);
const [isFrontChatLoaded, setIsFrontChatLoaded] = useState(false);
useEffect(() => {
if (
supportChatConfig?.supportDriver === 'front' &&
supportChatConfig.supportFrontChatId &&
supportChat?.supportDriver === 'front' &&
supportChat.supportFrontChatId &&
!isFrontChatLoaded
) {
configureFront(supportChatConfig.supportFrontChatId);
configureFront(supportChat.supportFrontChatId);
setIsFrontChatLoaded(true);
}
if (user?.email && isFrontChatLoaded) {
if (currentUser?.email && isFrontChatLoaded) {
window.FrontChat?.('identity', {
email: user.email,
name: user.displayName,
userHash: user?.supportUserHash,
email: currentUser.email,
name: currentUser.displayName,
userHash: currentUser?.supportUserHash,
});
}
}, [
currentUser?.displayName,
currentUser?.email,
currentUser?.supportUserHash,
isFrontChatLoaded,
supportChatConfig?.supportDriver,
supportChatConfig.supportFrontChatId,
user?.displayName,
user?.email,
user?.supportUserHash,
supportChat?.supportDriver,
supportChat.supportFrontChatId,
]);
function handleSupportClick() {
if (supportChatConfig?.supportDriver === 'front') {
if (supportChat?.supportDriver === 'front') {
window.FrontChat?.('show');
}
}