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

Icon fix #1291

Merged
merged 5 commits into from
May 16, 2024
Merged

Icon fix #1291

merged 5 commits into from
May 16, 2024

Conversation

akp111
Copy link
Collaborator

@akp111 akp111 commented May 16, 2024

Fixes Issue

Changes proposed

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • My change requires changes to the documentation.
  • I have updated the documentation accordingly.
  • This PR does not contain plagiarized content.
  • The title of my pull request is a short description of the requested changes.

Screenshots

Note to reviewers

Copy link

In the file packages/uiweb/src/lib/components/notification/index.tsx:

  1. The media query block for setting flex-direction: column; is missing curly braces {} after the condition props.offsetWidth <= 461 &&.
  2. Missing closing curly brace } for BlockchainContainer styled component after the font-weight: 700;.

Here is the corrected code snippet:

// ================= Define styled components
const MD_BREAKPOINT = '50050px'; //set an arbitrarily large number because we no longer use this breakpoint
const SM_BREAKPOINT = '900px';

const ContentSection = styled.div<CTADataType & CustomThemeProps & OffsetWidthType>`
  display: flex;
  padding: 15px 16px;
  cursor: ${(props) => (props.cta ? 'pointer' : 'default')};
  &:hover {
    background: ${(props) => (props.cta ? props?.themeObject?.color?.contentHoverBackground : 'none')};
  }
  ${(props: any) =>
    props.offsetWidth > 461 &&
    css`
      @media (min-width: ${SM_BREAKPOINT}) {
        align-items: flex-start;
        flex-direction: row;
        gap: 20px;
        justify-content: space-between;
      }
      @media (max-width: ${SM_BREAKPOINT}) {
        flex-direction: column;
      }
    `};
    ${(props: any) => props.offsetWidth <= 461 && css`flex-direction: column;`}
`;

const BlockchainContainer = styled.div`
  align-items: center;
  justify-content: center;
  font-weight: 700;
}; // Added the missing closing curly brace here

const ChainIconSVG = styled.div<OffsetWidthType>`
  width: 28px;
  height: 28px;
  svg,
  svg image,
  img {
    width: 100%;
    height: 100%;
  @media (max-width: ${SM_BREAKPOINT}) {
    width: 18px;
    height: 18px;
  }
`;

const MobileImage = styled.div<OffsetWidthType & { theme?: string }>`
  overflow: hidden;
  img,
  iframe,
  video {
    max-width: 100% !important;
    height: 100% !important;
    object-fit: fill;
    border-radius: 10px;
    border: 1px solid ${(props) => ((props.theme as unknown as string) === 'light' ? '#ededed' : '#444')};
    border-radius: 10px;
    min-width: 220px;
    width: 220px;
    height: 200px;
    display: block;
    width: 100%;
    max-height: 200px;
  }
`;

// All looks good.

In the files packages/uiweb/src/lib/icons/CyberConnect.tsx and packages/uiweb/src/lib/icons/CyberConnectSVG.tsx:

There are several typos and syntax errors in the SVG paths. The fill properties are missing colons and some paths are not enclosed properly in curly braces {}.

Here is an excerpt of corrected SVG paths:

<path
  d="M12 7.9c2.3 0 4.1 1.8 4.1 4.1s-1.9 4.1-4.1 4.1-4.1-1.8-4.1-4.1S9.8 7.9 12 7.9ZM12,0.5c-1.6,0-3.1,0.3-4.5,0.9-1.4,0.6-2.6,1.4-3.7,2.5S1.9,6.2,1.3,7.6C0.7,9,0.4,10.5,0.4,12.1S0.7,15.2,1.3,16.6c0.6,1.4,1.4,2.6,2.5,3.7s2.3,1.9,3.7,2.5c1.4,0.6,2.9,0.9,4.5,0.9s3.1-0.3,4.5-0.9c1.4-0.6,2.6-1.4,3.7-2.5s1.9-2.3,2.5-3.7c0.6-1.4,0.9-2.9,0.9-4.5s-0.3-3.1-0.9-4.5c-0.6-1.4-1.4-2.6-2.5-3.7s-2.3-1.9-3.7-2.5c-1.4-0.6-2.9-0.9-4.5-0.9Z"
  fill="#b7f7b0"
/>

<path
  d="M12 7.9c2.3 0 4.1 1.8 4.1 4.1s-1.9 4.1-4.1 4.1-4.1-1.8-4.1-4.1S9.8 7.9 12 7.9ZM12,2.9C7,2.9,2.9,7,2.9,12S7,21.1,12,21.1s9.1-4.1,9.1-9.1S17,2.9,12,2.9Z"
  fill="#07dc10"
/>

<path
  d="M12 7.9c2.3 0 4.1 1.8 4.1 4.1s-1.9 4.1-4.1 4.1-4.1-1.8-4.1-4.1S9.8 7.9 12 7.9ZM12,5.4c-3.6 0-6.6 3-6.6 6.6s3 6.6 6.6 6.6 6.6-3 6.6-6.6-3-6.6-6.6-6.6Z"
  fill="#0c9b00"
/>

<path
  d="M12 7.9c2.3 0 4.1 1.8 4.1 4.1s-1.9 4.1-4.1 4.1-4.1-1.8-4.1-4.1S9.8 7.9 12 7.9Z"
  fill="#eaeaea"
/>

In the file packages/uiweb/src/lib/icons/cyberconnect.svg:

There are several syntax errors and missing closing curly brace '}'

After the necessary corrections in the SVG paths and adding missing closing curly braces for the classes, the SVG file should look like this:

<!-- cyberconnect.svg -->
<?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24">
  <defs>
    <style>
      .cls-1 {
        fill: #eaeaea;
      }

      .cls-1, .cls-2, .cls-3, .cls-4, .cls-5 {
        stroke-width: 0px;
      }
      .cls-2 {
        fill: #0c9b00;
      }
      .cls-3 {
        fill: #07dc10;
      }
      .cls-4 {
        fill: #b7f7b0;
      }
      .cls-5 {
        fill: none;
      }
      .cls-6 {
        clip-path: url(#clippath);
    </style>
    <clipPath id="clippath">
      <rect class="cls-5" x=".4" y=".5" width="23.2" height="23.1"/>
    </clipPath>
  </defs>
  <g class="cls-6">
    <g>
      <!-- Paths with corrected fill and missing curly braces -->
    </g>
  </g>
</svg>

After correcting these mistakes, the code should be error-free.

@akp111 akp111 merged commit 69b0158 into main May 16, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants