Skip to content

Commit

Permalink
fix: Fix rendering route sidepanels
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Healy committed Jan 27, 2020
1 parent d930b92 commit 7c10ce9
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 20 deletions.
28 changes: 24 additions & 4 deletions examples/react-graphql/client/src/components/Request/Request.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Box, Heading } from 'rimble-ui'
import { Box, Heading, Avatar, Text } from 'rimble-ui'
import * as Types from '../../types'

interface Props {
Expand All @@ -8,10 +8,30 @@ interface Props {
sdr: any
}

const Component: React.FC<Props> = ({ sdr }) => {
console.log(sdr)
const Component: React.FC<Props> = ({ sdr, sender, receiver }) => {
console.log(sdr, sender, receiver)

return <Box>Show contents from query. Results are logged in console..</Box>
return (
<Box>
<Box
flexDirection={'column'}
justifyContent={'center'}
alignItems={'center'}
display={'flex'}
flex={1}
py={4}
bg={'#252731'}
>
<Avatar size={'60px'} src={''} />
<Heading as={'h3'} mt={2}>
{sender.shortId}
</Heading>
</Box>
<Box bg={'#000000'} p={3}>
<Text>Share your data with {sender.shortId}</Text>
</Box>
</Box>
)
}

export default Component
5 changes: 5 additions & 0 deletions examples/react-graphql/client/src/gql/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ export const queryMessage = gql`
shortId
profileImage
}
receiver {
did
shortId
profileImage
}
}
}
`
Expand Down
40 changes: 24 additions & 16 deletions examples/react-graphql/client/src/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,30 @@ const Dashboard: React.FC<DashboardProps> = () => {
<IdentityDetail />
</SidePanel>
</Route>
<Route path="/activity/credential/:id">
<SidePanel
title={'Credential'}
closeUrl={'/activity'}
query={queries.credential}
renderQuery={renderCredentialQuery}
></SidePanel>
</Route>
<Route path="/activity/sdr/:id">
<SidePanel
title={'Selective Disclosure'}
closeUrl={'/activity'}
query={queries.queryMessage}
renderQuery={renderSDRQuery}
></SidePanel>
</Route>
<Route
exact
path="/activity/credential/:id"
component={() => (
<SidePanel
title={'Credential'}
closeUrl={'/activity'}
query={queries.credential}
renderQuery={renderCredentialQuery}
></SidePanel>
)}
></Route>
<Route
exact
path="/activity/sdr/:id"
component={() => (
<SidePanel
title={'Selective Disclosure'}
closeUrl={'/activity'}
query={queries.queryMessage}
renderQuery={renderSDRQuery}
></SidePanel>
)}
></Route>
</Switch>
</Flex>
</Router>
Expand Down

0 comments on commit 7c10ce9

Please sign in to comment.