Skip to content

Commit 5ef4b30

Browse files
minor improvements
1 parent e6c4f64 commit 5ef4b30

File tree

6 files changed

+78
-25
lines changed

6 files changed

+78
-25
lines changed

components/dashboard/src/AppNotifications.tsx

Lines changed: 65 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import { useOrgBillingMode } from "./data/billing-mode/org-billing-mode-query";
2020
import { Organization } from "@gitpod/public-api/lib/gitpod/v1/organization_pb";
2121
import { MaintenanceModeBanner } from "./org-admin/MaintenanceModeBanner";
2222
import { MaintenanceNotificationBanner } from "./org-admin/MaintenanceNotificationBanner";
23+
import { useToast } from "./components/toasts/Toasts";
24+
import { getPrimaryEmail } from "@gitpod/public-api-common/lib/user-utils";
2325
import onaWordmark from "./images/ona-wordmark.svg";
2426

2527
const KEY_APP_DISMISSED_NOTIFICATIONS = "gitpod-app-notifications-dismissed";
@@ -129,36 +131,84 @@ const INVALID_BILLING_ADDRESS = (stripePortalUrl: string | undefined) => {
129131
} as Notification;
130132
};
131133

132-
const GITPOD_CLASSIC_SUNSET = {
133-
id: "gitpod-classic-sunset",
134-
type: "info" as AlertType,
135-
message: (
136-
<span className="text-md text-white font-semibold items-center justify-center">
137-
Meet <img src={onaWordmark} alt="Ona" className="inline align-middle w-12 mb-0.5" draggable="false" /> | the
138-
privacy-first software engineering agent |{" "}
139-
<a href="https://ona.com/" target="_blank" rel="noreferrer" className="underline hover:no-underline">
140-
Get early access
141-
</a>
142-
</span>
143-
),
144-
} as Notification;
134+
const GITPOD_CLASSIC_SUNSET = (
135+
user: User | undefined,
136+
toast: any,
137+
onaClicked: boolean,
138+
handleOnaBannerClick: () => void,
139+
) => {
140+
return {
141+
id: "gitpod-classic-sunset",
142+
type: "info" as AlertType,
143+
message: (
144+
<span className="text-md text-white font-semibold items-center justify-center">
145+
Meet <img src={onaWordmark} alt="Ona" className="inline align-middle w-12 mb-0.5" draggable="false" /> |
146+
the privacy-first software engineering agent |{" "}
147+
{!onaClicked ? (
148+
<button
149+
onClick={handleOnaBannerClick}
150+
className="underline hover:no-underline cursor-pointer bg-transparent border-none text-white font-semibold"
151+
>
152+
Get early access
153+
</button>
154+
) : (
155+
<a
156+
href="https://www.gitpod.io/solutions/ai"
157+
target="_blank"
158+
rel="noreferrer"
159+
className="underline hover:no-underline"
160+
>
161+
Learn more
162+
</a>
163+
)}
164+
</span>
165+
),
166+
} as Notification;
167+
};
145168

146169
export function AppNotifications() {
147170
const [topNotification, setTopNotification] = useState<Notification | undefined>(undefined);
171+
const [onaClicked, setOnaClicked] = useState(false);
148172
const { user, loading } = useUserLoader();
149173
const { mutateAsync } = useUpdateCurrentUserMutation();
174+
const { toast } = useToast();
150175

151176
const currentOrg = useCurrentOrg().data;
152177
const { data: billingMode } = useOrgBillingMode();
153178

179+
useEffect(() => {
180+
const storedOnaData = localStorage.getItem("ona-banner-data");
181+
if (storedOnaData) {
182+
const { clicked } = JSON.parse(storedOnaData);
183+
setOnaClicked(clicked || false);
184+
}
185+
}, []);
186+
187+
const handleOnaBannerClick = useCallback(() => {
188+
const userEmail = user ? getPrimaryEmail(user) || "" : "";
189+
trackEvent("waitlist_joined", { email: userEmail, feature: "Ona" });
190+
191+
setOnaClicked(true);
192+
const existingData = localStorage.getItem("ona-banner-data");
193+
const parsedData = existingData ? JSON.parse(existingData) : {};
194+
localStorage.setItem("ona-banner-data", JSON.stringify({ ...parsedData, clicked: true }));
195+
196+
toast(
197+
<div>
198+
<div className="font-medium">You're on the waitlist</div>
199+
<div className="text-sm opacity-80">We'll reach out to you soon.</div>
200+
</div>,
201+
);
202+
}, [user, toast]);
203+
154204
useEffect(() => {
155205
let ignore = false;
156206

157207
const updateNotifications = async () => {
158208
const notifications = [];
159209
if (!loading) {
160210
if (isGitpodIo()) {
161-
notifications.push(GITPOD_CLASSIC_SUNSET);
211+
notifications.push(GITPOD_CLASSIC_SUNSET(user, toast, onaClicked, handleOnaBannerClick));
162212
}
163213

164214
if (
@@ -192,7 +242,7 @@ export function AppNotifications() {
192242
return () => {
193243
ignore = true;
194244
};
195-
}, [loading, mutateAsync, user, currentOrg, billingMode]);
245+
}, [loading, mutateAsync, user, currentOrg, billingMode, onaClicked, handleOnaBannerClick, toast]);
196246

197247
const dismissNotification = useCallback(() => {
198248
if (!topNotification) {

components/dashboard/src/Login.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,16 +389,16 @@ const RightProductDescriptionPanel = () => {
389389
</div>
390390

391391
<div className="flex flex-col gap-4 flex-1">
392-
<h2 className="text-white text-2xl font-bold leading-tight text-center max-w-sm mx-auto">
392+
<h2 className="text-white text-xl font-bold leading-tight text-center max-w-sm mx-auto">
393393
Meet Ona - the privacy-first software engineering agent.
394394
</h2>
395395

396396
<div className="space-y-3 mt-4">
397-
<p className="text-white/70 text-xl">
397+
<p className="text-white/70 text-base">
398398
Delegate software tasks to Ona. It writes code, runs tests, and opens a pull request. Or
399399
jump in to inspect output or pair program in your IDE.
400400
</p>
401-
<p className="text-white/70 text-xl mt-2">
401+
<p className="text-white/70 text-base mt-2">
402402
Ona runs inside your infrastructure (VPC), with full audit trails, zero data exposure, and
403403
support for any LLM.
404404
</p>

components/dashboard/src/OnaRightPanel.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ export const OnaRightPanel = () => {
103103
</form>
104104
) : (
105105
<button
106-
onClick={() => window.open("https://ona.com/", "_blank", "noopener,noreferrer")}
106+
onClick={() =>
107+
window.open("https://www.gitpod.io/solutions/ai", "_blank", "noopener,noreferrer")
108+
}
107109
className="w-full bg-white/20 backdrop-blur-sm text-white font-medium py-2.5 px-4 rounded-lg hover:bg-white/30 transition-colors border border-white/20 inline-flex items-center justify-center gap-2 text-sm"
108110
>
109111
Learn more

components/dashboard/src/start/OnaBanner.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,14 @@ export const OnaBanner: React.FC<OnaBannerProps> = ({ compact = false }) => {
9191
<img src={onaWordmark} alt="ONA" className="w-12" draggable="false" />
9292
</div>
9393

94-
<p className="text-white !text-lg font-bold leading-tight text-left">
94+
<p className="text-white text-base font-semibold leading-tight text-left">
9595
The privacy-first software engineering agent
9696
</p>
9797

9898
{!onaClicked ? (
9999
<button
100100
onClick={handleOnaBannerClick}
101-
className="bg-white/20 backdrop-blur-sm text-white font-medium py-1.5 px-4 rounded-full hover:bg-white/30 transition-colors border border-white/20 inline-flex items-center gap-2 text-sm w-fit"
101+
className="bg-white/20 backdrop-blur-sm text-white font-medium py-1 px-3 rounded-full hover:bg-white/30 transition-colors border border-white/20 inline-flex items-center gap-2 text-sm w-fit"
102102
>
103103
{onaBanner.ctaText}
104104
<span className="font-bold"></span>
@@ -108,7 +108,7 @@ export const OnaBanner: React.FC<OnaBannerProps> = ({ compact = false }) => {
108108
href={onaBanner.link}
109109
target="_blank"
110110
rel="noopener noreferrer"
111-
className="bg-white/20 backdrop-blur-sm text-white font-medium py-1.5 px-4 rounded-full hover:bg-white/30 transition-colors border border-white/20 inline-flex items-center gap-2 text-sm w-fit"
111+
className="bg-white/20 backdrop-blur-sm text-white font-medium py-1 px-3 rounded-full hover:bg-white/30 transition-colors border border-white/20 inline-flex items-center gap-2 text-sm w-fit"
112112
>
113113
{onaBanner.learnMoreText}
114114
<span className="font-bold"></span>

components/dashboard/src/workspaces/BlogBanners.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const onaBanner = {
1717
subtitle: "The privacy-first software engineering agent.",
1818
ctaText: "Get early access",
1919
learnMoreText: "Learn more",
20-
link: "https://ona.com/",
20+
link: "https://www.gitpod.io/solutions/ai",
2121
};
2222

2323
export const OnaBanner: React.FC = () => {

components/dashboard/src/workspaces/Workspaces.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import { useUserLoader } from "../hooks/use-user-loader";
3434
import { ReactComponent as GitpodStrokedSVG } from "../icons/gitpod-stroked.svg";
3535
import { VideoSection } from "../onboarding/VideoSection";
3636
import { OrganizationJoinModal } from "../teams/onboarding/OrganizationJoinModal";
37-
import { BlogBanners } from "./BlogBanners";
37+
// import { BlogBanners } from "./BlogBanners";
3838
import { EmptyWorkspacesContent } from "./EmptyWorkspacesContent";
3939
import PersonalizedContent from "./PersonalizedContent";
4040
import { VideoCarousel } from "./VideoCarousel";
@@ -504,7 +504,8 @@ const WorkspacesPage: FunctionComponent = () => {
504504
</div>
505505
</div>
506506
<PersonalizedContent />
507-
<BlogBanners />
507+
{/* Uncomment the following, if you need side banners in future */}
508+
{/* <BlogBanners /> */}
508509
</div>
509510
)}
510511
</div>

0 commit comments

Comments
 (0)