Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
523 additions
and
651 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
type WorkspaceBannerProps = { | ||
openModal: () => void; | ||
}; | ||
|
||
export default function WorkspaceBanner({ openModal }: WorkspaceBannerProps) { | ||
return ( | ||
<button | ||
onClick={openModal} | ||
className="absolute top-0 inset-x-0 w-full h-fit px-4 py-2 bg-light-orange-10 text-white" | ||
> | ||
This insight page is over the free limit. <span className="font-bold underline">Upgrade to a PRO Workspace.</span> | ||
</button> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { randomUUID } from "crypto"; | ||
import { RequestCookies } from "next/dist/compiled/@edge-runtime/cookies"; | ||
import { WORKSPACE_ID_COOKIE_NAME, getWorkspaceUrl } from "./workspace-utils"; | ||
|
||
describe("[lib/utils] getWorkspaceUrl()", () => { | ||
const baseUrl = "http://localhost:3000"; | ||
const personalWorkspaceId = randomUUID(); | ||
|
||
it("should return a workspace URL if a workspace was previously visited", () => { | ||
const workspaceId = randomUUID(); | ||
const cookies = new RequestCookies(new Headers()); | ||
cookies.set(WORKSPACE_ID_COOKIE_NAME, workspaceId); | ||
|
||
expect(getWorkspaceUrl(cookies, baseUrl, personalWorkspaceId)).toEqual( | ||
new URL(`/workspaces/${workspaceId}`, baseUrl) | ||
); | ||
}); | ||
|
||
it("should return a personal workspace URL if a workspace was not previously visited", () => { | ||
const cookies = new RequestCookies(new Headers()); | ||
|
||
expect(getWorkspaceUrl(cookies, baseUrl, personalWorkspaceId)).toEqual( | ||
new URL(`/workspaces/${personalWorkspaceId}`, baseUrl) | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.