-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathBulletPointOrdered.tsx
45 lines (38 loc) · 1.13 KB
/
BulletPointOrdered.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import React from 'react';
import {Box, Text} from 'components';
import {useI18n} from 'locale';
interface OrderedListProps {
text: string;
key: string;
orderedListChar: string;
listAccessibile: string;
}
export const BulletPointOrdered = ({orderedListChar, text, listAccessibile}: OrderedListProps) => {
const i18n = useI18n();
let orderedListLabel;
let textLabel;
switch (listAccessibile) {
case 'listStart':
orderedListLabel = `${orderedListChar} \n ${i18n.translate(`A11yList.Start`)}`;
break;
case 'listEnd':
orderedListLabel = orderedListChar;
textLabel = `${text} ${i18n.translate(`A11yList.End`)}`;
break;
case 'item':
orderedListLabel = orderedListChar;
break;
}
return (
<Box flexDirection="row" marginRight="m">
<Box marginBottom="l">
<Text accessible accessibilityLabel={orderedListLabel} variant="bodyText" color="bodyText">
{orderedListChar}
</Text>
</Box>
<Text accessibilityLabel={textLabel} variant="bodyText" color="bodyText" marginLeft="s" marginBottom="l">
{text}
</Text>
</Box>
);
};