Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix build #613

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading