|
| 1 | +import { |
| 2 | + ArticleDesign, |
| 3 | + ArticleDisplay, |
| 4 | + ArticleSpecial, |
| 5 | + Pillar, |
| 6 | +} from '../../lib/articleFormat'; |
1 | 7 | import { Available } from './available'; |
2 | 8 | import { descriptionLinks } from './styles'; |
3 | 9 |
|
@@ -89,37 +95,41 @@ const Examples = () => ( |
89 | 95 | </> |
90 | 96 | ); |
91 | 97 |
|
| 98 | +const formatValues = (a: object): string => |
| 99 | + Object.values(a) |
| 100 | + .filter((v) => typeof v !== 'number') |
| 101 | + .join(', '); |
| 102 | + |
92 | 103 | const Format = () => ( |
93 | 104 | <> |
94 | 105 | <h2>Format</h2> |
95 | 106 | <p> |
96 | 107 | The <code>ArticleFormat</code>, sometimes known as just "Format", |
97 | 108 | determines the kind of article being rendered. It influences what |
98 | | - content and features the article will contain, and what the design |
99 | | - will look like. It's broken down into three dimensions: |
| 109 | + content and features the article will contain, and what the |
| 110 | + ArticleDesign will look like. It's broken down into three |
| 111 | + dimensions: |
100 | 112 | </p> |
101 | 113 | <dl> |
102 | 114 | <dt>Design</dt> |
103 | 115 | <dd> |
104 | 116 | Primarily influences the content, structure and features of an |
105 | 117 | article. It's the most important of the three, and is often used |
106 | | - as a shorthand to describe the "kind" of article. Examples |
107 | | - include <code>Liveblog</code>, <code>Feature</code> and{' '} |
108 | | - <code>Gallery</code>. |
| 118 | + as a shorthand to describe the "kind" of article. The values |
| 119 | + are: {formatValues(ArticleDesign)}. |
109 | 120 | </dd> |
110 | 121 | <dt>Display</dt> |
111 | 122 | <dd> |
112 | | - Primarily influences the layout of an article. Examples include{' '} |
113 | | - <code>Immersive</code>, <code>Showcase</code> and{' '} |
114 | | - <code>NumberedList</code>. |
| 123 | + Primarily influences the layout of an article. The values are:{' '} |
| 124 | + {formatValues(ArticleDisplay)}. |
115 | 125 | </dd> |
116 | 126 | <dt>Theme</dt> |
117 | 127 | <dd> |
118 | 128 | Primarily influences the fonts and colours of an article. It can |
119 | 129 | can be thought of as a superset of "pillar", i.e. all the |
120 | 130 | pillars are considered themes, but there are some additional |
121 | | - themes that are not pillars. Examples include <code>News</code>,{' '} |
122 | | - <code>Sport</code> and <code>Labs</code>. |
| 131 | + themes that are not pillars. The values are:{' '} |
| 132 | + {formatValues(Pillar)}, {formatValues(ArticleSpecial)}. |
123 | 133 | </dd> |
124 | 134 | </dl> |
125 | 135 | <p> |
|
0 commit comments