lhs of && cannot be a number
needs to be false for the hole
This commit is contained in:
parent
1548bcd378
commit
99f1ba799d
1 changed files with 13 additions and 7 deletions
|
@ -78,7 +78,9 @@ const Page: React.FC = () => {
|
|||
}}
|
||||
>
|
||||
<div style={{ marginBottom: "1rem" }} />
|
||||
{(filteredCodes.length || searchTerm.length) && (
|
||||
{filteredCodes.length == 0 && searchTerm.length == 0 ? (
|
||||
<></>
|
||||
) : (
|
||||
<TextField
|
||||
id="search"
|
||||
name="search"
|
||||
|
@ -100,11 +102,7 @@ const Page: React.FC = () => {
|
|||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
{filteredCodes.length ? (
|
||||
filteredCodes.map((code) => (
|
||||
<CodeDisplay key={code.id} code={code} />
|
||||
))
|
||||
) : (
|
||||
{filteredCodes.length == 0 ? (
|
||||
<div
|
||||
style={{
|
||||
alignItems: "center",
|
||||
|
@ -113,8 +111,16 @@ const Page: React.FC = () => {
|
|||
marginTop: "32px",
|
||||
}}
|
||||
>
|
||||
{searchTerm.length && <p>{t("NO_RESULTS")}</p>}
|
||||
{searchTerm.length > 0 ? (
|
||||
<p>{t("NO_RESULTS")}</p>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
filteredCodes.map((code) => (
|
||||
<CodeDisplay key={code.id} code={code} />
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
<Footer />
|
||||
|
|
Loading…
Add table
Reference in a new issue