Skip to content

Commit

Permalink
light_theme_tree_settings
Browse files Browse the repository at this point in the history
  • Loading branch information
NoelKova committed Jul 18, 2024
1 parent c171d27 commit 000945d
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 37 deletions.
7 changes: 6 additions & 1 deletion apps/sensenet/src/components/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,16 @@ export function Breadcrumbs<T extends GenericContent>(props: BreadcrumbProps<T>)

return (
<>
<MUIBreadcrumbs maxItems={5} aria-label="breadcrumb">
<MUIBreadcrumbs
maxItems={5}
aria-label="breadcrumb"
style={{ marginLeft: '8.5px' }}
classes={{ separator: 'bread-crumbs-separator' }}>
{props.items.map((item) => (
<DropFileArea key={item.content.Id} parentContent={item.content} style={{ display: 'flex' }}>
<Tooltip title={item.title}>
<Button
style={{ minWidth: '12px' }}
data-test={`breadcrumb-item-${item.displayName.replace(/\s+/g, '-').toLowerCase()}`}
aria-label={item.displayName}
onClick={(ev) => props.onItemClick(ev, item)}
Expand Down
9 changes: 5 additions & 4 deletions apps/sensenet/src/components/appbar/desktop-app-bar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AppBar, createStyles, IconButton, makeStyles, Toolbar } from '@material-ui/core'
import { AppBar, createStyles, IconButton, makeStyles, Theme, Toolbar } from '@material-ui/core'
import Menu from '@material-ui/icons/Menu'
import { useRepository } from '@sensenet/hooks-react'
import { clsx } from 'clsx'
Expand All @@ -10,12 +10,13 @@ import { globals, useGlobalStyles } from '../../globalStyles'
import { CommandPalette } from '../command-palette/CommandPalette'
import { DesktopNavMenu } from './desktop-nav-menu'

const useStyles = makeStyles(() => {
const useStyles = makeStyles((theme: Theme) => {
return createStyles({
appBar: {
position: 'relative',
height: globals.common.headerHeight,
backgroundColor: globals.common.headerBackground,
backgroundColor:
theme.palette.type === 'dark' ? globals.common.headerBackground : globals.common.headerLightBackground,
boxShadow: 'none',
},
toolBar: {
Expand All @@ -26,7 +27,7 @@ const useStyles = makeStyles(() => {
paddingRight: 0,
},
logo: {
marginRight: '40px',
marginRight: '32px',
filter: 'drop-shadow(0px 0px 3px black)',
},
commandPaletteReplacement: {
Expand Down
16 changes: 8 additions & 8 deletions apps/sensenet/src/components/content-list/contenttype-list.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { lazy, useState } from 'react'
import { PATHS } from '../../application-paths'
import { Switch } from '@sensenet/controls-react'
import { useRepository } from '@sensenet/hooks-react'
import React, { lazy, useState } from 'react'
import { PATHS } from '../../application-paths'

const ContentComponent = lazy(() => import(/* webpackChunkName: "content" */ '../content'))

Expand All @@ -17,11 +17,12 @@ const ContentTypeList: React.FC = () => {
}

return (
<div style={{ marginTop: '20px', marginBottom: '20px' }}>
<label htmlFor="showHiddenTypes" style={{ marginRight: '10px' }}>
<div style={{ marginTop: '12px', marginBottom: '12px' }}>
<label htmlFor="showHiddenTypes" style={{ marginRight: '10px', paddingLeft: '17px', cursor: 'pointer' }}>
Show hidden types
</label>
<Switch
id="showHiddenTypes"
data-test="hidden-type-switch"
size="medium"
checked={showHiddenTypes}
Expand All @@ -31,10 +32,9 @@ const ContentTypeList: React.FC = () => {
)
}

const contentTypeQuery =
"+TypeIs:'ContentType'" +
(isCategoryFieldAvailable && !showHiddenTypes ? ' -Categories:*HideByDefault*' : '') +
' .AUTOFILTERS:OFF'
const contentTypeQuery = `+TypeIs:'ContentType'${
isCategoryFieldAvailable && !showHiddenTypes ? ' -Categories:*HideByDefault*' : ''
} .AUTOFILTERS:OFF`

return (
<ContentComponent
Expand Down
3 changes: 2 additions & 1 deletion apps/sensenet/src/components/dialogs/dialog-title.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { globals } from '../../globalStyles'
export const DialogTitle = withStyles((theme: Theme) => ({
root: {
padding: `${theme.spacing(1)}px ${theme.spacing(3)}px`,
backgroundColor: globals.common.headerBackground,
backgroundColor:
theme.palette.type === 'dark' ? globals.common.headerBackground : globals.common.headerLightBackground,
textAlign: 'center',
color: globals.common.headerText,
marginBottom: theme.spacing(1),
Expand Down
10 changes: 6 additions & 4 deletions apps/sensenet/src/components/login/auth-override-skeleton.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { AppBar, Button, Container, createStyles, makeStyles, Toolbar, Typography } from '@material-ui/core'
import { AppBar, Button, Container, createStyles, makeStyles, Theme, Toolbar, Typography } from '@material-ui/core'
import React from 'react'
import { NavLink } from 'react-router-dom'
import logo from '../../assets/sensenet-icon-32.png'
import { globals, useGlobalStyles } from '../../globalStyles'

const useStyles = makeStyles(() =>
const useStyles = makeStyles((theme: Theme) =>
createStyles({
appBar: {
height: globals.common.headerHeight,
backgroundColor: globals.common.headerBackground,
backgroundColor:
theme.palette.type === 'dark' ? globals.common.headerBackground : globals.common.headerLightBackground,
boxShadow: 'none',
},
toolBar: {
Expand All @@ -33,7 +34,8 @@ const useStyles = makeStyles(() =>
},
footer: {
height: '180px',
backgroundColor: globals.common.headerBackground,
backgroundColor:
theme.palette.type === 'dark' ? globals.common.headerBackground : globals.common.headerLightBackground,
boxShadow: 'none',
},
}),
Expand Down
6 changes: 4 additions & 2 deletions apps/sensenet/src/components/login/login-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
makeStyles,
TextField,
TextFieldProps,
Theme,
Typography,
} from '@material-ui/core'
import { PathHelper } from '@sensenet/client-utils'
Expand All @@ -19,12 +20,13 @@ import snLogo from '../../assets/sensenet-icon-32.png'
import { globals, useGlobalStyles } from '../../globalStyles'
import { useLocalization } from '../../hooks'

const useStyles = makeStyles(() =>
const useStyles = makeStyles((theme: Theme) =>
createStyles({
appBar: {
position: 'relative',
height: globals.common.headerHeight,
backgroundColor: globals.common.headerBackground,
backgroundColor:
theme.palette.type === 'dark' ? globals.common.headerBackground : globals.common.headerLightBackground,
boxShadow: 'none',
},
loginSubtitle: {
Expand Down
33 changes: 18 additions & 15 deletions apps/sensenet/src/components/settings/settings-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
TableContainer,
TableHead,
TableRow,
Theme,
} from '@material-ui/core'

import { Delete, Edit, InfoOutlined } from '@material-ui/icons'
Expand All @@ -19,17 +20,17 @@ import { useLocalization } from '../../hooks'
import { getPrimaryActionUrl } from '../../services'
import { useDialog } from '../dialogs'

const useStyles = makeStyles(() => ({
const useStyles = makeStyles((theme: Theme) => ({
tableHead: {
backgroundColor: 'hsl(0deg 0% 24%)',
backgroundColor: theme.palette.type === 'dark' ? 'hsl(0deg 0% 24%)' : 'hsl(0deg 0% 92%)',
cursor: 'default',
},
tableHeadCell: {
color: 'white',
color: theme.palette.type === 'dark' ? 'white' : '#666666',
fontSize: '1.1rem',
},
stickyTableHeadCell: {
color: 'white',
color: theme.palette.type === 'dark' ? 'white' : '#666666',
padding: '0px 1px 0px 0px',
margin: 0,
textAlign: 'center',
Expand Down Expand Up @@ -91,17 +92,19 @@ export const SettingsTable = ({ settings, onContextMenu }: SettingsTableProps) =
const uiSettings = useContext(ResponsivePersonalSettings)
const history = useHistory()
const { openDialog } = useDialog()
const updatedSettings = settings.map((setting: Settings) => {
return {
...setting,
nameToDisplay: setting.Name.split('.')[0]
.replace(/([A-Z])/g, ' $1')
.trim(),
nameToTest: setting.Name.replace(/\.settings/gi, '')
.replace(/\s+/g, '-')
.toLowerCase(),
}
})
const updatedSettings = settings
.map((setting: Settings) => {
return {
...setting,
nameToDisplay: setting.Name.split('.')[0]
.replace(/([A-Z])/g, ' $1')
.trim(),
nameToTest: setting.Name.replace(/\.settings/gi, '')
.replace(/\s+/g, '-')
.toLowerCase(),
}
})
.sort((a, b) => a.Name.localeCompare(b.Name))
const hasDeletableSetting = updatedSettings.some((setting) => !isSystemSettings.includes(setting.Name.split('.')[0]))
return (
<TableContainer>
Expand Down
2 changes: 1 addition & 1 deletion apps/sensenet/src/components/tree/tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export function Tree({ treeData, itemCount, onItemClick, loadMore, isLoading, ac
)
}
return (
<MuiList key={key} style={{ padding: 0 }}>
<MuiList key={key} style={{ ...style, padding: '0' }}>
{renderItem(treeData.children?.[index], index.toString(), 10)}
</MuiList>
)
Expand Down
3 changes: 2 additions & 1 deletion apps/sensenet/src/globalStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const globals = {
addButtonHeight: 60,
//Colors
headerBackground: '#353B4E',
headerLightBackground: '#929292',
headerText: 'rgba(255,255,255,0.87)',
secondaryIconSize: '16px',
elavationShadow: '1px 1px 3px 0px hsl(0deg 0% 0% / 28%)',
Expand Down Expand Up @@ -82,7 +83,7 @@ export const useGlobalStyles = makeStyles((theme: Theme) => {
contentTitle: {
height: globals.common.drawerItemHeight,
minHeight: globals.common.drawerItemHeight,
paddingLeft: '15px',
paddingLeft: '16px',
},
drawerButton: {
width: '32px',
Expand Down
5 changes: 5 additions & 0 deletions apps/sensenet/src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ ul[role='listbox'] {
margin: 0;
padding: 0;
}

.bread-crumbs-separator {
padding: 0;
margin: 0;
}

0 comments on commit 000945d

Please sign in to comment.