diff --git a/src/components/PrivateRoute/PrivateRoute.stories.mdx b/src/components/PrivateRoute/PrivateRoute.stories.mdx index b8d85ae..5d56b0b 100644 --- a/src/components/PrivateRoute/PrivateRoute.stories.mdx +++ b/src/components/PrivateRoute/PrivateRoute.stories.mdx @@ -1,7 +1,26 @@ -import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks'; +import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks'; +import PrivateRoute from "../PrivateRoute"; -The PrivateRoute wraps [React Router](https://reactrouter.com/)'s [Route component](https://reactrouter.com/web/api/Route) and checks for authentication using [AuthProvider](/?path=/docs/components-authprovider--page). If authentication is valid, the children of the PrivateRoute are rendered. Otherwise, the user is redirected to the login page. + - +The PrivateRoute wraps [React Router](https://reactrouter.com/)'s [Route component](https://reactrouter.com/web/api/Route) and checks for authentication using [AuthProvider](/?path=/docs/components-authprovider--page). If authentication is valid, the children of the PrivateRoute are rendered. Otherwise, the user is redirected to `/login`. -export const Template = (props) => +```js + + + +``` + +Props other than `children` and `path` can be passed to the underlying [Route component](https://reactrouter.com/web/api/Route). +```js + + + +``` + + + +All other props are passed to the [Route component](https://reactrouter.com/web/api/Route). \ No newline at end of file