Skip to content

Commit 0a3b881

Browse files
cwhittenbeyackle
andauthored
feat: add tutorial tiles (microsoft#3057)
* Update tutorial tiles * Remove unused variable * Adds aka.ms links Co-authored-by: Ben Yackley <[email protected]>
1 parent a95a518 commit 0a3b881

File tree

3 files changed

+52
-25
lines changed

3 files changed

+52
-25
lines changed

Composer/packages/client/src/pages/home/ItemContainer.tsx

+16-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/** @jsx jsx */
55
import { jsx, SerializedStyles } from '@emotion/core';
66
import React from 'react';
7-
import { Button } from 'office-ui-fabric-react/lib/Button';
7+
import { Button, IButtonProps } from 'office-ui-fabric-react/lib/Button';
88
import { Text } from 'office-ui-fabric-react/lib/Text';
99

1010
import {
@@ -16,9 +16,10 @@ import {
1616
childrenContainer,
1717
} from './styles';
1818

19-
interface ItemContainerProps {
19+
interface ItemContainerProps extends Omit<IButtonProps, 'onChange' | 'styles' | 'title'> {
2020
onClick?: () => void | Promise<void>;
2121
title: string | JSX.Element;
22+
subContent?: string;
2223
content: string;
2324
styles?: {
2425
container?: SerializedStyles;
@@ -33,6 +34,7 @@ export const ItemContainer: React.FC<ItemContainerProps> = ({
3334
onClick = undefined,
3435
title,
3536
content,
37+
subContent,
3638
styles = {},
3739
disabled,
3840
forwardedRef,
@@ -42,13 +44,22 @@ export const ItemContainer: React.FC<ItemContainerProps> = ({
4244
return (
4345
<div css={childrenContainer} ref={forwardedRef}>
4446
<div css={[itemContainer, styles.title, disabled ? disabledItem.title : undefined]}>
45-
<div css={itemContainerTitle}>{title}</div>
47+
<div css={itemContainerTitle}>
48+
<Text block variant="large">
49+
{title}
50+
</Text>
51+
</div>
4652
</div>
4753
<div css={[itemContainer, styles.content, disabled ? disabledItem.content : undefined]}>
4854
<div css={itemContainerContent}>
49-
<Text variant="large" nowrap>
55+
<Text variant={subContent ? 'medium' : 'large'} nowrap>
5056
{content}
5157
</Text>
58+
{subContent && (
59+
<Text variant="medium" nowrap>
60+
{subContent}
61+
</Text>
62+
)}
5263
</div>
5364
</div>
5465
</div>
@@ -59,8 +70,8 @@ export const ItemContainer: React.FC<ItemContainerProps> = ({
5970
<Button
6071
css={[itemContainerWrapper(disabled), styles.container]}
6172
onClick={async e => {
62-
e.preventDefault();
6373
if (onClick) {
74+
e.preventDefault();
6475
await onClick();
6576
}
6677
}}

Composer/packages/client/src/pages/home/index.tsx

+25-19
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,24 @@ const linksButtom = [
3131
},
3232
];
3333

34-
const comingSoonLink = {
35-
to: '/home',
36-
text: formatMessage('Coming soon!'),
37-
css: home.bluetitle,
38-
};
39-
4034
const turtorials = [
4135
{
42-
title: formatMessage('Tutorial #1'),
43-
content: formatMessage('Coming soon...'),
36+
title: formatMessage('5 Minute Intro'),
37+
content: formatMessage('Chris Whitten'),
38+
subContent: formatMessage('Apr 9, 2020'),
39+
href: 'https://aka.ms/bf-composer-tutorial-chris',
40+
},
41+
{
42+
title: formatMessage('Weather Bot'),
43+
content: formatMessage('Ben Brown'),
44+
subContent: formatMessage('Nov 12, 2019'),
45+
href: 'https://aka.ms/bf-composer-tutorial-ben',
4446
},
4547
{
46-
title: formatMessage('Tutorial #2'),
47-
content: formatMessage('Coming soon...'),
48+
title: formatMessage('MSFT Ignite AI Show'),
49+
content: formatMessage('Vishwac Sena'),
50+
subContent: formatMessage('Jan 28, 2020'),
51+
href: 'https://aka.ms/bf-composer-tutorial-vishwac',
4852
},
4953
];
5054

@@ -190,17 +194,19 @@ const Home: React.FC<RouteComponentProps> = () => {
190194
</div>
191195
)}
192196
<div css={home.leftContainer}>
193-
<h2 css={home.subtitle}>
194-
{formatMessage('Video tutorials:')}&nbsp;
195-
<Link href={comingSoonLink.to} key={comingSoonLink.text} target={'_blank'}>
196-
<span css={comingSoonLink.css} aria-label={'Video tutorials coming soon'}>
197-
{comingSoonLink.text}
198-
</span>
199-
</Link>
200-
</h2>
197+
<h2 css={home.subtitle}>{formatMessage('Video tutorials:')}&nbsp;</h2>
201198
<div css={home.newBotContainer}>
202199
{turtorials.map((item, index) => (
203-
<ItemContainer key={index} title={item.title} content={item.content} disabled />
200+
<ItemContainer
201+
styles={home.tutorialTile}
202+
key={index}
203+
title={item.title}
204+
content={item.content}
205+
subContent={item.subContent}
206+
href={item.href}
207+
target="_blank"
208+
rel="noopener nofollow"
209+
/>
204210
))}
205211
<div css={home.linkContainer}>
206212
<div>

Composer/packages/client/src/pages/home/styles.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ export const introduction = css`
5454

5555
export const newBotContainer = css`
5656
display: flex;
57-
flex-wrap: wrap;
5857
margin: 20px 0;
5958
`;
6059

@@ -85,6 +84,8 @@ export const itemContainer = css`
8584

8685
export const itemContainerTitle = css`
8786
height: 100%;
87+
color: white;
88+
text-align: left;
8889
display: flex;
8990
align-items: center;
9091
font-size: 20px;
@@ -96,6 +97,8 @@ export const itemContainerTitle = css`
9697

9798
export const itemContainerContent = css`
9899
height: 100%;
100+
display: flex;
101+
flex-direction: column;
99102
font-size: 16px;
100103
font-weight: 600;
101104
text-align: left;
@@ -205,6 +208,13 @@ export const latestBotItem = {
205208
`,
206209
};
207210

211+
export const tutorialTile = {
212+
...baseBotItem,
213+
title: css`
214+
background-color: #004c87;
215+
`,
216+
};
217+
208218
export const childrenContainer = css`
209219
display: flex;
210220
flex-direction: column;

0 commit comments

Comments
 (0)