Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions skills/objectui/guides/auth-permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const authClient = createAuthClient({ baseURL: '/api/v1/auth' });

function App() {
return (
<AuthProvider authClient={authClient}>
<AuthProvider authUrl="/api/v1/auth" client={authClient}>
<AppContent />
</AuthProvider>
);
Expand Down Expand Up @@ -107,7 +107,7 @@ import { createAuthenticatedFetch, createAuthClient } from '@object-ui/auth';
import { ObjectStackAdapter } from '@object-ui/data-objectstack';

const authClient = createAuthClient({ baseURL: '/api/v1/auth' });
const authenticatedFetch = createAuthenticatedFetch(authClient);
const authenticatedFetch = createAuthenticatedFetch();

const dataSource = new ObjectStackAdapter({
baseUrl: '/api/v1',
Expand Down Expand Up @@ -239,7 +239,7 @@ import { PermissionGuard } from '@object-ui/permissions';

function AdminPanel() {
return (
<PermissionGuard object="contacts" action="delete" fallback={<AccessDenied />}>
<PermissionGuard object="contacts" action="delete" fallback="custom" fallbackContent={<AccessDenied />}>
<BulkDeleteButton />
</PermissionGuard>
);
Expand Down Expand Up @@ -325,7 +325,7 @@ Here's the typical nesting order for a full-featured app:

```typescript
<BrowserRouter>
<AuthProvider authClient={authClient}>
<AuthProvider authUrl="/api/v1/auth" client={authClient}>
<PermissionProvider roles={roles} permissions={perms} userRoles={userRoles}>
<SchemaRendererProvider dataSource={authenticatedDataSource}>
<AuthGuard fallback={<LoginPage />}>
Expand Down
8 changes: 3 additions & 5 deletions skills/objectui/guides/i18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,13 @@ For Tailwind layout adjustments, use RTL-aware utilities:
## Number, date, and currency formatting

```typescript
import { useObjectTranslation } from '@object-ui/i18n';
import { formatCurrency, formatDate, formatNumber, formatRelativeTime } from '@object-ui/i18n';

function PriceDisplay({ amount, currency, date }) {
const { formatCurrency, formatDate, formatNumber, formatRelativeTime } = useObjectTranslation();

return (
<div>
<p>{formatCurrency(amount, currency)}</p> {/* $1,234.56 or ¥1,234.56 */}
<p>{formatDate(date, 'YYYY-MM-DD')}</p> {/* 2024-03-15 */}
<p>{formatCurrency(amount, { currency })}</p> {/* $1,234.56 or ¥1,234.56 */}
<p>{formatDate(date, { style: 'short' })}</p> {/* 2024-03-15 */}
<p>{formatNumber(1234567)}</p> {/* 1,234,567 or 1.234.567 */}
<p>{formatRelativeTime(date)}</p> {/* "3 days ago" */}
</div>
Expand Down
2 changes: 1 addition & 1 deletion skills/objectui/guides/mobile.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function MobileCard() {
threshold: 50,
});

const listRef = usePullToRefresh<HTMLDivElement>({
const { ref: listRef } = usePullToRefresh<HTMLDivElement>({
onRefresh: async () => refetch(), // threshold?: px, default 80
});

Expand Down
2 changes: 1 addition & 1 deletion skills/objectui/guides/project-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ import. Importing any of the three from `app-shell` does not resolve.
import { AppShell, ObjectView, AdapterProvider, MetadataProvider } from '@object-ui/app-shell';

<AdapterProvider adapter={myAdapter}>
<MetadataProvider value={metadata}>
<MetadataProvider adapter={myAdapter}>
<AppShell sidebar={<MySidebar />}>
<ObjectView objectName="contact" />
</AppShell>
Expand Down