diff --git a/examples/react-graphql/client/src/components/Credential/Credential.tsx b/examples/react-graphql/client/src/components/Credential/Credential.tsx new file mode 100644 index 000000000..1914560d0 --- /dev/null +++ b/examples/react-graphql/client/src/components/Credential/Credential.tsx @@ -0,0 +1,26 @@ +import React from 'react' +import { Box, Heading, Text, Icon, Avatar } from 'rimble-ui' +import Page from '../../layout/Page' + +interface Props { + onClick?: () => void +} + +const Component: React.FC = ({ onClick }) => { + return ( + + + + + Simon + + + Mircea + + + + + ) +} + +export default Component diff --git a/examples/react-graphql/client/src/components/MessageItem/MessageItem.tsx b/examples/react-graphql/client/src/components/MessageItem/MessageItem.tsx new file mode 100644 index 000000000..9b337b1f0 --- /dev/null +++ b/examples/react-graphql/client/src/components/MessageItem/MessageItem.tsx @@ -0,0 +1,31 @@ +import React from 'react' +import { Box, Heading, Text, Icon, Avatar } from 'rimble-ui' + +import Credential from '../../components/Credential/Credential' + +interface Props { + credentialAction?: () => void +} + +const Component: React.FC = ({ credentialAction }) => { + return ( + + + + + + Simon sent 4 credentials to Mircea + + + + + + + + + + + ) +} + +export default Component diff --git a/examples/react-graphql/client/src/layout/Layout.tsx b/examples/react-graphql/client/src/layout/Layout.tsx index 4f1dfdb3f..828f5e466 100644 --- a/examples/react-graphql/client/src/layout/Layout.tsx +++ b/examples/react-graphql/client/src/layout/Layout.tsx @@ -2,7 +2,7 @@ import React, { useState } from 'react' import { useQuery, useMutation } from '@apollo/react-hooks' import { Flex, Box, Text, Heading, Button, Icon, Table, Field, Input } from 'rimble-ui' -import { Switch, Route, BrowserRouter as Router } from 'react-router-dom' +import { Switch, Route, BrowserRouter as Router, Redirect } from 'react-router-dom' import Activity from '../views/Activity/Activity' import Explore from '../views/Explore/Explore' @@ -14,6 +14,7 @@ import Issue from '../views/Issue/Issue' import Sidebar from './Sidebar' import NavigationLeft from './NavigationLeft' +import Credential from '../components/Credential/Credential' interface DashboardProps {} @@ -26,6 +27,9 @@ const Dashboard: React.FC = () => { + + + @@ -47,9 +51,12 @@ const Dashboard: React.FC = () => { - + + + + diff --git a/examples/react-graphql/client/src/layout/NavigationLeft.tsx b/examples/react-graphql/client/src/layout/NavigationLeft.tsx index d6723ecb3..9bf3664c9 100644 --- a/examples/react-graphql/client/src/layout/NavigationLeft.tsx +++ b/examples/react-graphql/client/src/layout/NavigationLeft.tsx @@ -11,9 +11,7 @@ const Component = () => {
  • - - Activity - + Activity
  • Explore diff --git a/examples/react-graphql/client/src/queries.ts b/examples/react-graphql/client/src/queries.ts index 2d0d439f5..d7d163a86 100644 --- a/examples/react-graphql/client/src/queries.ts +++ b/examples/react-graphql/client/src/queries.ts @@ -59,6 +59,7 @@ export const allMessages = gql` } vc { rowId + hash fields { type value diff --git a/examples/react-graphql/client/src/views/Activity/Activity.tsx b/examples/react-graphql/client/src/views/Activity/Activity.tsx index 9d65852bc..812a6cb4f 100644 --- a/examples/react-graphql/client/src/views/Activity/Activity.tsx +++ b/examples/react-graphql/client/src/views/Activity/Activity.tsx @@ -13,12 +13,14 @@ import { Loader, QR, Modal, + Avatar, } from 'rimble-ui' -import Panel from '../../components/Panel/Panel' +import MessageItem from '../../components/MessageItem/MessageItem' import Page from '../../layout/Page' import * as queries from '../../queries' import { AppContext } from '../../context/AppProvider' import { useQuery } from '@apollo/react-hooks' +import { useHistory, useRouteMatch } from 'react-router-dom' interface Activity {} @@ -26,6 +28,8 @@ const Activity: React.FC = () => { const [appState] = useContext(AppContext) const [isQROpen, setIsQROpen] = useState(false) const [qrValue, setQrValue] = useState('') + const history = useHistory() + const { url } = useRouteMatch() const { loading: messagesLoading, data: messagesData } = useQuery(queries.allMessages, { variables: { activeDid: appState.defaultDid }, @@ -49,8 +53,44 @@ const Activity: React.FC = () => { /> - - + + + history.push( + `${url}/credential/4b61787d8ee3f136b2079b8d766e85a4c9fc65ff2fe70cb78b9871d1e09e45efb86c8a6f6828c9e639f9350bf0affec9d6caff98703c9497ea7138974d4033fc`, + ) + } + /> + + history.push( + `${url}/credential/4b61787d8ee3f136b2079b8d766e85a4c9fc65ff2fe70cb78b9871d1e09e45efb86c8a6f6828c9e639f9350bf0affec9d6caff98703c9497ea7138974d4033fc`, + ) + } + /> + + history.push( + `${url}/credential/4b61787d8ee3f136b2079b8d766e85a4c9fc65ff2fe70cb78b9871d1e09e45efb86c8a6f6828c9e639f9350bf0affec9d6caff98703c9497ea7138974d4033fc`, + ) + } + /> + + history.push( + `${url}/credential/4b61787d8ee3f136b2079b8d766e85a4c9fc65ff2fe70cb78b9871d1e09e45efb86c8a6f6828c9e639f9350bf0affec9d6caff98703c9497ea7138974d4033fc`, + ) + } + /> + + history.push( + `${url}/credential/4b61787d8ee3f136b2079b8d766e85a4c9fc65ff2fe70cb78b9871d1e09e45efb86c8a6f6828c9e639f9350bf0affec9d6caff98703c9497ea7138974d4033fc`, + ) + } + /> + + {/*
    @@ -91,8 +131,7 @@ const Activity: React.FC = () => { ))} -
    Sender
    -
    + */} ) } diff --git a/examples/react-graphql/client/src/views/Identity/IdentitiyManager.tsx b/examples/react-graphql/client/src/views/Identity/IdentitiyManager.tsx index 833959f0c..1918d0dae 100644 --- a/examples/react-graphql/client/src/views/Identity/IdentitiyManager.tsx +++ b/examples/react-graphql/client/src/views/Identity/IdentitiyManager.tsx @@ -21,7 +21,7 @@ const Component = () => { const showIdentityDetail = (did: string) => { highlightIdentity(did) - history.push(`${url}/${did}`) + history.push(`${url}/user/${did}`) } console.log(appState)