diff --git a/front-end/src/components/Filters.tsx b/front-end/src/components/Filters.tsx new file mode 100644 index 000000000..3b23a7853 --- /dev/null +++ b/front-end/src/components/Filters.tsx @@ -0,0 +1,40 @@ +// Copyright 2019-2020 @paritytech/polkassembly authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import React from 'react'; +import { Checkbox, CheckboxProps, Form } from 'semantic-ui-react'; + +import Card from '../ui-components/Card'; + +interface Props { + className?: string + showOwnProposals: boolean + onShowOwnProposalChange: (value: boolean) => void +} + +const Filters = ({ className, showOwnProposals, onShowOwnProposalChange }: Props) => { + + const onOwnProposalChanged = (event: React.FormEvent, data: CheckboxProps) => { + onShowOwnProposalChange(data.checked || false); + }; + + return ( + +
+ + +
Filters
+
+
+ + + + + +
+
+ ); +}; + +export default Filters; diff --git a/front-end/src/components/Listings/DiscussionsListing.tsx b/front-end/src/components/Listings/DiscussionsListing.tsx index 4851ab4e4..a4295513b 100644 --- a/front-end/src/components/Listings/DiscussionsListing.tsx +++ b/front-end/src/components/Listings/DiscussionsListing.tsx @@ -3,19 +3,23 @@ // of the Apache-2.0 license. See the LICENSE file for details. import styled from '@xstyled/styled-components'; -import React from 'react'; +import React, { useContext } from 'react'; import { Link } from 'react-router-dom'; import getDefaultAddressField from 'src/util/getDefaultAddressField'; +import { UserDetailsContext } from '../../context/UserDetailsContext'; import { LatestDiscussionPostsQuery } from '../../generated/graphql'; import DiscussionCard from '../DiscussionCard'; interface Props { className?: string data: LatestDiscussionPostsQuery + showOwnProposals?: boolean } -const Discussions = ({ className, data }: Props) => { +const Discussions = ({ className, data, showOwnProposals }: Props) => { + const currentUser = useContext(UserDetailsContext); + if (!data.posts || !data.posts.length) return
No discussion found.
; const defaultAddressField = getDefaultAddressField(); @@ -23,7 +27,7 @@ const Discussions = ({ className, data }: Props) => { return (