Skip to content

Commit

Permalink
add new logo colour field (as optional)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewHEguardian committed Jan 18, 2024
1 parent c6d8345 commit 646db8a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/models/BannerDesign.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ case class BannerDesignBasicColours(
bodyText: HexColour,
headerText: HexColour,
articleCountText: HexColour,
logo: Option[HexColour]
)

case class BannerDesignHighlightedTextColours(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { BasicColours } from '../../../models/bannerDesign';
import { ColourInput } from './ColourInput';
import { makeStyles, Theme } from '@material-ui/core/styles';
import { stringToHexColour } from '../../../utils/bannerDesigns';

const useStyles = makeStyles(({ spacing }: Theme) => ({
container: {
Expand Down Expand Up @@ -62,6 +63,14 @@ export const BasicColoursEditor: React.FC<Props> = ({
onChange={colour => onChange({ ...basicColours, articleCountText: colour })}
onValidationChange={onValidationChange}
/>
<ColourInput
colour={basicColours.logo ?? stringToHexColour('000000')}
name="colours.basic.logo"
label="Guardian Logo Colour"
isDisabled={isDisabled}
onChange={colour => onChange({ ...basicColours, logo: colour })}
onValidationChange={onValidationChange}
/>
</div>
);
};
1 change: 1 addition & 0 deletions public/src/models/bannerDesign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface BasicColours {
bodyText: HexColour;
headerText: HexColour;
articleCountText: HexColour;
logo?: HexColour;
}

export interface HighlightedTextColours {
Expand Down

0 comments on commit 646db8a

Please sign in to comment.