Skip to content

Commit

Permalink
chore: Update frontend queries and types
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Dec 22, 2023
1 parent 1852600 commit 76d294a
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 6 deletions.
3 changes: 3 additions & 0 deletions editor.planx.uk/src/components/Header.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ const mockTeam1: Team = {
slug: "opensystemslab",
theme: {
logo: "logo.jpg",
primary: "#0010A4",
secondary: null,
favicon: null,
},
};

Expand Down
2 changes: 1 addition & 1 deletion editor.planx.uk/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const TeamLogo: React.FC = () => {
const altText = teamSettings?.homepage
? `${teamName} Homepage (opens in a new tab)`
: `${teamName} Logo`;
const logo = <Logo alt={altText} src={teamTheme?.logo} />;
const logo = <Logo alt={altText} src={teamTheme?.logo ?? undefined} />;
return teamSettings?.homepage ? (
<LogoLink href={teamSettings?.homepage} target="_blank">
{logo}
Expand Down
7 changes: 6 additions & 1 deletion editor.planx.uk/src/routes/views/published.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ const fetchDataForPublishedView = async (
) {
id
team {
theme
theme {
primary: primary_colour
secondary: secondary_colour
logo
favicon
}
name
settings
slug
Expand Down
7 changes: 6 additions & 1 deletion editor.planx.uk/src/routes/views/standalone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ const fetchDataForStandaloneView = async (
) {
id
team {
theme
theme {
primary: primary_colour
secondary: secondary_colour
logo
favicon
}
name
settings
slug
Expand Down
7 changes: 6 additions & 1 deletion editor.planx.uk/src/routes/views/unpublished.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ const fetchDataForUnpublishedView = async (
) {
id
team {
theme
theme {
primary: primary_colour
secondary: secondary_colour
logo
favicon
}
name
settings
slug
Expand Down
6 changes: 4 additions & 2 deletions editor.planx.uk/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ export interface Team {
}

export interface TeamTheme {
primary?: string;
logo?: string;
primary: string;
secondary: string | null;
logo: string | null;
favicon: string | null;
}

export interface TeamSettings {
Expand Down

0 comments on commit 76d294a

Please sign in to comment.