Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
21e2c004
Commit
21e2c004
authored
Dec 22, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
empty expiry date in search results
parent
eb3459d4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
4 deletions
+8
-4
search.ts
types/api/search.ts
+1
-1
SearchResultListItem.tsx
ui/searchResults/SearchResultListItem.tsx
+3
-1
SearchResultTableItem.tsx
ui/searchResults/SearchResultTableItem.tsx
+2
-1
SearchBarSuggestAddress.tsx
...ts/searchBar/SearchBarSuggest/SearchBarSuggestAddress.tsx
+2
-1
No files found.
types/api/search.ts
View file @
21e2c004
...
...
@@ -25,7 +25,7 @@ export interface SearchResultAddressOrContract {
url
?:
string
;
// not used by the frontend, we build the url ourselves
ens_info
?:
{
address_hash
:
string
;
expiry_date
:
string
;
expiry_date
?
:
string
;
name
:
string
;
names_count
:
number
;
};
...
...
ui/searchResults/SearchResultListItem.tsx
View file @
21e2c004
...
...
@@ -270,6 +270,8 @@ const SearchResultListItem = ({ data, searchTerm, isLoading }: Props) => {
case
'
address
'
:
{
const
shouldHighlightHash
=
ADDRESS_REGEXP
.
test
(
searchTerm
);
const
addressName
=
data
.
name
||
data
.
ens_info
?.
name
;
const
expiresText
=
data
.
ens_info
?.
expiry_date
?
` (expires
${
dayjs
(
data
.
ens_info
.
expiry_date
).
fromNow
()
}
)`
:
''
;
return
addressName
?
(
<>
<
span
dangerouslySetInnerHTML=
{
{
__html
:
shouldHighlightHash
?
xss
(
addressName
)
:
highlightText
(
addressName
,
searchTerm
)
}
}
/>
...
...
@@ -277,7 +279,7 @@ const SearchResultListItem = ({ data, searchTerm, isLoading }: Props) => {
(
data
.
ens_info
.
names_count
>
1
?
<
chakra
.
span
color=
"text_secondary"
>
(+
{
data
.
ens_info
.
names_count
-
1
}
)
</
chakra
.
span
>
:
<
chakra
.
span
color=
"text_secondary"
>
(expires
{
dayjs
(
data
.
ens_info
.
expiry_date
).
fromNow
()
}
)
</
chakra
.
span
>
<
chakra
.
span
color=
"text_secondary"
>
{
expiresText
}
</
chakra
.
span
>
)
}
</>
...
...
ui/searchResults/SearchResultTableItem.tsx
View file @
21e2c004
...
...
@@ -103,6 +103,7 @@ const SearchResultTableItem = ({ data, searchTerm, isLoading }: Props) => {
implementation_name
:
null
,
ens_domain_name
:
null
,
};
const
expiresText
=
data
.
ens_info
?.
expiry_date
?
` (expires
${
dayjs
(
data
.
ens_info
.
expiry_date
).
fromNow
()
}
)`
:
''
;
return
(
<>
...
...
@@ -131,7 +132,7 @@ const SearchResultTableItem = ({ data, searchTerm, isLoading }: Props) => {
(
data
.
ens_info
.
names_count
>
1
?
<
chakra
.
span
color=
"text_secondary"
>
(+
{
data
.
ens_info
.
names_count
-
1
}
)
</
chakra
.
span
>
:
<
chakra
.
span
color=
"text_secondary"
>
(expires
{
dayjs
(
data
.
ens_info
.
expiry_date
).
fromNow
()
}
)
</
chakra
.
span
>
<
chakra
.
span
color=
"text_secondary"
>
{
expiresText
}
</
chakra
.
span
>
)
}
</
Td
>
...
...
ui/snippets/searchBar/SearchBarSuggest/SearchBarSuggestAddress.tsx
View file @
21e2c004
...
...
@@ -31,6 +31,7 @@ const SearchBarSuggestAddress = ({ data, isMobile, searchTerm }: Props) => {
/>
);
const
addressName
=
data
.
name
||
data
.
ens_info
?.
name
;
const
expiresText
=
data
.
ens_info
?.
expiry_date
?
` (expires
${
dayjs
(
data
.
ens_info
.
expiry_date
).
fromNow
()
}
)`
:
''
;
const
nameEl
=
addressName
&&
(
<
Text
...
...
@@ -44,7 +45,7 @@ const SearchBarSuggestAddress = ({ data, isMobile, searchTerm }: Props) => {
(
data
.
ens_info
.
names_count
>
1
?
<
span
>
(+
{
data
.
ens_info
.
names_count
-
1
}
)
</
span
>
:
<
span
>
(expires
{
dayjs
(
data
.
ens_info
.
expiry_date
).
fromNow
()
}
)
</
span
>
<
span
>
{
expiresText
}
</
span
>
)
}
</
Text
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment