Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] : not parsing component right #291

Open
ExLineP opened this issue Aug 19, 2024 · 0 comments
Open

[BUG] : not parsing component right #291

ExLineP opened this issue Aug 19, 2024 · 0 comments

Comments

@ExLineP
Copy link

ExLineP commented Aug 19, 2024

i have a test function and this library cant parse it right, breaking code and not changing WrapperBanner to tailwind.

import { useCallback, memo } from "react";
import styled from "styled-components";
import { useRouter } from "@happysanta/router";
import { Icon24DismissDark } from "@vkontakte/icons";

import { WORKER_RESUME_PAGE } from "router";
import { Button } from "@vkontakte/vkui";

interface BannerInterface {
  handleClose: (toogle: boolean) => void;
}

function Banner({ handleClose }: BannerInterface) {
  const router = useRouter();

  const handleCloseBanner = useCallback(() => {
    handleClose(false);
    const resumeBannerClose = localStorage.getItem("resumeBannerClose");
    if (resumeBannerClose) {
      return;
    }
    localStorage.setItem("resumeBannerClose", "1");
  }, [handleClose]);

  return (
    <WrapperBanner>
      <Wrapper>
        <Description>
          <Title>test</Title>
          <SubTitle>test</SubTitle>
        </Description>
        <Button appearance="neutral" mode="primary" size="s" onClick={() => router.pushPage(WORKER_RESUME_PAGE)}>
        test
        </Button>
      </Wrapper>
      <Icon24DismissDark style={{ cursor: "pointer" }} onClick={handleCloseBanner} />
    </WrapperBanner>
  );
}

const WrapperBanner = styled("div")`
  background-color: var(--vkui--color_text_link_tint--active);
  padding: 12px 16px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
`;

const Wrapper = styled("div")`
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
`;

const Description = styled("div")`
  max-width: 270px;
  display: flex;
  flex-direction: column;
  gap: 2px;
`;

const Title = styled("div")`
  color: var(--vkui--color_background_content);
  font-size: 16px;
  font-weight: semibold;
`;

const SubTitle = styled("div")`
  color: #d2e3f8;
  font-size: 13px;
`;

export default memo(Banner);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant