From 9d573cf3c765fb457d3353b19043f690fa6e3558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=B0=D1=81=D1=83=D0=BB?= Date: Wed, 13 Dec 2023 00:42:41 +0300 Subject: [PATCH] feat: hide topic and queued sources --- .../SourcesTableModal/SourcesView/index.tsx | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/components/SourcesTableModal/SourcesView/index.tsx b/src/components/SourcesTableModal/SourcesView/index.tsx index 514dcb88c..2ebd73297 100644 --- a/src/components/SourcesTableModal/SourcesView/index.tsx +++ b/src/components/SourcesTableModal/SourcesView/index.tsx @@ -3,6 +3,7 @@ import Tabs from '@mui/material/Tabs' import * as React from 'react' import styled from 'styled-components' import { Flex } from '~/components/common/Flex' +import { useUserStore } from '~/stores/useUserStore' import { colors } from '~/utils/colors' import { QueuedSources } from './QueuedSources' import { Sources } from './Sources' @@ -39,6 +40,7 @@ function a11yProps(index: number) { export const SourcesView = () => { const [value, setValue] = React.useState(0) + const [isAdmin] = useUserStore((s) => [s.isAdmin]) const handleChange = (event: React.SyntheticEvent, newValue: number) => { setValue(newValue) @@ -48,18 +50,26 @@ export const SourcesView = () => { - - + {isAdmin && ( + <> + + + + )} - - - - - - + {isAdmin && ( + <> + + + + + + + + )} ) }