Skip to content

Commit

Permalink
center icon
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSin committed Feb 7, 2023
1 parent 73472a2 commit c607d02
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/renderer/components/Settings/SettingsMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as React from 'react'
import Tabs from '@material-ui/core/Tabs'
import Tab from '@material-ui/core/Tab'
import { useIntl } from 'react-intl'
import { makeStyles } from '@material-ui/core'

/** @typedef {{tabId:import('.').SettingTabId, icon:(string | React.ReactElement<any, string | React.JSXElementConstructor<any>>), label:import('react-intl').MessageDescriptor}} SettingsTabs */

Expand All @@ -17,6 +18,8 @@ import { useIntl } from 'react-intl'
export const SettingsMenu = ({ tabs, currentTab, setCurrentTab }) => {
const { formatMessage: t } = useIntl()

const classes = useStyles()

return (
<Tabs
orientation='vertical'
Expand All @@ -25,7 +28,7 @@ export const SettingsMenu = ({ tabs, currentTab, setCurrentTab }) => {
>
{tabs.map(tab => (
<Tab
style={{ textTransform: 'none' }}
className={classes.tab}
label={t(tab.label)}
key={tab.tabId}
value={tab.tabId}
Expand All @@ -35,3 +38,12 @@ export const SettingsMenu = ({ tabs, currentTab, setCurrentTab }) => {
</Tabs>
)
}

const useStyles = makeStyles({
tab: {
textTransform: 'none',
'& .MuiTab-wrapper > *:first-child': {
marginBottom: 0
}
}
})

0 comments on commit c607d02

Please sign in to comment.