Skip to content

Commit

Permalink
feat: Add privacy page
Browse files Browse the repository at this point in the history
  • Loading branch information
junkisai committed Oct 18, 2024
1 parent 2bd041c commit c8ea601
Show file tree
Hide file tree
Showing 13 changed files with 282 additions and 1 deletion.
18 changes: 17 additions & 1 deletion frontend/apps/service-site/contentlayer.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,25 @@ export const Post = defineDocumentType(() => ({
},
}))

export const Privacy = defineDocumentType(() => ({
name: 'Privacy',
filePathPattern: 'privacy/*.mdx',
contentType: 'mdx',
computedFields: {
lang: {
type: 'string',
resolve: (post) => {
// ex. segments = [ 'posts', 'en' ]
const segments = post._raw.flattenedPath.split('/')
return segments[1]
},
},
},
}))

export default makeSource({
contentDirPath: 'src/contents',
documentTypes: [Post],
documentTypes: [Post, Privacy],
mdx: {
remarkPlugins: [remarkGfm, remarkBreaks, remarkLinkCard],
rehypePlugins: [rehypeSlug, rehypePrettyCode],
Expand Down
14 changes: 14 additions & 0 deletions frontend/apps/service-site/src/app/[lang]/privacy/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { PageProps } from '@/app/types'
import { langSchema } from '@/features/i18n'
import { PrivacyPage } from '@/features/privacy'
import { object, parse } from 'valibot'

const paramsSchema = object({
lang: langSchema,
})

export default function Page({ params }: PageProps) {
const { lang } = parse(paramsSchema, params)

return <PrivacyPage lang={lang} />
}
5 changes: 5 additions & 0 deletions frontend/apps/service-site/src/app/privacy/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { PrivacyPage } from '@/features/privacy'

export default function Page() {
return <PrivacyPage />
}
66 changes: 66 additions & 0 deletions frontend/apps/service-site/src/contents/privacy/en.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
Welcome to Liam, a no-code application platform. This Privacy Policy explains how we collect, use, disclose, and safeguard your information when you use our platform.

## Information We Collect

a. Personal Information

- Name
- Email address
- Billing information
- User-generated content

b. Usage Data

- IP address
- Browser type
- Pages visited
- Time spent on platform
- How We Use Your Information

## How We Use Your Information

We use your information to

- Provide and maintain our services
- Improve and personalize user experience
- Process transactions
- Send administrative information
- Respond to inquiries and offer support
- Data Storage and Security

We implement industry-standard security measures to protect your data. Your information is stored on secure servers and is only accessible to authorized personnel.

## Data Storage and Security

We implement industry-standard security measures to protect your data. Your information is stored on secure servers and is only accessible to authorized personnel.

## Third-Party Services

We may use third-party services for analytics, payment processing, and hosting. These services have their own privacy policies.

## Data Retention

We retain your data for as long as your account is active or as needed to provide you services. You may request deletion of your data at any time.

## User Rights

You have the right to

- Access your personal data
- Correct inaccuracies in your data
- Request deletion of your data
- Object to processing of your data

## Children's Privacy

Our platform is not intended for children under 13. We do not knowingly collect data from children under 13.

## Changes to This Policy

We may update this policy from time to time. We will notify you of any changes by posting the new policy on this page.

## Contact Us

If you have any questions about this Privacy Policy, please contact us at [contact email].

Last updated: [Date]
66 changes: 66 additions & 0 deletions frontend/apps/service-site/src/contents/privacy/ja.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
Liamへようこそ。Liamはノーコードアプリケーションプラットフォームです。このプライバシーポリシーでは、当社のプラットフォームをご利用いただく際に、お客様の情報をどのように収集、使用、開示、保護するかについて説明します。

## 収集する情報

a. 個人情報

- 名前
- メールアドレス
- 請求情報
- ユーザーが生成したコンテンツ

b. Usage Data

- IP address
- Browser type
- Pages visited
- Time spent on platform
- How We Use Your Information

## How We Use Your Information

We use your information to

- Provide and maintain our services
- Improve and personalize user experience
- Process transactions
- Send administrative information
- Respond to inquiries and offer support
- Data Storage and Security

We implement industry-standard security measures to protect your data. Your information is stored on secure servers and is only accessible to authorized personnel.

## Data Storage and Security

We implement industry-standard security measures to protect your data. Your information is stored on secure servers and is only accessible to authorized personnel.

## Third-Party Services

We may use third-party services for analytics, payment processing, and hosting. These services have their own privacy policies.

## Data Retention

We retain your data for as long as your account is active or as needed to provide you services. You may request deletion of your data at any time.

## User Rights

You have the right to

- Access your personal data
- Correct inaccuracies in your data
- Request deletion of your data
- Object to processing of your data

## Children's Privacy

Our platform is not intended for children under 13. We do not knowingly collect data from children under 13.

## Changes to This Policy

We may update this policy from time to time. We will notify you of any changes by posting the new policy on this page.

## Contact Us

If you have any questions about this Privacy Policy, please contact us at [contact email].

Last updated: [Date]
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.wrapper {
display: grid;
grid-auto-flow: row;
gap: var(--spacing-4);
}

.h1 {
margin-top: var(--spacing-10);
padding: var(--spacing-5);
color: var(--global-foreground, #fff);
font-family: var(--message-font, Montserrat);
font-size: var(--font-size-14, 2rem);
}

.container {
display: grid;
grid-template-rows: auto auto;
gap: var(--spacing-10);
padding: 0 var(--spacing-4);
}

@media screen and (min-width: 768px) {
.container {
padding: 0 var(--spacing-20, 80px);
}

.h1 {
padding: var(--spacing-20, 80px);
font-size: var(--font-size-18);
}
}

@media screen and (min-width: 1024px) {
.wrapper {
gap: var(--spacing-20);
}

.h1 {
padding: var(--spacing-20);
font-size: var(--font-size-18);
text-align: center;
}

.container {
grid-template-columns: 274px auto;
gap: var(--spacing-10, 40px);
padding: 0 var(--spacing-20, 80px);
}

.left {
position: sticky;
top: calc(var(--default-header-height) + var(--spacing-8));
align-self: flex-start;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { Meta, StoryObj } from '@storybook/react'

import { PrivacyPage } from './'

const meta = {
component: PrivacyPage,
} satisfies Meta<typeof PrivacyPage>

export default meta
type Story = StoryObj<typeof meta>

export const Default: Story = {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { TableOfContents } from '@/components'
import { type Lang, fallbackLang } from '@/features/i18n'
import { MDXContent } from '@/libs/contentlayer'
import clsx from 'clsx'
import { notFound } from 'next/navigation'
import type { FC } from 'react'
import { findPrivacyByLang } from '../../utils'
import styles from './PrivacyPage.module.css'

const TOC_TARGET_CLASS_NAME = 'target-toc'

type Props = {
lang?: Lang
}

export const PrivacyPage: FC<Props> = ({ lang }) => {
const privacy = findPrivacyByLang({ lang: lang ?? fallbackLang })
if (!privacy) notFound()

return (
<article className={clsx(TOC_TARGET_CLASS_NAME, styles.wrapper)}>
<h1 className={styles.h1}>Privacy Policy</h1>
<div className={styles.container}>
<div className={styles.left}>
<TableOfContents contentSelector={TOC_TARGET_CLASS_NAME} />
</div>
<div>
<MDXContent code={privacy.body.code} />
</div>
</div>
</article>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './PrivacyPage'
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './PrivacyPage'
1 change: 1 addition & 0 deletions frontend/apps/service-site/src/features/privacy/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './components'
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { Lang } from '@/features/i18n'
import { type Privacy, allPrivacies } from 'contentlayer/generated'

type Params = {
lang: Lang
}

export function findPrivacyByLang({ lang }: Params): Privacy | undefined {
return allPrivacies.find((p) => p.lang === lang)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './findPrivacyByLang'

0 comments on commit c8ea601

Please sign in to comment.