Skip to content

[React components] Consider organizing consequtive <Image> components within an <ImageSpan> #1640

@novusnota

Description

@novusnota

That is, instead of the following:

<div
  style={{ display: "flex", justifyContent: "center", gap: "16px" }}
>
  <Image
    src="/resources/images/wallets/tonkeeper/backup-light.png"
    darkSrc="/resources/images/wallets/tonkeeper/backup-dark.png"
    width={228}
    height={300}
    alt="Back up"
  />
  
  <Image
    src="/resources/images/wallets/tonkeeper/backup-manually-light.png"
    darkSrc="/resources/images/wallets/tonkeeper/backup-manually-dark.png"
    width={228}
    height={342}
    alt="Confirm the passcode"
  />
</div>

We would have an additional import from /snippets/image.jsx and a component to replace the prior <div>:

import { Image, ImageSpan } from '/snippets/image.jsx';

...

<ImageSpan>
  <Image
    src="/resources/images/wallets/tonkeeper/backup-light.png"
    darkSrc="/resources/images/wallets/tonkeeper/backup-dark.png"
    width={228}
    height={300}
    alt="Back up"
  />
  
  <Image
    src="/resources/images/wallets/tonkeeper/backup-manually-light.png"
    darkSrc="/resources/images/wallets/tonkeeper/backup-manually-dark.png"
    width={228}
    height={342}
    alt="Confirm the passcode"
  />
</ImageSpan>

Metadata

Metadata

Assignees

Labels

prio: nice-to-haveNon-urgent feature requests, enhancements, or general suggestionsscope: snippetsCustom React components and MDX snippets right on the given page or in the /snippets folder

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions