Merge branch 'staging' into issue-255
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 41s
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 41s
This commit is contained in:
commit
f4cf497c1a
@ -199,8 +199,11 @@ export const CreatePage = () => {
|
||||
return uniqueEvents
|
||||
}, [])
|
||||
|
||||
console.log('fineFilteredEvents', fineFilteredEvents)
|
||||
console.info('fineFilteredEvents', fineFilteredEvents)
|
||||
setFoundUsers(fineFilteredEvents)
|
||||
|
||||
if (!fineFilteredEvents.length)
|
||||
toast.info('No user found with the provided search term')
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(error)
|
||||
@ -761,7 +764,7 @@ export const CreatePage = () => {
|
||||
title
|
||||
}
|
||||
|
||||
setLoadingSpinnerDesc('Signing nostr event for create signature')
|
||||
setLoadingSpinnerDesc('Preparing document(s) for signing')
|
||||
|
||||
const createSignature = await signEventForMetaFile(
|
||||
JSON.stringify(content),
|
||||
|
@ -135,6 +135,46 @@ export const HomePage = () => {
|
||||
const [filter, setFilter] = useState<Filter>('Show all')
|
||||
const [sort, setSort] = useState<Sort>('desc')
|
||||
|
||||
const renderSubmissions = () => {
|
||||
const submissions = Object.keys(parsedSigits)
|
||||
.filter((s) => {
|
||||
const { title, signedStatus } = parsedSigits[s]
|
||||
const isMatch = title?.toLowerCase().includes(q.toLowerCase())
|
||||
switch (filter) {
|
||||
case 'Completed':
|
||||
return signedStatus === SigitStatus.Complete && isMatch
|
||||
case 'In-progress':
|
||||
return signedStatus === SigitStatus.Partial && isMatch
|
||||
case 'Show all':
|
||||
return isMatch
|
||||
default:
|
||||
console.error('Filter case not handled.')
|
||||
}
|
||||
})
|
||||
.sort((a, b) => {
|
||||
const x = parsedSigits[a].createdAt ?? 0
|
||||
const y = parsedSigits[b].createdAt ?? 0
|
||||
return sort === 'desc' ? y - x : x - y
|
||||
})
|
||||
|
||||
if (submissions.length) {
|
||||
return submissions.map((key) => (
|
||||
<DisplaySigit
|
||||
key={`sigit-${key}`}
|
||||
sigitCreateId={key}
|
||||
parsedMeta={parsedSigits[key]}
|
||||
meta={sigits[key]}
|
||||
/>
|
||||
))
|
||||
} else {
|
||||
return (
|
||||
<div className={styles.noResults}>
|
||||
<p>No results</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div {...getRootProps()} tabIndex={-1}>
|
||||
<Container className={styles.container}>
|
||||
@ -233,36 +273,8 @@ export const HomePage = () => {
|
||||
<label htmlFor="file-upload">Click or drag files to upload!</label>
|
||||
)}
|
||||
</button>
|
||||
<div className={styles.submissions}>
|
||||
{Object.keys(parsedSigits)
|
||||
.filter((s) => {
|
||||
const { title, signedStatus } = parsedSigits[s]
|
||||
const isMatch = title?.toLowerCase().includes(q.toLowerCase())
|
||||
switch (filter) {
|
||||
case 'Completed':
|
||||
return signedStatus === SigitStatus.Complete && isMatch
|
||||
case 'In-progress':
|
||||
return signedStatus === SigitStatus.Partial && isMatch
|
||||
case 'Show all':
|
||||
return isMatch
|
||||
default:
|
||||
console.error('Filter case not handled.')
|
||||
}
|
||||
})
|
||||
.sort((a, b) => {
|
||||
const x = parsedSigits[a].createdAt ?? 0
|
||||
const y = parsedSigits[b].createdAt ?? 0
|
||||
return sort === 'desc' ? y - x : x - y
|
||||
})
|
||||
.map((key) => (
|
||||
<DisplaySigit
|
||||
key={`sigit-${key}`}
|
||||
sigitCreateId={key}
|
||||
parsedMeta={parsedSigits[key]}
|
||||
meta={sigits[key]}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className={styles.submissions}>{renderSubmissions()}</div>
|
||||
</Container>
|
||||
<Footer />
|
||||
</div>
|
||||
|
@ -99,3 +99,10 @@
|
||||
gap: 25px;
|
||||
grid-template-columns: repeat(auto-fit, minmax(365px, 1fr));
|
||||
}
|
||||
|
||||
.noResults {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
font-weight: normal;
|
||||
color: #a1a1a1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user