mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 01:15:03 +03:00
* add initial installation flow of stripe sync engine * update docs link * Add supabase_vault extension dep * Add stripe logo to sync engine integration * Move overview content to bottom of integration pages * Add sync state to stripe sync page * only check sync state if stripe integration is installed * Use proper stripe-sync package and setup flows * Improve sync engine installation ux * Remove unused hardcoded dep * Add alpha status to stripe sync engine integration * fix typo * run format * fix types * Rename the stripe-sync path to remove the 'integration". The path needs to have BASE_PATH to work on prod. * Design tidy up (#41337) UI tidy up * update to latest sync engine package * Add stripe key verification * Remove noop try/catch * Add integration isntallation telelemtry * Add basic settings page * Address coderabbit comments * remove unused dep * Remove state setting on render * s/description/comment * Cleanup settings screen UI * Improve settings screen design * update schema test snapshot * Use latest stripe-sync-engine package * Update repo url to new official location * revert marketing change * Update stripe sync engine package * Add link to table from overview page * Add feature flag and improve telemetry * Fix missing useMemo dep * add uninstall telemetry note --------- Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com> Co-authored-by: Saxon Fletcher <saxonafletcher@gmail.com>
64 lines
2.0 KiB
TypeScript
64 lines
2.0 KiB
TypeScript
import { motion } from 'framer-motion'
|
|
import { useEffect, useState } from 'react'
|
|
|
|
import { Markdown } from 'components/interfaces/Markdown'
|
|
import { cn } from 'ui'
|
|
|
|
const CHAR_LIMIT = 500 // Adjust this number as needed
|
|
|
|
export const MarkdownContent = ({
|
|
integrationId,
|
|
initiallyExpanded,
|
|
}: {
|
|
integrationId: string
|
|
initiallyExpanded?: boolean
|
|
}) => {
|
|
const [content, setContent] = useState<string>('')
|
|
const [isExpanded, setIsExpanded] = useState(initiallyExpanded ?? false)
|
|
|
|
useEffect(() => {
|
|
import(`static-data/integrations/${integrationId}/overview.md`)
|
|
.then((module) => setContent(String(module.default)))
|
|
.catch((error) => console.error('Error loading markdown:', error))
|
|
}, [integrationId])
|
|
|
|
const displayContent = isExpanded ? content : content.slice(0, CHAR_LIMIT)
|
|
const supportExpanding = content.length > CHAR_LIMIT || (content.match(/\n/g) || []).length > 1
|
|
|
|
if (displayContent.length === 0) return null
|
|
|
|
return (
|
|
<div className="px-10">
|
|
<div className="relative">
|
|
<motion.div
|
|
initial={false}
|
|
animate={{ height: isExpanded ? 'auto' : 80 }}
|
|
className="overflow-hidden"
|
|
transition={{ duration: 0.4 }}
|
|
>
|
|
<Markdown content={displayContent} className="!max-w-3xl" />
|
|
</motion.div>
|
|
{!isExpanded && (
|
|
<div
|
|
className={cn(
|
|
'bottom-0 left-0 right-0 h-24',
|
|
supportExpanding && 'bg-gradient-to-t from-background-200 to-transparent',
|
|
!isExpanded ? 'absolute' : 'relative'
|
|
)}
|
|
/>
|
|
)}
|
|
{supportExpanding && (
|
|
<div className={cn('bottom-0', !isExpanded ? 'absolute' : 'relative mt-3')}>
|
|
<button
|
|
className="text-foreground-light hover:text-foreground underline text-sm"
|
|
onClick={() => setIsExpanded(!isExpanded)}
|
|
>
|
|
{isExpanded ? 'Show less' : 'Read more'}
|
|
</button>
|
|
</div>
|
|
)}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|