-
Notifications
You must be signed in to change notification settings - Fork 184
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
Co-locate images with their usage site #1998
Conversation
848a69f
to
9385af1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked that wrapped emails continue to render with this change. It looks like the images were moved back in PR #1767, so this removes the duplicates in the original location.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for breaking this out into two PRs! Good to go.
@@ -38,7 +38,7 @@ | |||
|
|||
&::before { | |||
content: counter(step-counter); | |||
background-image: url("../../../../static/images/dashboard-onboarding/shield.svg"); | |||
background-image: url("./images/shield.svg"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
praise: This is sooooo much cleaner. 🙌
@@ -69,6 +69,10 @@ | |||
align-items: center; | |||
gap: $spacing-xs; | |||
padding-bottom: $spacing-xs; | |||
|
|||
svg { | |||
color: $color-blue-50; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
praise: Using currentColor
will make this way more flexible.
className={styles["copy-icon"]} | ||
/> | ||
<span className={styles["copy-icon"]}> | ||
<CopyIcon alt="" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question (nit, non-blocking): Should this have an entry in the alt
tag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, since it's contained within a button that already has an aria-label
. (This means that instead of a button that just has the mask address followed by "click to copy", the whole thing is labelled something like "click to copy to clipboard", which is less confusing for a button.
img { | ||
margin-right: $spacing-sm; | ||
} | ||
gap: $spacing-sm; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
praise: gap
on the parent > margin
on the child element forever.
@@ -8,8 +8,7 @@ import { | |||
useTooltipTrigger, | |||
} from "react-aria"; | |||
import styles from "./Alias.module.scss"; | |||
import copyIcon from "../../../../../static/images/copy-to-clipboard.svg"; | |||
import arrowDownIcon from "../../../../../static/images/arrowhead.svg"; | |||
import { ArrowDownIcon, CopyIcon } from "../../Icons"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question (non-blocking): Should these also be in /public/images
directory? (There's only four items in the icons directory)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are actually React components, rather than separate files (i.e. the full filename is Icons.tsx
). The reason for that is that that allows us to inline the SVGs, which then allows us to use currentcolor
, which is useful for symbolic items that have just a single colour that might differ depending on their context/hover state.
Thanks for the review! I'll refrain from merging this until #1891 is merged, since it merges into that branch and therefore would become part of the PR anyway, removing the benefit of having them split out. |
64c57a3
to
a35e9a4
Compare
a35e9a4
to
d4e9ee7
Compare
d4e9ee7
to
b53f5af
Compare
9385af1
to
d539fbd
Compare
Rebased on |
❌ Deploy Preview for fx-relay-demo failed.
|
As requested at: - #1518 (comment) - #1518 (review)
As requested at #1891 (comment)
As called out at #1891 (comment)
cd62dac
to
aaffc3a
Compare
This was extracted from #1891.
This co-locates images with their site of use, where possible, rather than referring to them in
../../(etc)/static
, which was done to ease the transition. This was requested in reviews of The Big One.How to test: nothing should have changed.
/static/scss/libs/protocol/css/includes/tokens/dist/index.scss
).