chore: formatting

This commit is contained in:
florian 2024-04-17 10:47:51 +02:00
parent 4f49341581
commit d4ca14e0f7
9 changed files with 37 additions and 33 deletions

View File

@ -82,10 +82,7 @@ const FileEventEditor = ({ data }: { data: FileEventData }) => {
placeholder="Caption"
></textarea>
<span className="font-bold">URL</span>
<textarea
value={fileEventData.url.join('\n')}
className="textarea"
placeholder="URL"/>
<textarea value={fileEventData.url.join('\n')} className="textarea" placeholder="URL" />
<button className="btn btn-primary" onClick={() => publishFileEvent(fileEventData)}>
Publish
</button>

View File

@ -55,7 +55,7 @@ const Server = ({
</div>
{serverInfo.isError ? (
<div className="badge badge-error">
<ExclamationTriangleIcon className='w-4 mr-2'/> Error connecting to server
<ExclamationTriangleIcon className="w-4 mr-2" /> Error connecting to server
</div>
) : (
<div className="server-stats">

View File

@ -22,7 +22,7 @@ export const ServerList = ({
onTransfer,
onCancel,
title,
showAddButton = false
showAddButton = false,
}: ServerListProps) => {
const { serverInfo, distribution } = useServerInfo();
const blobsWithOnlyOneOccurance = Object.values(distribution)
@ -33,11 +33,14 @@ export const ServerList = ({
<>
<div className={`server-list-header ${!title ? 'justify-end' : ''}`}>
{title && <h2>{title}</h2>}
{showAddButton && <div className="content-center">
<button onClick={() => {}} className='flex flex-row gap-2' title="Add server">
<PlusIcon/><ServerIcon />
{showAddButton && (
<div className="content-center">
<button onClick={() => {}} className="flex flex-row gap-2" title="Add server">
<PlusIcon />
<ServerIcon />
</button>
</div>}
</div>
)}
</div>
<div className="server-list">

View File

@ -11,7 +11,7 @@ const ThemeSwitcher = () => {
document.querySelector('html')?.setAttribute('data-theme', theme);
}, [theme]);
return (
<div className='tooltip tooltip-bottom' data-tip="Switch theme">
<div className="tooltip tooltip-bottom" data-tip="Switch theme">
<label className="swap swap-rotate">
<input onClick={toggleTheme} type="checkbox" />
<MoonIcon className="tooltip swap-on" />

View File

@ -1,4 +1,3 @@
function Check() {
/*
const { serverInfo } = useServerInfo();

View File

@ -29,4 +29,3 @@
.error-log div span {
@apply overflow-ellipsis overflow-hidden text-nowrap;
}

View File

@ -106,7 +106,11 @@ export const Transfer = () => {
<ServerList
servers={Object.values(serverInfo).filter(s => s.name == transferSource)}
onCancel={() => closeTransferMode()}
title={<><ArrowUpOnSquareIcon /> Transfer Source</>}
title={
<>
<ArrowUpOnSquareIcon /> Transfer Source
</>
}
></ServerList>
<ServerList
servers={Object.values(serverInfo)
@ -114,7 +118,11 @@ export const Transfer = () => {
.sort()}
selectedServer={transferTarget}
setSelectedServer={setTransferTarget}
title={<><ArrowDownOnSquareIcon /> Transfer Target</>}
title={
<>
<ArrowDownOnSquareIcon /> Transfer Target
</>
}
></ServerList>
{transferTarget && transferJobs && transferJobs.length > 0 ? (
<>

View File

@ -136,7 +136,9 @@ function Upload() {
fileDimensions[file.name] = {
...fileDimensions[file.name],
x: newBlob.sha256,
url: primary ? [newBlob.url, ...fileDimensions[file.name].url] : [...fileDimensions[file.name].url, newBlob.url],
url: primary
? [newBlob.url, ...fileDimensions[file.name].url]
: [...fileDimensions[file.name].url, newBlob.url],
size: newBlob.size,
m: newBlob.type,
};

View File

@ -25,16 +25,12 @@ console.log(allXTags);
}, [fileMetaSub.events]);
*/
const fileMetaEventsByHash = useMemo(
() => {
const fileMetaEventsByHash = useMemo(() => {
const allXTags = fileMetaSub.events.flatMap(ev => ev.tags.filter(t => t[0] == 'x').flatMap(t => ({ x: t[1], ev })));
const groupedByX = groupBy(allXTags, item => item.x);
return mapValues(groupedByX, v => v.map(e => e.ev));
},
[fileMetaSub]
);
console.log(fileMetaEventsByHash)
}, [fileMetaSub]);
console.log(fileMetaEventsByHash);
return fileMetaEventsByHash;
};