set prettier arrowParens to always

This commit is contained in:
Karol Wypchlo 2020-02-28 17:19:33 +01:00
parent 6650e266b2
commit 88dea28fda
6 changed files with 14 additions and 13 deletions

View File

@ -1,3 +1,4 @@
{ {
"arrowParens": "always",
"printWidth": 120 "printWidth": 120
} }

View File

@ -16,7 +16,7 @@ export default function CodeExamples() {
const [active, setActive] = useState(1); const [active, setActive] = useState(1);
const { apiUrl } = useContext(AppContext); const { apiUrl } = useContext(AppContext);
const interpolateRegExp = new RegExp("https://siasky.net", "g"); const interpolateRegExp = new RegExp("https://siasky.net", "g");
const interpolateSnippet = snippet => snippet.replace(interpolateRegExp, apiUrl); const interpolateSnippet = (snippet) => snippet.replace(interpolateRegExp, apiUrl);
return ( return (
<div className="code-examples"> <div className="code-examples">

View File

@ -20,7 +20,7 @@ const STATS_MAP = [
export default function HomeNetwork() { export default function HomeNetwork() {
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
const stats = useStats(); const stats = useStats();
const onChange = isVisible => { const onChange = (isVisible) => {
if (isVisible && !visible) { if (isVisible && !visible) {
setVisible(true); setVisible(true);
} }

View File

@ -12,12 +12,12 @@ export default function HomeUpload() {
const [files, setFiles] = useState([]); const [files, setFiles] = useState([]);
const { apiUrl } = useContext(AppContext); const { apiUrl } = useContext(AppContext);
const handleDrop = async acceptedFiles => { const handleDrop = async (acceptedFiles) => {
setFiles(previousFiles => [...acceptedFiles.map(file => ({ file, status: "uploading" })), ...previousFiles]); setFiles((previousFiles) => [...acceptedFiles.map((file) => ({ file, status: "uploading" })), ...previousFiles]);
const onComplete = (file, status, skylink) => { const onComplete = (file, status, skylink) => {
setFiles(previousFiles => { setFiles((previousFiles) => {
const index = previousFiles.findIndex(f => f.file === file); const index = previousFiles.findIndex((f) => f.file === file);
return [ return [
...previousFiles.slice(0, index), ...previousFiles.slice(0, index),
@ -31,7 +31,7 @@ export default function HomeUpload() {
}); });
}; };
acceptedFiles.forEach(async file => { acceptedFiles.forEach(async (file) => {
try { try {
const fd = new FormData(); const fd = new FormData();
fd.append("file", file); fd.append("file", file);
@ -47,7 +47,7 @@ export default function HomeUpload() {
}); });
}; };
const handleSkylink = event => { const handleSkylink = (event) => {
event.preventDefault(); event.preventDefault();
const skylink = event.target.skylink.value.replace("sia://", ""); const skylink = event.target.skylink.value.replace("sia://", "");

View File

@ -22,16 +22,16 @@ const CustomForm = ({ status, message, onValidated, light, id }) => {
}; };
return ( return (
<form className={classNames("home-stay-form", { light })} onSubmit={e => e.preventDefault()}> <form className={classNames("home-stay-form", { light })} onSubmit={(e) => e.preventDefault()}>
<input <input
ref={node => (email = node)} ref={(node) => (email = node)}
type="email" type="email"
placeholder="Email Address" placeholder="Email Address"
validate="true" validate="true"
aria-labelledby={submitId} aria-labelledby={submitId}
/> />
<div className="home-form-stay-existing"> <div className="home-form-stay-existing">
<input ref={node => (user = node)} type="checkbox" id={checkboxId} /> <input ref={(node) => (user = node)} type="checkbox" id={checkboxId} />
<label htmlFor={checkboxId}>I have previous experience using Sia</label> <label htmlFor={checkboxId}>I have previous experience using Sia</label>
</div> </div>
<button className="button" onClick={submit} id={submitId}> <button className="button" onClick={submit} id={submitId}>
@ -63,7 +63,7 @@ export default function Mailing({ light, id }) {
status={status} status={status}
message={message} message={message}
light={light} light={light}
onValidated={formData => subscribe(formData)} onValidated={(formData) => subscribe(formData)}
/> />
)} )}
/> />

View File

@ -27,7 +27,7 @@ export default function UploadFile({ file, url, status }) {
} }
}; };
const copyToClipboard = e => { const copyToClipboard = (e) => {
urlRef.current.select(); urlRef.current.select();
document.execCommand("copy"); document.execCommand("copy");
e.target.focus(); e.target.focus();