Skip to content

Commit 0d3b338

Browse files
Move support links to the theme (#354)
The content isn't parameterised by brand/product name.
1 parent d877013 commit 0d3b338

File tree

9 files changed

+31
-12
lines changed

9 files changed

+31
-12
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- run: npm ci
3737
env:
3838
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39-
- run: npm install --no-save @microbit-foundation/ml-trainer-microbit@0.2.0-dev.8 @microbit-foundation/website-deploy-aws@0.6 @microbit-foundation/website-deploy-aws-config@0.9
39+
- run: npm install --no-save @microbit-foundation/ml-trainer-microbit@0.2.0-dev.9 @microbit-foundation/website-deploy-aws@0.6 @microbit-foundation/website-deploy-aws-config@0.9
4040
if: github.repository_owner == 'microbit-foundation'
4141
env:
4242
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

src/components/AppLogo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const AppLogo = ({
2020
>
2121
{OrgLogo && (
2222
<>
23-
<OrgLogo />
23+
<OrgLogo color="white" />
2424
<Divider
2525
aria-hidden
2626
borderColor={color}

src/components/ConnectBatteryDialog.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import { Icon, Image, Link, Text, VStack } from "@chakra-ui/react";
2+
import { RiExternalLinkLine } from "react-icons/ri";
23
import { FormattedMessage } from "react-intl";
4+
import { useDeployment } from "../deployment";
35
import microbitConnectedImage from "../images/stylised-microbit-connected.svg";
46
import ConnectContainerDialog, {
57
ConnectContainerDialogProps,
68
} from "./ConnectContainerDialog";
7-
import { RiExternalLinkLine } from "react-icons/ri";
89

910
export interface ConnectBatteryDialogProps
1011
extends Omit<ConnectContainerDialogProps, "children" | "headingId"> {}
1112

1213
const ConnectBatteryDialog = ({ ...props }: ConnectBatteryDialogProps) => {
14+
const { supportLinks } = useDeployment();
1315
return (
1416
<ConnectContainerDialog
1517
headingId="connectMB.connectBattery.heading"
@@ -20,8 +22,7 @@ const ConnectBatteryDialog = ({ ...props }: ConnectBatteryDialogProps) => {
2022
<FormattedMessage id="connectMB.connectBattery.subtitle" />
2123
<Link
2224
color="brand.600"
23-
//TODO: Replace with real support link.
24-
href="https://support.microbit.org/support/home"
25+
href={supportLinks.wearable}
2526
target="_blank"
2627
rel="noopener"
2728
display="flex"

src/components/ConnectErrorDialog.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
ConnectionFlowType,
2020
} from "../connection-stage-hooks";
2121
import ExternalLink from "./ExternalLink";
22+
import { useDeployment } from "../deployment";
2223

2324
interface ConnectErrorDialogProps {
2425
isOpen: boolean;
@@ -68,6 +69,7 @@ const ReconnectErrorDialog = ({
6869
flowType,
6970
errorStep,
7071
}: ConnectErrorDialogProps) => {
72+
const { supportLinks } = useDeployment();
7173
const errorTextIdPrefix = errorTextIdPrefixConfig[errorStep];
7274
const flowTypeText = {
7375
[ConnectionFlowType.ConnectBluetooth]: "bluetooth",
@@ -116,7 +118,7 @@ const ReconnectErrorDialog = ({
116118
<ModalFooter justifyContent="space-between" px={0} pb={0}>
117119
<ExternalLink
118120
textId="connectMB.troubleshooting"
119-
href="https://support.microbit.org/a/solutions/articles/19000157495"
121+
href={supportLinks.troubleshooting}
120122
/>
121123
<HStack gap={5}>
122124
<Button onClick={onClose} variant="secondary" size="lg">

src/components/HelpMenu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ const HelpMenu = ({ isMobile, ...rest }: HelpMenuProps) => {
6464
/>
6565
<Portal>
6666
<MenuList>
67-
{deployment.supportLink && (
67+
{deployment.supportLinks.main && (
6868
<>
6969
<MenuItem
7070
as="a"
71-
href={deployment.supportLink}
71+
href={deployment.supportLinks.main}
7272
target="_blank"
7373
rel="noopener"
7474
icon={<RiExternalLinkLine />}

src/components/UnsupportedMicrobitDialog.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
} from "@chakra-ui/react";
1313
import { ReactNode } from "react";
1414
import { FormattedMessage } from "react-intl";
15+
import { useDeployment } from "../deployment";
1516
import Link from "./Link";
1617

1718
interface UnsupportedMicrobitDialogProps {
@@ -27,6 +28,7 @@ const UnsupportedMicrobitDialog = ({
2728
onStartBluetoothClick,
2829
isBluetoothSupported,
2930
}: UnsupportedMicrobitDialogProps) => {
31+
const { supportLinks } = useDeployment();
3032
return (
3133
<Modal
3234
closeOnOverlayClick={false}
@@ -71,8 +73,7 @@ const UnsupportedMicrobitDialog = ({
7173
link: (chunks: ReactNode) => (
7274
<Link
7375
color="brand.600"
74-
// TODO: Replace with real support link.
75-
href="https://support.microbit.org/support/home"
76+
href={supportLinks.bluetooth}
7677
target="_blank"
7778
rel="noopener"
7879
>

src/components/WhatYouWillNeedDialog.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import ConnectContainerDialog, {
1010
ConnectContainerDialogProps,
1111
} from "./ConnectContainerDialog";
1212
import ExternalLink from "./ExternalLink";
13+
import { useDeployment } from "../deployment";
1314

1415
const itemsConfig = {
1516
radio: [
@@ -71,6 +72,7 @@ const WhatYouWillNeedDialog = ({
7172
onLinkClick,
7273
...props
7374
}: WhatYouWillNeedDialogProps) => {
75+
const { supportLinks } = useDeployment();
7476
return (
7577
<ConnectContainerDialog
7678
{...props}
@@ -92,7 +94,7 @@ const WhatYouWillNeedDialog = ({
9294
)}
9395
{reconnect && (
9496
<ExternalLink
95-
href="https://support.microbit.org/a/solutions/articles/19000157495"
97+
href={supportLinks.troubleshooting}
9698
textId="connectMB.troubleshoot"
9799
/>
98100
)}

src/deployment/default/index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ const defaultDeploymentFactory: DeploymentConfigFactory = () => ({
4545
consentContext: stubConsentContext,
4646
manageCookies: undefined,
4747
},
48+
supportLinks: {
49+
// Just placeholders, these need replacing in a real deployment with branded help content.
50+
bluetooth: "https://support.microbit.org",
51+
main: "https://support.microbit.org",
52+
troubleshooting: "https://support.microbit.org",
53+
wearable: "https://support.microbit.org",
54+
},
4855
});
4956

5057
export default defaultDeploymentFactory;

src/deployment/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ export interface DeploymentConfig {
4747
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4848
chakraTheme: any;
4949

50-
supportLink?: string;
50+
supportLinks: {
51+
main: string;
52+
troubleshooting: string;
53+
bluetooth: string;
54+
wearable: string;
55+
};
56+
5157
termsOfUseLink?: string;
5258
privacyPolicyLink?: string;
5359

0 commit comments

Comments
 (0)