remove more ternaries

This commit is contained in:
Isaac Wise
2024-07-27 16:17:38 -05:00
parent fa051c0d4d
commit ff31732ba3
17 changed files with 80 additions and 70 deletions
+2 -2
View File
@@ -104,9 +104,9 @@ export default function Admin() {
<p>{t("no_users_found")}</p>
)}
{newUserModal ? (
{newUserModal && (
<NewUserModal onClose={() => setNewUserModal(false)} />
) : null}
)}
</div>
);
}
+2 -2
View File
@@ -229,13 +229,13 @@ export default function Index() {
);
})
.slice(0, 3)}
{activeCollection.members.length - 3 > 0 ? (
{activeCollection.members.length - 3 > 0 && (
<div className={`avatar drop-shadow-md placeholder -ml-3`}>
<div className="bg-base-100 text-neutral rounded-full w-8 h-8 ring-2 ring-neutral-content">
<span>+{activeCollection.members.length - 3}</span>
</div>
</div>
) : null}
)}
</div>
<p className="text-neutral text-sm">
+4 -4
View File
@@ -60,11 +60,11 @@ export default function Dashboard() {
handleNumberOfLinksToShow();
}, [width]);
const importBookmarks = async (e: any, format: MigrationFormat) => {
const file: File = e.target.files[0];
const importBookmarks = async (e: React.ChangeEvent<HTMLInputElement>, format: MigrationFormat) => {
const file: File | null = e.target.files && e.target.files[0];
if (file) {
var reader = new FileReader();
const reader = new FileReader();
reader.readAsText(file, "UTF-8");
reader.onload = async function (e) {
const load = toast.loading("Importing...");
@@ -81,7 +81,7 @@ export default function Dashboard() {
body: JSON.stringify(body),
});
const data = await response.json();
await response.json();
toast.dismiss(load);
+2 -2
View File
@@ -171,13 +171,13 @@ export default function PublicCollections() {
);
})
.slice(0, 3)}
{collection.members.length - 3 > 0 ? (
{collection.members.length - 3 > 0 && (
<div className={`avatar drop-shadow-md placeholder -ml-3`}>
<div className="bg-base-100 text-neutral rounded-full w-8 h-8 ring-2 ring-neutral-content">
<span>+{collection.members.length - 3}</span>
</div>
</div>
) : null}
)}
</div>
<p className="text-neutral text-sm">