Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions app/components/crate-sidebar.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@
{{/if}}
{{/unless}}

{{#if this.playgroundLink}}
<div>
<div>
{{#if this.playgroundLink}}
<a
href={{this.playgroundLink}}
target="_blank"
Expand All @@ -128,6 +128,13 @@
try out directly in your browser.
</p>
{{/unless}}
</div>
{{/if}}
{{/if}}

<a
href="mailto:help@crates.io?subject=The%20%22{{@crate.name}}%22%20crate&body=I'm%20reporting%20the%20%22{{@crate.name}}%22%20crate%20because%3A%0A%0A-%20%5B%20%5D%20it%20contains%20spam%0A-%20%5B%20%5D%20it%20is%20name-squatting%20(reserving%20a%20crate%20name%20without%20content)%0A-%20%5B%20%5D%20it%20is%20abusive%20or%20otherwise%20harmful%0A-%20%5B%20%5D%20it%20contains%20a%20vulnerability%20(please%20try%20to%20contact%20the%20crate%20author%20first)%0A-%20%5B%20%5D%20it%20is%20violating%20the%20usage%20policy%20in%20some%20other%20way%20(please%20specify%20below)%0A%0AAdditional%20details%3A%0A%0A%3Cplease%20add%20more%20information%20if%20you%20can%3E"
Copy link
Contributor

@paolobarbolini paolobarbolini Aug 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive-by review: this would probably work better with something along the lines of (however that's done in Ember):

`mailto:help@crates.io?${new URLSearchParams({
    subject: 'blabla',
    body: 'blablabla'
}).toString()}`

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I had it roughly like that at first, but since the allowed characters in crate names are fairly restricted and the message is unlikely to change that often I figured it would probably be sufficient to have it in the encoded form directly and save a couple of payload bytes :)

local-class="report-button"
>
Report crate
</a>
</div>
</section>
14 changes: 12 additions & 2 deletions app/components/crate-sidebar.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,22 @@
line-height: 1.5;
}

.playground-button {
composes: yellow-button small from '../styles/shared/buttons.module.css';
.button {
justify-content: center;
width: 220px;
}

.report-button {
composes: button;
composes: red-button small from '../styles/shared/buttons.module.css';
}

.playground-button {
composes: button;
composes: yellow-button small from '../styles/shared/buttons.module.css';
margin-bottom: var(--space-2xs);
}

.playground-help {
composes: small from '../styles/shared/typography.module.css';
max-width: 220px;
Expand Down
13 changes: 13 additions & 0 deletions app/styles/shared/buttons.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,19 @@
--bg-color-bottom-dark: #cfc487;
}

.red-button {
composes: button;

--bg-color-top: #ffb8b8;
--bg-color-bottom: #f78888;

--bg-color-top-light: #ffcccc;
--bg-color-bottom-light: #f7adad;

--bg-color-top-dark: #fab4b4;
--bg-color-bottom-dark: #ed6b6b;
}

.small {
padding: var(--space-2xs) var(--space-s);
}