-
Notifications
You must be signed in to change notification settings - Fork 99
feat(cloud): move policy pages to mdx-backed content #1885
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
Merged
sourishkrout
merged 1 commit into
v2
from
feat_cloud_move_policy_pages_to_mdx-backed_content
Jan 13, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,83 @@ | ||
| import React from "react"; | ||
| import { MDXRenderer } from "@/app/components/mdx/renderer"; | ||
| import { type PolicyContent } from "@/app/lib/content/types"; | ||
|
|
||
| /** | ||
| * Format a date string to "Month Day, Year" format | ||
| * The source date string (YYYY-MM-DD) represents a date in Los Angeles timezone | ||
| */ | ||
| const formatDate = (dateString: string): string => { | ||
| if (!dateString) return ""; | ||
| try { | ||
| // Validate ISO 8601 date format (YYYY-MM-DD) | ||
| if (!/^\d{4}-\d{2}-\d{2}$/.test(dateString)) { | ||
| return dateString; | ||
| } | ||
| // Parse date components | ||
| const [year, month, day] = dateString.split("-").map(Number); | ||
|
|
||
| // Create date at noon UTC to avoid DST edge cases, then format in LA timezone | ||
| // This ensures the date is preserved correctly when formatting | ||
| const date = new Date(Date.UTC(year, month - 1, day, 12, 0, 0)); | ||
|
|
||
| // Check if date is valid | ||
| if (isNaN(date.getTime())) { | ||
| return dateString; | ||
| } | ||
|
|
||
| // Format in Los Angeles timezone to match the source timezone | ||
| return date.toLocaleDateString("en-US", { | ||
| year: "numeric", | ||
| month: "long", | ||
| day: "numeric", | ||
| timeZone: "America/Los_Angeles", | ||
| }); | ||
| } catch (e) { | ||
| console.error("Error formatting date:", e); | ||
| return dateString; | ||
| } | ||
| }; | ||
|
|
||
| interface PolicyPageProps { | ||
| content: PolicyContent; | ||
| } | ||
|
|
||
| /** | ||
| * PolicyPage - Reusable component for rendering policy and terms pages | ||
| */ | ||
| const PolicyPage: React.FC<PolicyPageProps> = ({ content }) => { | ||
| // Content ID for the article element | ||
| const contentId = "policy-content"; | ||
|
|
||
| const title = content?.meta?.title ?? "Loading..."; | ||
| const lastUpdated = content?.meta?.lastUpdated | ||
| ? formatDate(content.meta.lastUpdated) | ||
| : ""; | ||
|
|
||
| return ( | ||
| <div className="container mx-auto max-w-4xl px-4 py-8"> | ||
| {/* Header with title and fun mode button aligned horizontally */} | ||
| <div className="mb-8 flex items-center justify-between"> | ||
| <div> | ||
| <h1 className="text-3xl font-bold uppercase">{title}</h1> | ||
| {lastUpdated && ( | ||
| <p className="text-muted-foreground mt-1 font-medium"> | ||
| Last Updated: {lastUpdated} | ||
| </p> | ||
| )} | ||
| </div> | ||
| </div> | ||
|
|
||
| <div | ||
| id={contentId} | ||
| className="bg-background border-border rounded-xl border p-4 shadow-sm sm:p-6" | ||
| > | ||
| <article className="prose prose-lg max-w-none"> | ||
| <MDXRenderer className="mdx-content" mdx={content.mdx} /> | ||
| </article> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default PolicyPage; |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.