Skip to content

Commit

Permalink
improvement: help spread the love of marimo
Browse files Browse the repository at this point in the history
  • Loading branch information
mscolnick committed Dec 20, 2024
1 parent 5349787 commit 67ebaa0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
22 changes: 22 additions & 0 deletions frontend/src/components/pages/run-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,40 @@
import type { AppConfig } from "@/core/config/config-schema";
import { RunApp } from "@/core/run-app";
import { StaticBanner } from "../static-html/static-banner";
import { isStaticNotebook } from "@/core/static/static-state";
import { isWasm } from "@/core/wasm/utils";
import { Constants } from "@/core/constants";

interface Props {
appConfig: AppConfig;
}

const showWatermark = isWasm() || isStaticNotebook();

const RunPage = (props: Props) => {
return (
<>
<StaticBanner />
<RunApp appConfig={props.appConfig} />
{showWatermark && <Watermark />}
</>
);
};

const Watermark = () => {
return (
<div className="fixed bottom-0 right-0 z-50">
<a
href={Constants.githubPage}
target="_blank"
className="text-sm text-[var(--grass-11)] font-bold tracking-wide transition-colors bg-[var(--grass-4)] hover:bg-[var(--grass-5)] border-t border-l border-[var(--grass-8)] px-3 py-1 rounded-tl-md flex items-center gap-2"
rel="noreferrer"
>
<span className="pb-[2px]">made with marimo</span>
<img src="./favicon.ico" alt="marimo" className="h-4 w-auto" />
</a>
</div>
);
};

export default RunPage;
5 changes: 3 additions & 2 deletions frontend/src/components/static-html/static-banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
import { CopyIcon, DownloadIcon } from "lucide-react";
import { createShareableLink } from "@/core/wasm/share";
import { copyToClipboard } from "@/utils/copy";
import { Constants } from "@/core/constants";

export const StaticBanner: React.FC = () => {
if (!isStaticNotebook()) {
Expand All @@ -36,7 +37,7 @@ export const StaticBanner: React.FC = () => {
<span>
This is a static Python notebook built using{" "}
<a
href="https://github.com/marimo-team/marimo"
href={Constants.githubPage}
target="_blank"
className="underline"
rel="noreferrer"
Expand Down Expand Up @@ -81,7 +82,7 @@ const StaticBannerDialog = ({ code }: { code: string }) => {
<DialogDescription className="pt-4 text-md text-left">
This is a static notebook built using{" "}
<a
href="https://github.com/marimo-team/marimo"
href={Constants.githubPage}
target="_blank"
className="text-link hover:underline"
rel="noreferrer"
Expand Down

0 comments on commit 67ebaa0

Please sign in to comment.