Skip to content

Commit

Permalink
fix: documentation examples
Browse files Browse the repository at this point in the history
  • Loading branch information
malangcat committed Jan 27, 2025
1 parent 811fb2a commit 10ea9d1
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 57 deletions.
52 changes: 25 additions & 27 deletions docs/components/example/app-screen-preview.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
"use client";

import { Flex } from "@/registry/ui/layout";
import { IconBellFill } from "@daangn/react-monochrome-icon";
import type { ActivityComponentType } from "@stackflow/react/future";
import {
AppBar,
AppScreen,
CloseButton,
IconButton,
Left,
Right,
Title,
} from "seed-design/ui/app-screen";
AppBarCloseButton,
AppBarIconButton,
AppBarLeft,
AppBarRight,
AppBarTitle,
} from "seed-design/ui/app-bar";
import { AppScreen, AppScreenContent } from "seed-design/ui/app-screen";
import { Flex } from "seed-design/ui/layout";

declare module "@stackflow/config" {
interface Register {
Expand All @@ -21,25 +21,23 @@ declare module "@stackflow/config" {

const AppScreenPreviewActivity: ActivityComponentType<"AppScreenPreview"> = () => {
return (
<AppScreen
theme="cupertino"
appBar={
<AppBar>
<Left>
<CloseButton />
</Left>
<Title>Preview</Title>
<Right>
<IconButton aria-label="Notification">
<IconBellFill />
</IconButton>
</Right>
</AppBar>
}
>
<Flex height="full" justifyContent="center" alignItems="center">
Preview
</Flex>
<AppScreen theme="cupertino">
<AppBar>
<AppBarLeft>
<AppBarCloseButton />
</AppBarLeft>
<AppBarTitle>Preview</AppBarTitle>
<AppBarRight>
<AppBarIconButton aria-label="Notification">
<IconBellFill />
</AppBarIconButton>
</AppBarRight>
</AppBar>
<AppScreenContent>
<Flex height="full" justifyContent="center" alignItems="center">
Preview
</Flex>
</AppScreenContent>
</AppScreen>
);
};
Expand Down
52 changes: 25 additions & 27 deletions docs/components/example/app-screen-transparent-bar.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
"use client";

import { Flex } from "@/registry/ui/layout";
import { IconBellFill } from "@daangn/react-monochrome-icon";
import type { ActivityComponentType } from "@stackflow/react/future";
import {
AppBar,
AppScreen,
CloseButton,
IconButton,
Left,
Right,
Title,
} from "seed-design/ui/app-screen";
AppBarCloseButton,
AppBarIconButton,
AppBarLeft,
AppBarRight,
AppBarTitle,
} from "seed-design/ui/app-bar";
import { AppScreen, AppScreenContent } from "seed-design/ui/app-screen";
import { Flex } from "seed-design/ui/layout";

declare module "@stackflow/config" {
interface Register {
Expand All @@ -21,25 +21,23 @@ declare module "@stackflow/config" {

const AppScreenTransparentBarActivity: ActivityComponentType<"AppScreenTransparentBar"> = () => {
return (
<AppScreen
theme="cupertino"
appBar={
<AppBar tone="transparent" border={false}>
<Left>
<CloseButton />
</Left>
<Title>Transparent Bar</Title>
<Right>
<IconButton aria-label="Notification">
<IconBellFill />
</IconButton>
</Right>
</AppBar>
}
>
<Flex height="full">
<img src="/penguin.webp" alt="Penguin" />
</Flex>
<AppScreen theme="cupertino">
<AppBar tone="transparent">
<AppBarLeft>
<AppBarCloseButton />
</AppBarLeft>
<AppBarTitle>Preview</AppBarTitle>
<AppBarRight>
<AppBarIconButton aria-label="Notification">
<IconBellFill />
</AppBarIconButton>
</AppBarRight>
</AppBar>
<AppScreenContent>
<Flex height="full" justifyContent="center" alignItems="center">
Preview
</Flex>
</AppScreenContent>
</AppScreen>
);
};
Expand Down
8 changes: 5 additions & 3 deletions docs/components/stackflow/Stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ import { basicRendererPlugin } from "@stackflow/plugin-renderer-basic";
import { type ActivityComponentType, stackflow } from "@stackflow/react/future";
import { getConfig } from "./stackflow.config";
import type { Register } from "@stackflow/config";
import { seedPlugin } from "@seed-design/stackflow";

interface MakeStackProps<T extends keyof Register> {
Activity: ActivityComponentType<T>;
}

export const makeStack = <T extends keyof Register>(
props: MakeStackProps<T>,
) => {
export const makeStack = <T extends keyof Register>(props: MakeStackProps<T>) => {
const { Activity } = props;

const { Stack, actions, stepActions } = stackflow({
Expand All @@ -31,6 +30,9 @@ export const makeStack = <T extends keyof Register>(
},
},
}),
seedPlugin({
theme: "cupertino",
}),
],
});

Expand Down

0 comments on commit 10ea9d1

Please sign in to comment.