Skip to content

Commit

Permalink
fix: fix tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
Расул authored and Расул committed Dec 13, 2023
1 parent 3fefcc0 commit 30dd89f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 27 deletions.
20 changes: 9 additions & 11 deletions src/components/SettingsModal/SettingsView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useEffect, useState } from 'react'
import styled from 'styled-components'
import { Flex } from '~/components/common/Flex'
import { Text } from '~/components/common/Text'
import { getAboutData, TAboutParams } from '~/network/fetchSourcesData'
import { TAboutParams, getAboutData } from '~/network/fetchSourcesData'
import { useUserStore } from '~/stores/useUserStore'
import { colors } from '~/utils/colors'
import { UserPermissions } from '../UserPermissions'
Expand Down Expand Up @@ -101,16 +101,14 @@ export const SettingsView: React.FC<Props> = ({ onClose }) => {
{isAdmin && <StyledTab disableRipple label="User Permissions" {...a11yProps(2)} />}
</StyledTabs>
</SettingsHeader>
{isAdmin && (
<>
<TabPanel index={0} value={value}>
{!loading ? <General initialValues={initialValues} /> : <></>}
</TabPanel>
<TabPanel index={2} value={value}>
{!loading ? <UserPermissions initialValues={initialValues} /> : <></>}
</TabPanel>
</>
)}

<TabPanel index={0} value={value}>
{!loading ? <General initialValues={initialValues} /> : <></>}
</TabPanel>
<TabPanel index={2} value={value}>
{!loading ? <UserPermissions initialValues={initialValues} /> : <></>}
</TabPanel>

<TabPanel index={isAdmin ? 1 : 0} value={value}>
<Appearance onClose={onClose} />
</TabPanel>
Expand Down
24 changes: 8 additions & 16 deletions src/components/SourcesTableModal/SourcesView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,18 @@ export const SourcesView = () => {
<Wrapper direction="column">
<StyledTabs aria-label="basic tabs example" onChange={handleChange} value={value}>
<StyledTab disableRipple label="Sources table" {...a11yProps(0)} />
{isAdmin && (
<>
<StyledTab color={colors.white} disableRipple label="Queued sources" {...a11yProps(1)} />
<StyledTab color={colors.white} disableRipple label="Topics" {...a11yProps(1)} />
</>
)}
{isAdmin && <StyledTab color={colors.white} disableRipple label="Queued sources" {...a11yProps(1)} />}
{isAdmin && <StyledTab color={colors.white} disableRipple label="Topics" {...a11yProps(1)} />}
</StyledTabs>
<TabPanel index={0} value={value}>
<Sources />
</TabPanel>
{isAdmin && (
<>
<TabPanel index={1} value={value}>
<QueuedSources />
</TabPanel>
<TabPanel index={2} value={value}>
<TopicSources />
</TabPanel>
</>
)}
<TabPanel index={1} value={value}>
<QueuedSources />
</TabPanel>
<TabPanel index={2} value={value}>
<TopicSources />
</TabPanel>
</Wrapper>
)
}
Expand Down

0 comments on commit 30dd89f

Please sign in to comment.