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

chore: polish read-only banner #2554

Merged
merged 2 commits into from
Nov 20, 2024
Merged
Changes from 1 commit
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
73 changes: 44 additions & 29 deletions keep-ui/app/read-only-banner.tsx
Original file line number Diff line number Diff line change
@@ -1,41 +1,56 @@
"use client";
import React from "react";
import { X } from "lucide-react";
import { useLocalStorage } from "utils/hooks/useLocalStorage";
import { Card, Text, Button } from "@tremor/react";
import { Text, Button } from "@tremor/react";
import Image from "next/image";
import KeepPng from "../keep.png";
import posthog from "posthog-js";

const ReadOnlyBanner = () => {
const [isVisible, setIsVisible] = useLocalStorage(
"read-only-banner-visible",
true
);

if (!isVisible) return null;

return (
<Card
className="w-full rounded-none bg-orange-400 text-black py-2"
decoration="none"
>
<div className="container mx-auto relative">
<div className="flex items-center justify-center gap-2">
<Image src={KeepPng} alt="Keep Logo" width={20} height={20} />
<Text className="text-sm font-medium text-black">
Keep is in read-only mode.
</Text>
<div className="w-full py-2 pl-4 pr-2 mb-4 bg-orange-50 border border-orange-200 rounded-lg">
<div className="flex items-center justify-between gap-4">
<Text className="text-sm font-medium text-black">
<Image
src={KeepPng}
alt="Keep Logo"
width={20}
height={20}
className="inline-block mr-2"
/>
Keep is in read-only mode.
</Text>
<div className="flex items-center gap-2">
<Button
className="[&>span]:text-xs"
onClick={() => {
posthog.capture("try-keep-for-free", {
source: "read-only-banner",
});
window.open("https://platform.keephq.dev/providers", "_blank");
}}
variant="primary"
color="orange"
size="xs"
>
Try for free
</Button>
talboren marked this conversation as resolved.
Show resolved Hide resolved
<Button
className="[&>span]:text-xs"
onClick={() => {
posthog.capture("talk-to-us", {
source: "read-only-banner",
});
window.open("https://www.keephq.dev/meet-keep", "_blank");
}}
color="orange"
variant="secondary"
size="xs"
>
Talk to us
</Button>
talboren marked this conversation as resolved.
Show resolved Hide resolved
</div>
<Button
onClick={() => setIsVisible(false)}
variant="light"
color="gray"
icon={X}
size="xs"
className="hover:text-gray-500 transition-colors absolute right-0 top-1/2 -translate-y-1/2"
/>
</div>
</Card>
</div>
);
};

Expand Down
Loading