chore(app): better ux for settings actions

This commit is contained in:
rektdeckard
2021-11-29 21:14:17 -05:00
parent 14d8c9d0e7
commit e4b99d2ca9
4 changed files with 25 additions and 5 deletions

View File

@@ -18,6 +18,13 @@
"sizes": "512x512" "sizes": "512x512"
} }
], ],
"permissions": [
"http://*/*",
"https://*/*",
"clipboardRead",
"clipboardWrite",
"storage"
],
"start_url": ".", "start_url": ".",
"display": "standalone", "display": "standalone",
"theme_color": "#35313D", "theme_color": "#35313D",

View File

@@ -1,4 +1,4 @@
.action-button { button.action-button {
background-color: rgba(255, 255, 255, 0.05); background-color: rgba(255, 255, 255, 0.05);
color: white; color: white;
padding: 8px; padding: 8px;
@@ -6,6 +6,14 @@
cursor: pointer; cursor: pointer;
} }
button.action-button:hover {
background-color: rgba(255, 255, 255, 0.1);
}
button.action-button:active {
background-color: rgba(255, 255, 255, 0.2);
}
@media screen and (max-width: 558px) { @media screen and (max-width: 558px) {
.action-button { .action-button {
display: none; display: none;

View File

@@ -20,10 +20,14 @@ const SettingsActions: React.FC = () => {
["size", size.toString()], ["size", size.toString()],
["color", color.replace("#", "")], ["color", color.replace("#", "")],
]).toString(); ]).toString();
void navigator.clipboard?.writeText( void navigator.clipboard
`${window.location.host}?${paramString}` ?.writeText(`${window.location.host}?${paramString}`)
); .then(() => {
setCopied(true); setCopied(true);
})
.catch(() => {
alert("Clipboard permissions must be enabled to copy links!");
});
}; };
return ( return (

View File

@@ -58,5 +58,6 @@ export default () => {
} }
} }
} }
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []); }, []);
}; };