Skip to content

Commit

Permalink
feat(search): remove suggestions, edit in studio button (#1325)
Browse files Browse the repository at this point in the history
  • Loading branch information
happylolonly authored Oct 9, 2024
1 parent 5ed06e8 commit 86f48b6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { BondStatus } from 'cosmjs-types/cosmos/staking/v1beta1/staking';
import { useBackend } from 'src/contexts/backend/backend';
import { CHAIN_ID, BASE_DENOM } from 'src/constants/config';
import { KEY_TYPE } from 'src/pages/Keys/types';
import { routes } from 'src/routes';
import { ContainetLedger } from './container';
import { Dots } from '../ui/Dots';
import Account from '../account/account';
Expand Down Expand Up @@ -95,27 +96,15 @@ export function StartStageSearchActionBar({
onChangeInput,
onClickClear,
file,
searchHash,
textBtn = 'Cyberlink',
placeholder = 'add keywords, hash or file',
keys = 'ledger',
}) {
const { isIpfsInitialized } = useBackend();
return (
// use NodeIsLoadingButton component
<ActionBar
button={{
disabled: !isIpfsInitialized || !contentHash.length,
onClick: onClickBtn,
text: !isIpfsInitialized ? (
<>
Node is loading&nbsp;
<Dots />
</>
) : (
textBtn
),
}}
>
<ActionBar>
<Pane
display="flex"
flexDirection="column"
Expand Down Expand Up @@ -150,6 +139,24 @@ export function StartStageSearchActionBar({
/>
</Pane>
</Pane>

<Button
disabled={!isIpfsInitialized || !contentHash.length}
onClick={onClickBtn}
>
{!isIpfsInitialized ? (
<>
Node is loading&nbsp;
<Dots />
</>
) : (
textBtn
)}
</Button>

<Button link={`${routes.studio.path}?cid=${searchHash}`}>
edit in studio
</Button>
</ActionBar>
);
}
Expand Down
1 change: 1 addition & 0 deletions src/containers/Search/ActionBarContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ class ActionBarContainer extends Component<Props, any> {
keys={addressLocalStor !== null ? addressLocalStor.keys : false}
onClickBtn={this.onClickInit}
contentHash={file?.name || contentHash}
searchHash={this.props.keywordHash}
onChangeInputContentHash={this.onChangeInput}
inputOpenFileRef={this.inputOpenFileRef}
showOpenFileDlg={this.showOpenFileDlg}
Expand Down
5 changes: 2 additions & 3 deletions src/containers/ipfs/ipfs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import ContentIpfsCid from './components/ContentIpfsCid';
import styles from './IPFS.module.scss';
import SearchResults from '../Search/SearchResults';
import AdviserMeta from './components/AdviserMeta/AdviserMeta';
import SoulCompanion from './components/SoulCompanion/SoulCompanion';

function Ipfs() {
const { query = '' } = useParams();
Expand Down Expand Up @@ -96,9 +95,9 @@ function Ipfs() {
/>
)}

{details && (
{/* {details && (
<SoulCompanion cid={cid} details={details} skip={mutated} />
)}
)} */}
</div>
<SearchResults />
</MainContainer>
Expand Down

0 comments on commit 86f48b6

Please sign in to comment.