Skip to content

Commit

Permalink
fix build (#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianscatularo authored Dec 18, 2023
1 parent 5460927 commit ed02195
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion apps/connect/src/components/atoms/Bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import styled from "@mui/material/styles/styled";

export type BarProps = {
background: string;
children: JSX.Element[] | null;
children: JSX.Element | JSX.Element[] | null;
};

const Container = styled("div")<Pick<BarProps, "background">>(
Expand Down
6 changes: 4 additions & 2 deletions apps/connect/src/components/atoms/NewsBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ export default function NewsBar({ messages }: NewsBarProps) {
return (
message && (
<Bar background={message.background}>
{message.content}
{message.button && <NewBarButton button={message.button} />}
<>
{message.content}
{message.button ? <NewBarButton button={message.button} /> : null}
</>
</Bar>
)
);
Expand Down
20 changes: 11 additions & 9 deletions apps/connect/src/components/atoms/NewsBarButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ const Link = styled(MuiLink)<{ backgroundColor: string }>(
);
export default function NewsBarButton({ button }: Pick<Message, "button">) {
return (
<Link
href={button.href}
target="_blank"
rel="noopener noreferrer"
color="inherit"
backgroundColor={button.background}
>
{button.label || "TRY IT NOW"}
</Link>
button && (
<Link
href={button.href}
target="_blank"
rel="noopener noreferrer"
color="inherit"
backgroundColor={button.background}
>
{button.label || "TRY IT NOW"}
</Link>
)
);
}
2 changes: 1 addition & 1 deletion apps/connect/src/hooks/useBannerMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useState, useEffect } from "react";

export type Message = {
background: string;
button: {
button?: {
href: string;
label?: string;
background: string;
Expand Down

0 comments on commit ed02195

Please sign in to comment.