-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jason Healy
committed
May 20, 2020
1 parent
a39f956
commit 50579e0
Showing
3 changed files
with
53 additions
and
13 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
examples/react-graphql/client/src/components/Credential/CredentialList.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from 'react' | ||
import * as Types from '../../types' | ||
import Credential from './Credential' | ||
import { Box, Heading, Text } from 'rimble-ui' | ||
import './Credential.css' | ||
import * as queries from '../../gql/queries' | ||
import { useQuery } from 'react-apollo' | ||
import { useParams } from 'react-router-dom' | ||
|
||
const S = require('sugar/string') | ||
|
||
interface Props {} | ||
|
||
const Component: React.FC<Props> = ({}) => { | ||
const { id } = useParams() | ||
const { data } = useQuery(queries.credentials, { variables: { id } }) | ||
|
||
return ( | ||
<Box> | ||
<Heading as={'h3'} mt={2} mb={3}> | ||
Credentials | ||
</Heading> | ||
{data && | ||
data.credentials && | ||
data.credentials.map((credential: any) => { | ||
return ( | ||
<Credential | ||
key={credential.hash} | ||
issuer={credential.issuer} | ||
subject={credential.subject} | ||
claims={credential.claims} | ||
jwt={credential.jwt} | ||
/> | ||
) | ||
})} | ||
</Box> | ||
) | ||
} | ||
|
||
export default Component |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters