-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: [Registry] Better search #21
Changes from 31 commits
edc4c63
748a72d
23a540b
8bdb0e7
edad7fb
bd906d6
f258525
54f270f
ba61937
e406c38
e85fdce
6428372
b9a6cd4
aaed88b
7c7dd19
0b9d063
0606d06
e02f353
2db3081
acd60d2
577625a
ba86580
32483c9
8b0a5e1
b510443
daf79fe
fa96df5
2414555
73d7f2a
cdf9285
04f10f5
9d6e29d
811c459
4069101
555f06b
ffb02ce
49b8912
05b8cc1
f15d10a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,14 +1,13 @@ | ||||||
import { useState, useCallback } from 'react'; | ||||||
import PropTypes from 'prop-types'; | ||||||
import capitalize from 'lodash/capitalize'; | ||||||
import { | ||||||
Row, Col, Button, Typography, | ||||||
} from 'antd'; | ||||||
import { Row, Col, Button, Typography } from 'antd'; | ||||||
import { get } from 'lodash'; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, sure. Does it add any improvements? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, there's a small difference using this plugin: https://marketplace.visualstudio.com/items?itemName=ambar.bundle-size not 100% sure if it's accurate post-build, but if it is then we should consider reducing where we can There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ahh, nice! |
||||||
import { Loader, NA } from '@autonolas/frontend-library'; | ||||||
|
||||||
import { NAV_TYPES } from '../../util/constants'; | ||||||
import { useMetadata } from '../hooks/useMetadata'; | ||||||
import { useHelpers } from '../hooks'; | ||||||
import { typePropType } from '../propTypes'; | ||||||
import { IpfsHashGenerationModal } from '../List/IpfsHashGenerationModal'; | ||||||
import { useDetails } from './useDetails'; | ||||||
|
@@ -31,16 +30,16 @@ export const Details = ({ | |||||
}) => { | ||||||
const [isModalVisible, setIsModalVisible] = useState(false); | ||||||
|
||||||
const { | ||||||
isLoading, isOwner, info, ownerAddress, tokenUri, updateDetails, | ||||||
} = useDetails({ | ||||||
id, | ||||||
type, | ||||||
getDetails, | ||||||
getOwner, | ||||||
getTokenUri, | ||||||
}); | ||||||
const { nftImageUrl } = useMetadata(tokenUri); | ||||||
const { isMainnet } = useHelpers(); | ||||||
const { isLoading, isOwner, info, ownerAddress, tokenUri, updateDetails } = | ||||||
useDetails({ | ||||||
id, | ||||||
type, | ||||||
getDetails, | ||||||
getOwner, | ||||||
getTokenUri, | ||||||
}); | ||||||
const { nftImageUrl, packageName } = useMetadata(tokenUri); | ||||||
|
||||||
// Update button to be show only if the connected account is the owner | ||||||
// and only for agent and component | ||||||
|
@@ -58,10 +57,18 @@ export const Details = ({ | |||||
<> | ||||||
<Header> | ||||||
<div> | ||||||
<Text strong>{`${capitalize(type)} Name`}</Text> | ||||||
<DetailsTitle level={2}> | ||||||
{`${capitalize(type)} ID ${id}`} | ||||||
</DetailsTitle> | ||||||
{isMainnet ? ( | ||||||
<> | ||||||
mohandast52 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
<DetailsTitle level={3}>{packageName}</DetailsTitle> | ||||||
</> | ||||||
) : ( | ||||||
<> | ||||||
<Text strong>{`${capitalize(type)} Name`}</Text> | ||||||
<DetailsTitle level={2}> | ||||||
{`${capitalize(type)} ID ${id}`} | ||||||
</DetailsTitle> | ||||||
</> | ||||||
)} | ||||||
</div> | ||||||
|
||||||
<div className="right-content"> | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a component with a single export, please move to components folder and name Details.jsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is currently used by agents, components, and services, so I've kept it in the
common-utils
. Any reason to move it tocomponents
folder instead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, so...
the
components
folder is for reusable components i.e. this Details component, used by multiple othersthe
pages
folder should be reserved for specific pages that pull in reusable components to create the expected pagethe
common-utils
orutils
folders should be for helper functions, i.e. string parsers, converters, object manipulation .etc, perhaps constants, though I tend to put it outside ofutils
folder to seperate concernsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand your point, but my approach differs slightly:
page
simply imports the core components. I believe if we start adding the core components here, it will become too large to maintain, especially since they tend to grow in size.components
is for core components such as Agents, Services, etc.common-util
is intended for common components that can be used by other core components. For example components that can be used in Agents, Services, etcutils
is reserved for constants, but we could potentially move it tocommon-util
.I think eventually, the truly reusable components will be moved to feature libraries in NX, such as the login component, utility functions, etc.