Skip to content

Commit

Permalink
Merge align-text-attribute into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
stage-branch-merger[bot] authored Nov 14, 2024
2 parents 184c180 + 7601693 commit d5b48bb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
9 changes: 6 additions & 3 deletions src/app/_tests/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,13 @@ const standardTypeValues = () => {
const createText = (text: string): Text => {
return {
text: text,
textAlign: null,
textColor: null,
textAlign: {
name: 'START',
ordinal: 0
},
textColor: '#000000',
textScale: null,
_textStyles: null,
_textStyles: [],
minimumLines: null,
startImage: null,
startImageSize: null,
Expand Down
20 changes: 16 additions & 4 deletions src/app/page/component/content-text/content-text.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,23 @@ export class ContentTextComponent implements OnChanges {

private init(): void {
const styles = {
'font-weight': this.text.textStyles.some(style => style.name === 'BOLD') ? 'bold' : '',
'font-style': this.text.textStyles.some(style => style.name === 'ITALIC') ? 'italic' : '',
'text-decoration': this.text.textStyles.some(style => style.name === 'UNDERLINE') ? 'underline' : '',
'font-weight': this.text.textStyles?.some(
(style) => style.name === 'BOLD'
)
? 'bold'
: '',
'font-style': this.text.textStyles?.some(
(style) => style.name === 'ITALIC'
)
? 'italic'
: '',
'text-decoration': this.text.textStyles?.some(
(style) => style.name === 'UNDERLINE'
)
? 'underline'
: '',
'text-align': this.text.textAlign.name || '',
'color': this.text.textColor || ''
color: this.text.textColor || ''
};

this.textColor = this.text?.textColor || null;
Expand Down

0 comments on commit d5b48bb

Please sign in to comment.