Skip to content

Commit

Permalink
Bose/hotfix studio (#2241)
Browse files Browse the repository at this point in the history
* 🎨 comment

* 🐛 remove component for headings in block content
  • Loading branch information
BorghildSelle authored Apr 19, 2024
1 parent cc394c2 commit ef02367
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions sanityv3/schemas/editors/blockContentType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,21 @@ const SmallTextRender = (props: any) => {
}
const Level2BaseStyle = (props: any) => {
const { children } = props
return <span style={{ fontSize: em(18, 16), fontWeight: '600' }}>{children} </span>
return <h2 style={{ fontSize: em(18, 16), fontWeight: '600' }}>{children} </h2>
}

const Level3BaseStyle = (props: any) => {
const { children } = props
return <span style={{ fontSize: em(16, 16), fontWeight: '600' }}>{children} </span>
return <h3 style={{ fontSize: em(16, 16), fontWeight: '600' }}>{children} </h3>
}

// H1 not allowed in block content since it should be a document title.
export const configureBlockContent = (options: BlockContentProps = {}): BlockDefinition => {
const {
h2 = true,
useH2BaseStyle = true,
useH2BaseStyle = false,
h3 = true,
useH3BaseStyle = true,
useH3BaseStyle = false,
h4 = false,
internalLink = true,
externalLink = true,
Expand All @@ -76,6 +76,7 @@ export const configureBlockContent = (options: BlockContentProps = {}): BlockDef
normalTextOverride = { title: 'Normal', value: 'normal' },
} = options

/** comment */
const config: BlockDefinition = {
type: 'block',
name: 'block',
Expand Down Expand Up @@ -112,7 +113,7 @@ export const configureBlockContent = (options: BlockContentProps = {}): BlockDef
const h2BaseConfig = { title: 'Heading 2', value: 'h2', component: Level2BaseStyle }
const h3DefaultConfig = { title: 'Heading 3', value: 'h3' }
const h3BaseConfig = { title: 'Heading 3', value: 'h3', component: Level3BaseStyle }
const h4Config = { title: 'Heading 3', value: 'h4' }
const h4Config = { title: 'Heading 4', value: 'h4' }
const smallTextConfig = {
title: 'Small text',
value: 'smallText',
Expand Down Expand Up @@ -243,19 +244,21 @@ export const configureBlockContent = (options: BlockContentProps = {}): BlockDef
}

if (h2) {
if (useH2BaseStyle) {
config?.styles?.push(h2DefaultConfig)
/* if (useH2BaseStyle) {
config?.styles?.push(h2BaseConfig)
} else {
config?.styles?.push(h2DefaultConfig)
}
} */
}

if (h3) {
if (useH3BaseStyle) {
config?.styles?.push(h3DefaultConfig)
/* if (useH3BaseStyle) {
config?.styles?.push(h3BaseConfig)
} else {
config?.styles?.push(h3DefaultConfig)
}
} */
}

if (h4) {
Expand Down

0 comments on commit ef02367

Please sign in to comment.