@guardian/stand 0.0.49 → 0.0.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,19 +15,11 @@ const descriptionMap = {
15
15
  us: "United States",
16
16
  au: "Australia"
17
17
  };
18
- const getSourceDescription = (source) => descriptionMap[source];
19
- const getTargetDescription = (source, target) => {
20
- switch (target) {
21
- case "global": return "Global";
22
- case "uk":
23
- case "us":
24
- case "au": return target === source ? "Domestic" : descriptionMap[source];
25
- }
26
- };
27
18
  const AUDIENCE_NOT_KNOWN_DESCRIPTION = "Intended audience unknown";
28
19
  const getSignifierTitle = (source, target) => {
29
20
  if (!source || !target) return AUDIENCE_NOT_KNOWN_DESCRIPTION;
30
- return `${getSourceDescription(source)} for ${getTargetDescription(source, target)} audience`;
21
+ if (source === target) return `${descriptionMap[source]} audience`;
22
+ return `${descriptionMap[source]} for ${descriptionMap[target]} audience`;
31
23
  };
32
24
  function IntendedAudienceSignifier({ source, target, theme = {}, cssOverrides, className, ...props }) {
33
25
  const mergedTheme = require_mergeDeep.mergeDeep(require_styles.defaultIntendedAudienceSignifierTheme, theme);
@@ -15,19 +15,11 @@ const descriptionMap = {
15
15
  us: "United States",
16
16
  au: "Australia"
17
17
  };
18
- const getSourceDescription = (source) => descriptionMap[source];
19
- const getTargetDescription = (source, target) => {
20
- switch (target) {
21
- case "global": return "Global";
22
- case "uk":
23
- case "us":
24
- case "au": return target === source ? "Domestic" : descriptionMap[source];
25
- }
26
- };
27
18
  const AUDIENCE_NOT_KNOWN_DESCRIPTION = "Intended audience unknown";
28
19
  const getSignifierTitle = (source, target) => {
29
20
  if (!source || !target) return AUDIENCE_NOT_KNOWN_DESCRIPTION;
30
- return `${getSourceDescription(source)} for ${getTargetDescription(source, target)} audience`;
21
+ if (source === target) return `${descriptionMap[source]} audience`;
22
+ return `${descriptionMap[source]} for ${descriptionMap[target]} audience`;
31
23
  };
32
24
  function IntendedAudienceSignifier({ source, target, theme = {}, cssOverrides, className, ...props }) {
33
25
  const mergedTheme = mergeDeep(defaultIntendedAudienceSignifierTheme, theme);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guardian/stand",
3
- "version": "0.0.49",
3
+ "version": "0.0.50",
4
4
  "repository": {
5
5
  "url": "https://github.com/guardian/stand"
6
6
  },