mirror of
https://github.com/kennethnym/aris.git
synced 2026-04-16 23:01:19 +01:00
oxfmt was reformatting generated drizzle migration snapshots and crashing on .ona/review/comments.json. Also runs the formatter across the full codebase. Co-authored-by: Ona <no-reply@ona.com>
52 lines
1.6 KiB
TypeScript
52 lines
1.6 KiB
TypeScript
import { defineRegistry } from "@json-render/react-native"
|
|
import { View } from "react-native"
|
|
import tw from "twrnc"
|
|
|
|
import { Button } from "@/components/ui/button"
|
|
import { FeedCard } from "@/components/ui/feed-card"
|
|
import { MonospaceText } from "@/components/ui/monospace-text"
|
|
import { SansSerifText } from "@/components/ui/sans-serif-text"
|
|
import { SerifText } from "@/components/ui/serif-text"
|
|
|
|
import { catalog } from "./catalog"
|
|
|
|
type ButtonIconName = React.ComponentProps<typeof Button.Icon>["name"]
|
|
|
|
export const { registry } = defineRegistry(catalog, {
|
|
components: {
|
|
View: ({ props, children }) => (
|
|
<View style={props.style ? tw`${props.style}` : undefined}>{children}</View>
|
|
),
|
|
Button: ({ props, emit }) => (
|
|
<Button
|
|
label={props.label}
|
|
leadingIcon={
|
|
props.leadingIcon ? <Button.Icon name={props.leadingIcon as ButtonIconName} /> : undefined
|
|
}
|
|
trailingIcon={
|
|
props.trailingIcon ? (
|
|
<Button.Icon name={props.trailingIcon as ButtonIconName} />
|
|
) : undefined
|
|
}
|
|
onPress={() => emit("press")}
|
|
/>
|
|
),
|
|
FeedCard: ({ props, children }) => (
|
|
<FeedCard style={props.style ? tw`${props.style}` : undefined}>{children}</FeedCard>
|
|
),
|
|
SansSerifText: ({ props }) => (
|
|
<SansSerifText style={props.style ? tw`${props.style}` : undefined}>
|
|
{props.text}
|
|
</SansSerifText>
|
|
),
|
|
SerifText: ({ props }) => (
|
|
<SerifText style={props.style ? tw`${props.style}` : undefined}>{props.text}</SerifText>
|
|
),
|
|
MonospaceText: ({ props }) => (
|
|
<MonospaceText style={props.style ? tw`${props.style}` : undefined}>
|
|
{props.text}
|
|
</MonospaceText>
|
|
),
|
|
},
|
|
})
|