@financial-times/n-myft-ui 24.0.0 → 25.0.0-beta.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,9 @@
1
1
  import React from 'react';
2
2
  import FollowButton from '../../components/follow-button/follow-button';
3
+ import ConceptList from '../../components/concept-list/concept-list';
4
+ import Collections from '../../components/collections/collections';
5
+ import { SaveForLater } from '../../components';
6
+ import { PinButton } from '../../components';
3
7
 
4
8
  export default function Demo (props) {
5
9
 
@@ -7,9 +11,13 @@ export default function Demo (props) {
7
11
  title,
8
12
  flags,
9
13
  followButton,
14
+ conceptList,
15
+ collections,
16
+ saveButton,
17
+ pinButton
10
18
  } = props;
11
19
 
12
- const followButtonProps = {...followButton, flags};
20
+ const followButtonProps = { ...followButton, flags };
13
21
 
14
22
  return (
15
23
  <div className="o-grid-container o-grid-container--snappy demo-container">
@@ -25,9 +33,93 @@ export default function Demo (props) {
25
33
  Follow button
26
34
  </h2>
27
35
  <FollowButton {...followButtonProps} />
36
+
37
+
38
+ <h2
39
+ className="demo-section__title">
40
+ x-dash follow button
41
+ </h2>
42
+
43
+ <FollowButton {...followButtonProps} buttonText={followButton.name} />
44
+
45
+
46
+ <h2 className="demo-section__title">
47
+ Save button
48
+ </h2>
49
+ <SaveForLater flags={flags} {...saveButton} />
50
+
51
+ <h2 className="demo-section__title">
52
+ Unsave button
53
+ </h2>
54
+ <SaveForLater flags={flags} {...saveButton} isSaved={true} />
55
+
56
+ <h2 className="demo-section__title">
57
+ Unsave button with icon
58
+ </h2>
59
+ <SaveForLater flags={flags} {...saveButton} saveButtonWithIcon={true} />
60
+
61
+ <h2 className="demo-section__title">
62
+ Save button with icon
63
+ </h2>
64
+ <SaveForLater flags={flags} {...saveButton} isSaved={true} saveButtonWithIcon={true} />
65
+
66
+ <h2 className="demo-section__title">
67
+ Pin button
68
+ </h2>
69
+
70
+ {pinButton.map((item, index) => <PinButton key={index} {...item}/>)}
71
+
72
+ </div>
73
+ </div>
74
+ </section>
75
+
76
+ <section
77
+ id="topic-list"
78
+ className="demo-section">
79
+ <div className="o-grid-row">
80
+ <div data-o-grid-colspan="12">
81
+ <h2 className="demo-section__title">
82
+ Topic list
83
+ </h2>
84
+
85
+ <p className="demo-section__description">
86
+ A list of topics to follow
87
+ </p>
88
+ </div>
89
+
90
+ {
91
+ conceptList && conceptList.map((list, index) =>
92
+ <div key={index} data-o-grid-colspan="3">
93
+ <ConceptList {...list} flags={flags} />
94
+ </div>)
95
+ }
96
+
97
+ </div>
98
+ </section>
99
+
100
+ <section
101
+ id="collections"
102
+ className="demo-section">
103
+ <div className="o-grid-row">
104
+ <div data-o-grid-colspan="12">
105
+ <h2 className="demo-section__title">
106
+ Collections
107
+ </h2>
108
+
109
+ <p className="demo-section__description">
110
+ Curated collections of topics to follow.
111
+ </p>
28
112
  </div>
113
+
114
+ {collections.map((collection, index) => (
115
+ <div key={index} data-o-grid-colspan="3">
116
+ <Collections {...collection} flags={flags} />
117
+ </div>
118
+ ))}
119
+
29
120
  </div>
30
121
  </section>
122
+
31
123
  </div>
32
124
  )
33
125
  }