Skip to content

Commit

Permalink
feat(claim): remove default attester when create claim
Browse files Browse the repository at this point in the history
release-as: 0.9.0
  • Loading branch information
zzcwoshizz committed Dec 23, 2022
1 parent 377a17d commit d6814c4
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions packages/page-ctype/src/create/CreateClaim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import type { CType } from '@zcloak/ctype/types';
import type { AnyJson } from '@zcloak/vc/types';

import React, { useCallback, useMemo, useState } from 'react';
import React, { useCallback, useState } from 'react';
import { useNavigate } from 'react-router-dom';

import { Did } from '@zcloak/did';
Expand All @@ -20,7 +20,6 @@ import {
} from '@credential/react-components';
import { CreateSubject } from '@credential/react-ctype';
import { InputDid } from '@credential/react-dids';
import { resolver } from '@credential/react-dids/instance';
import { useCTypeMetaForAttest, useToggle } from '@credential/react-hooks';

import SubmitClaim from './SubmitClaim';
Expand All @@ -33,14 +32,6 @@ function CreateClaim({ ctype }: { ctype: CType }) {

const ctypeMeta = useCTypeMetaForAttest(ctype.$id);

const defaultAttester = useMemo(() => {
try {
return resolver.parseDid(ctype.publisher).did;
} catch {}

return ctype.publisher;
}, [ctype.publisher]);

const onDone = useCallback(() => {
toggleOpen();
navigate('/claimer/claims');
Expand All @@ -63,7 +54,7 @@ function CreateClaim({ ctype }: { ctype: CType }) {
<Typography mb={4} textAlign="center" variant="h2">
Create Claim
</Typography>
<InputDid defaultValue={defaultAttester} label="Attester" onChange={setAttester} />
<InputDid label="Attester" onChange={setAttester} />
<Box mt={2}>
<CreateSubject onChange={setContents as any} schema={ctype} />
</Box>
Expand Down

0 comments on commit d6814c4

Please sign in to comment.