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
78 changes: 2 additions & 76 deletions demo/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
useEffect,
useState
} from 'react';
import { demoTemplates } from './templates';

const PRESET_OPTIONS: { value: BrandPreset; label: string }[] = [
{ value: 'default', label: 'Default' },
Expand Down Expand Up @@ -48,81 +49,6 @@ const INITIAL_BLOCKS: SupportedBlock[] = [
{ type: 'divider' }
];

const TEMPLATES: Template[] = [
{
id: 'approval-request',
name: 'Approval request',
description: 'Header + body + approve/reject actions.',
category: 'Approvals',
surface: 'message',
blocks: [
{ type: 'header', text: { type: 'plain_text', text: 'Approval needed' } },
{
type: 'section',
text: { type: 'mrkdwn', text: '*Sarah* requested time off from *Mar 12* to *Mar 18*.' }
},
{
type: 'actions',
elements: [
{
type: 'button',
text: { type: 'plain_text', text: 'Approve' },
style: 'primary',
value: 'approve'
},
{
type: 'button',
text: { type: 'plain_text', text: 'Reject' },
style: 'danger',
value: 'reject'
}
]
}
]
},
{
id: 'product-release',
name: 'Product release',
description: 'Announce a new release with a CTA.',
category: 'Notifications',
surface: 'message',
blocks: [
{ type: 'header', text: { type: 'plain_text', text: 'We just shipped v2.5' } },
{
type: 'section',
text: { type: 'mrkdwn', text: 'New: bulk edit, keyboard shortcuts, and a redesigned inbox.' }
}
]
},
{
id: 'daily-standup',
name: 'Daily standup',
description: 'Yesterday / Today / Blockers prompts.',
category: 'Polls and surveys',
surface: 'message',
blocks: [
{ type: 'header', text: { type: 'plain_text', text: 'Daily standup' } },
{ type: 'section', text: { type: 'mrkdwn', text: '*Yesterday:* ...' } },
{ type: 'section', text: { type: 'mrkdwn', text: '*Today:* ...' } },
{ type: 'section', text: { type: 'mrkdwn', text: '*Blockers:* ...' } }
]
},
{
id: 'modal-confirm',
name: 'Confirm delete',
description: 'Modal confirmation before a destructive action.',
category: 'Approvals',
surface: 'modal',
blocks: [
{ type: 'header', text: { type: 'plain_text', text: 'Are you sure?' } },
{
type: 'section',
text: { type: 'mrkdwn', text: 'This action cannot be undone.' }
}
]
}
];

async function loadChannels(): Promise<ChannelOption[]> {
await new Promise((r) => setTimeout(r, 200));
return MOCK_CHANNELS;
Expand Down Expand Up @@ -452,7 +378,7 @@ export function App() {
</button>
<TemplatePicker
templates={TEMPLATES}
templates={demoTemplates}
heading="Templates"
theme={theme}
onSelect={handleSelectTemplate}
Expand Down
Loading
Loading