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
}

View File

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

View File

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

View File

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

View File

@ -22,16 +22,16 @@ const CustomForm = ({ status, message, onValidated, light, id }) => {
};
return (
<form className={classNames("home-stay-form", { light })} onSubmit={e => e.preventDefault()}>
<form className={classNames("home-stay-form", { light })} onSubmit={(e) => e.preventDefault()}>
<input
ref={node => (email = node)}
ref={(node) => (email = node)}
type="email"
placeholder="Email Address"
validate="true"
aria-labelledby={submitId}
/>
<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>
</div>
<button className="button" onClick={submit} id={submitId}>
@ -63,7 +63,7 @@ export default function Mailing({ light, id }) {
status={status}
message={message}
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();
document.execCommand("copy");
e.target.focus();