New content warning styles

This commit is contained in:
Kieran 2023-09-18 10:22:29 +01:00
parent 0b9c43cfed
commit 2f9e1eb5c8
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
6 changed files with 80 additions and 18 deletions

View File

@ -325,5 +325,11 @@
<path fill-rule="evenodd" clip-rule="evenodd" d="M13 2.01558C13 1.98928 13 1.97612 12.9989 1.95227C12.9753 1.4585 12.541 1.02448 12.0473 1.00112C12.0234 0.999992 12.0156 0.999995 12 1H12H8.75866H8.75862C7.95369 0.99999 7.28935 0.999981 6.74818 1.0442C6.18608 1.09012 5.66938 1.18869 5.18404 1.43598C4.43139 1.81947 3.81947 2.43139 3.43598 3.18404C3.18869 3.66938 3.09012 4.18608 3.0442 4.74818C2.99998 5.28936 2.99999 5.95372 3 6.75867V6.75869V17.2413V17.2413C2.99999 18.0463 2.99998 18.7106 3.0442 19.2518C3.09012 19.8139 3.18869 20.3306 3.43598 20.816C3.81947 21.5686 4.43139 22.1805 5.18404 22.564C5.66938 22.8113 6.18608 22.9099 6.74818 22.9558C7.28937 23 7.95372 23 8.75868 23H15.2413C16.0463 23 16.7106 23 17.2518 22.9558C17.8139 22.9099 18.3306 22.8113 18.816 22.564C19.5686 22.1805 20.1805 21.5686 20.564 20.816C20.8113 20.3306 20.9099 19.8139 20.9558 19.2518C21 18.7106 21 18.0463 21 17.2413V9.99994C21 9.98441 21 9.97664 20.9989 9.95282C20.9756 9.45899 20.5415 9.02471 20.0477 9.00115C20.0238 9.00001 20.0107 9.00001 19.9845 9.00001L15.5681 9.00001C15.3157 9.00004 15.0699 9.00007 14.8618 8.98307C14.6332 8.96439 14.3634 8.92032 14.092 8.78202C13.7157 8.59028 13.4097 8.28432 13.218 7.90799C13.0797 7.63657 13.0356 7.36683 13.017 7.13824C12.9999 6.93008 13 6.68429 13 6.43191L13 2.01558ZM18.908 6.99999C19.2016 7 19.3484 7 19.4686 6.92627C19.6385 6.82215 19.74 6.57684 19.6935 6.38313C19.6605 6.24598 19.5648 6.15033 19.3733 5.95904L16.041 2.62672C15.8497 2.43523 15.754 2.33949 15.6169 2.30652C15.4232 2.25996 15.1779 2.3615 15.0737 2.53134C15 2.65161 15 2.79842 15 3.09204L15 6.19996C15 6.47998 15 6.61999 15.0545 6.72694C15.1024 6.82102 15.1789 6.89751 15.273 6.94545C15.38 6.99995 15.52 6.99995 15.8 6.99995L18.908 6.99999ZM8 9C7.44772 9 7 9.44772 7 10C7 10.5523 7.44772 11 8 11H10C10.5523 11 11 10.5523 11 10C11 9.44772 10.5523 9 10 9H8ZM7 14C7 13.4477 7.44772 13 8 13H16C16.5523 13 17 13.4477 17 14C17 14.5523 16.5523 15 16 15H8C7.44772 15 7 14.5523 7 14ZM7 18C7 17.4477 7.44772 17 8 17H16C16.5523 17 17 17.4477 17 18C17 18.5523 16.5523 19 16 19H8C7.44772 19 7 18.5523 7 18Z" fill="currentColor"/>
</g>
</symbol>
<symbol id="alert-circle" viewBox="0 0 18 19" fill="none">
<g>
<path d="M9 6.5V9.5M9 12.5H9.0075M16.5 9.5C16.5 13.6421 13.1421 17 9 17C4.85786 17 1.5 13.6421 1.5 9.5C1.5 5.35786 4.85786 2 9 2C13.1421 2 16.5 5.35786 16.5 9.5Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</g>
</symbol>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

View File

@ -255,18 +255,26 @@ export function NoteInner(props: NoteProps) {
<Reveal
message={
<>
<FormattedMessage defaultMessage="This note has been marked as sensitive, click here to reveal" />
<FormattedMessage
defaultMessage="The author has marked this note as a <i>sensitive topic</i>"
values={{
i: c => <i>{c}</i>,
}}
/>
{contentWarning[1] && (
<>
<br />
&nbsp;
<FormattedMessage
defaultMessage="Reason: {reason}"
defaultMessage="Reason: <i>{reason}</i>"
values={{
i: c => <i>{c}</i>,
reason: contentWarning[1],
}}
/>
</>
)}
&nbsp;
<FormattedMessage defaultMessage="Click here to load anyway" />
</>
}>
{innerContent()}

View File

@ -0,0 +1,15 @@
.note-notice {
color: var(--font-tertiary-color);
border: 1px solid var(--border-color);
padding: 8px 16px;
border-radius: 12px;
}
.note-notice i {
font-style: normal;
color: var(--font-color);
}
.note-notice svg {
color: var(--warning);
}

View File

@ -1,3 +1,5 @@
import "./Reveal.css";
import Icon from "Icons/Icon";
import { useState } from "react";
interface RevealProps {
@ -15,8 +17,9 @@ export default function Reveal(props: RevealProps): JSX.Element {
e.stopPropagation();
setReveal(true);
}}
className="note-invoice">
{props.message}
className="note-notice flex g8">
<Icon name="alert-circle" size={24} />
<div>{props.message}</div>
</div>
);
} else {

View File

@ -63,6 +63,9 @@
"0mch2Y": {
"defaultMessage": "name has disallowed characters"
},
"0uoY11": {
"defaultMessage": "Show Status"
},
"0yO7wF": {
"defaultMessage": "{n} secs"
},
@ -108,6 +111,9 @@
"2ukA4d": {
"defaultMessage": "{n} hours"
},
"3KNMbJ": {
"defaultMessage": "Articles"
},
"3Rx6Qo": {
"defaultMessage": "Advanced"
},
@ -184,6 +190,9 @@
"65BmHb": {
"defaultMessage": "Failed to proxy image from {host}, click here to load directly"
},
"6OSOXl": {
"defaultMessage": "Reason: <i>{reason}</i>"
},
"6Yfvvp": {
"defaultMessage": "Get an identifier"
},
@ -229,9 +238,6 @@
"9+Ddtu": {
"defaultMessage": "Next"
},
"91VPqq": {
"defaultMessage": "Paying with wallet"
},
"9HU8vw": {
"defaultMessage": "Reply"
},
@ -355,6 +361,9 @@
"EPYwm7": {
"defaultMessage": "Your private key is your password. If you lose this key, you will lose access to your account! Copy it and keep it in a safe place. There is no way to reset your private key."
},
"EQKRE4": {
"defaultMessage": "Show badges on profile pages"
},
"EWyQH5": {
"defaultMessage": "Global"
},
@ -382,6 +391,9 @@
"FDguSC": {
"defaultMessage": "{n} Zaps"
},
"FMfjrl": {
"defaultMessage": "Show status messages on profile pages"
},
"FS3b54": {
"defaultMessage": "Done!"
},
@ -467,6 +479,9 @@
"Ig9/a1": {
"defaultMessage": "Sent {n} sats to {name}"
},
"IoQq+a": {
"defaultMessage": "Click here to load anyway"
},
"Ix8l+B": {
"defaultMessage": "Trending Notes"
},
@ -506,9 +521,6 @@
"KAhAcM": {
"defaultMessage": "Enter LNDHub config"
},
"KLo3SP": {
"defaultMessage": "Reason: {reason}"
},
"KQvWvD": {
"defaultMessage": "Deleted"
},
@ -570,6 +582,9 @@
"N2IrpM": {
"defaultMessage": "Confirm"
},
"NAidKb": {
"defaultMessage": "Notifications"
},
"NAuFNH": {
"defaultMessage": "You already have a subscription of this type, please renew or pay"
},
@ -703,6 +718,9 @@
"Ss0sWu": {
"defaultMessage": "Pay Now"
},
"StKzTE": {
"defaultMessage": "The author has marked this note as a <i>sensitive topic</i>"
},
"TDR5ge": {
"defaultMessage": "Media in notes will automatically be shown for selected people, otherwise only the link will show"
},
@ -986,6 +1004,9 @@
"hicxcO": {
"defaultMessage": "Show replies"
},
"hmZ3Bz": {
"defaultMessage": "Media"
},
"hniz8Z": {
"defaultMessage": "here"
},
@ -1227,6 +1248,9 @@
"rudscU": {
"defaultMessage": "Failed to load follows, please try again later"
},
"sKDn4e": {
"defaultMessage": "Show Badges"
},
"sUNhQE": {
"defaultMessage": "user"
},
@ -1316,9 +1340,6 @@
"x/Fx2P": {
"defaultMessage": "Fund the services that you use by splitting a portion of all your zaps into a pool of funds!"
},
"x/q8d5": {
"defaultMessage": "This note has been marked as sensitive, click here to reveal"
},
"x82IOl": {
"defaultMessage": "Mute"
},

View File

@ -20,6 +20,7 @@
"0BUTMv": "Search...",
"0jOEtS": "Invalid LNURL",
"0mch2Y": "name has disallowed characters",
"0uoY11": "Show Status",
"0yO7wF": "{n} secs",
"1A7TZk": "What is Snort and how does it work?",
"1Mo59U": "Are you sure you want to remove this note from bookmarks?",
@ -35,6 +36,7 @@
"2a2YiP": "{n} Bookmarks",
"2k0Cv+": "Dislikes ({n})",
"2ukA4d": "{n} hours",
"3KNMbJ": "Articles",
"3Rx6Qo": "Advanced",
"3cc4Ct": "Light",
"3gOsZq": "Translators",
@ -60,6 +62,7 @@
"5vMmmR": "Usernames are not unique on Nostr. The nostr address is your unique human-readable address that is unique to you upon registration.",
"5ykRmX": "Send zap",
"65BmHb": "Failed to proxy image from {host}, click here to load directly",
"6OSOXl": "Reason: <i>{reason}</i>",
"6Yfvvp": "Get an identifier",
"6bgpn+": "Not all clients support this, you may still receive some zaps as if zap splits was not configured",
"6ewQqw": "Likes ({n})",
@ -70,6 +73,7 @@
"8/vBbP": "Reposts ({n})",
"89q5wc": "Confirm Reposts",
"8QDesP": "Zap {n} sats",
"8Rkoyb": "Recipient",
"8Y6bZQ": "Invalid zap split: {input}",
"8g2vyB": "name too long",
"8v1NN+": "Pairing phrase",
@ -114,6 +118,7 @@
"E8a4yq": "Follow some popular accounts",
"ELbg9p": "Data Providers",
"EPYwm7": "Your private key is your password. If you lose this key, you will lose access to your account! Copy it and keep it in a safe place. There is no way to reset your private key.",
"EQKRE4": "Show badges on profile pages",
"EWyQH5": "Global",
"Ebl/B2": "Translate to {lang}",
"EcZF24": "Custom Relays",
@ -123,6 +128,7 @@
"F+B3x1": "We have also partnered with nostrplebs.com to give you more options",
"F3l7xL": "Add Account",
"FDguSC": "{n} Zaps",
"FMfjrl": "Show status messages on profile pages",
"FS3b54": "Done!",
"FSYL8G": "Trending Users",
"FdhSU2": "Claim Now",
@ -145,13 +151,13 @@
"HOzFdo": "Muted",
"HWbkEK": "Clear cache and reload",
"HbefNb": "Open Wallet",
"I9zn6f": "Pubkey",
"IDjHJ6": "Thanks for using Snort, please consider donating if you can.",
"IEwZvs": "Are you sure you want to unpin this note?",
"IKKHqV": "Follows",
"INSqIz": "Twitter username...",
"IUZC+0": "This means that nobody can modify notes which you have created and everybody can easily verify that the notes they are reading are created by you.",
"Ig9/a1": "Sent {n} sats to {name}",
"IoQq+a": "Click here to load anyway",
"Ix8l+B": "Trending Notes",
"J+dIsA": "Subscriptions",
"JCIgkj": "Username",
@ -165,7 +171,6 @@
"K3r6DQ": "Delete",
"K7AkdL": "Show",
"KAhAcM": "Enter LNDHub config",
"KLo3SP": "Reason: {reason}",
"KQvWvD": "Deleted",
"KWuDfz": "I have saved my keys, continue",
"KahimY": "Unknown event kind: {kind}",
@ -186,6 +191,7 @@
"MuVeKe": "Buy nostr address",
"MzRYWH": "Buying {item}",
"N2IrpM": "Confirm",
"NAidKb": "Notifications",
"NAuFNH": "You already have a subscription of this type, please renew or pay",
"NNSu3d": "Import Twitter Follows",
"NdOYJJ": "Hmm nothing here.. Checkout {newUsersPage} to follow some recommended nostrich's!",
@ -229,6 +235,7 @@
"ShdEie": "Mark all read",
"Sjo1P4": "Custom",
"Ss0sWu": "Pay Now",
"StKzTE": "The author has marked this note as a <i>sensitive topic</i>",
"TDR5ge": "Media in notes will automatically be shown for selected people, otherwise only the link will show",
"TMfYfY": "Cashu token",
"TpgeGw": "Hex Salt..",
@ -267,6 +274,7 @@
"Z4BMCZ": "Enter pairing phrase",
"ZKORll": "Activate Now",
"ZLmyG9": "Contributors",
"ZS+jRE": "Send zap splits to",
"ZUZedV": "Lightning Donation:",
"Zr5TMx": "Setup profile",
"a5UPxh": "Fund developers and platforms providing NIP-05 verification services",
@ -320,6 +328,7 @@
"hWSp+B": "Nostr Connect (NIP-46)",
"hY4lzx": "Supports",
"hicxcO": "Show replies",
"hmZ3Bz": "Media",
"hniz8Z": "here",
"i/dBAR": "Zap Pool",
"iCqGww": "Reactions ({n})",
@ -399,6 +408,7 @@
"rmdsT4": "{n} days",
"rrfdTe": "This is the same technology which is used by Bitcoin and has been proven to be extremely secure.",
"rudscU": "Failed to load follows, please try again later",
"sKDn4e": "Show Badges",
"sUNhQE": "user",
"sWnYKw": "Snort is designed to have a similar experience to Twitter.",
"sZQzjQ": "Failed to parse zap split: {input}",
@ -410,11 +420,11 @@
"u/vOPu": "Paid",
"u4bHcR": "Check out the code here: {link}",
"uSV4Ti": "Reposts need to be manually confirmed",
"uc0din": "Send sats splits to",
"usAvMr": "Edit Profile",
"ut+2Cd": "Get a partner identifier",
"v8lolG": "Start chat",
"vOKedj": "{n,plural,=1{& {n} other} other{& {n} others}}",
"vU71Ez": "Paying with {wallet}",
"vZ4quW": "NIP-05 is a DNS based verification spec which helps to validate you as a real user.",
"vhlWFg": "Poll Options",
"vlbWtt": "Get a free one",
@ -428,7 +438,6 @@
"wqyN/i": "Find out more info about {service} at {link}",
"wtLjP6": "Copy ID",
"x/Fx2P": "Fund the services that you use by splitting a portion of all your zaps into a pool of funds!",
"x/q8d5": "This note has been marked as sensitive, click here to reveal",
"x82IOl": "Mute",
"xIcAOU": "Votes by {type}",
"xIoGG9": "Go to",