From a797bbac29ca313eefeb51d9e2870d7490c55c5e Mon Sep 17 00:00:00 2001 From: cocomarine Date: Tue, 7 Jul 2026 12:34:26 +0100 Subject: [PATCH] add licences link to InfoPanel WIP modal --- public/translations/en.json | 1 + src/assets/stylesheets/InfoPanel.scss | 19 ++++++++----- .../Menus/Sidebar/InfoPanel/InfoPanel.jsx | 28 ++++++++++++++++++- 3 files changed, 40 insertions(+), 8 deletions(-) diff --git a/public/translations/en.json b/public/translations/en.json index 7b2b2c7cf..e3a3eb6ca 100644 --- a/public/translations/en.json +++ b/public/translations/en.json @@ -284,6 +284,7 @@ "cookies": "Cookies", "accessibility": "Accessibility", "safeguarding": "Safeguarding", + "licenses": "Licenses", "charity": "Raspberry Pi Foundation - UK registered charity 1129409", "settingsMenu": { "heading": "Settings", diff --git a/src/assets/stylesheets/InfoPanel.scss b/src/assets/stylesheets/InfoPanel.scss index 5746b3a7e..b77d00bce 100644 --- a/src/assets/stylesheets/InfoPanel.scss +++ b/src/assets/stylesheets/InfoPanel.scss @@ -17,16 +17,19 @@ display: flex; flex-direction: column; - a { + a, button { @include font-size-1(regular); + font-family: inherit; font-weight: $font-weight-bold; text-decoration: underline; } -} -.info-panel__link { - &:last-of-type { - margin-block-end: $space-1; + button { + border: 3px solid transparent; + } + + p { + margin-block-start: $space-1; } } @@ -36,7 +39,8 @@ background-color: $rpf-grey-600; } - .info-panel__links a { + .info-panel__links a, + .info-panel__links button { color: $rpf-text-primary-darkmode; } } @@ -47,7 +51,8 @@ background-color: $rpf-grey-50; } - .info-panel__links a { + .info-panel__links a, + .info-panel__links button { color: $rpf-text-primary; } } diff --git a/src/components/Menus/Sidebar/InfoPanel/InfoPanel.jsx b/src/components/Menus/Sidebar/InfoPanel/InfoPanel.jsx index 73ed77e00..c02a6e608 100644 --- a/src/components/Menus/Sidebar/InfoPanel/InfoPanel.jsx +++ b/src/components/Menus/Sidebar/InfoPanel/InfoPanel.jsx @@ -1,5 +1,7 @@ -import React from "react"; +import React, { useState } from "react"; import { useTranslation } from "react-i18next"; +import { useSelector } from "react-redux"; +import { Modal } from "@raspberrypifoundation/design-system-react"; import SidebarPanel from "../SidebarPanel"; import "../../../../assets/stylesheets/InfoPanel.scss"; @@ -24,6 +26,10 @@ const feedbackUrl = (url) => { const InfoPanel = ({ feedbackFormUrl = CODE_EDITOR_FEEDBACK_URL }) => { const { t } = useTranslation(); + const [isLicensesModalOpen, setIsLicensesModalOpen] = useState(false); + const projectType = useSelector((state) => state.editor.project.project_type); + const isScratchProject = projectType === "code_editor_scratch"; + const links = [ { id: "help", @@ -74,8 +80,28 @@ const InfoPanel = ({ feedbackFormUrl = CODE_EDITOR_FEEDBACK_URL }) => { {link.text} ))} + {isScratchProject && ( + + )}

{t("sidebar.charity")}

+ + {isScratchProject && ( + +

Hello, this is a test modal content.

+
+ )} ); };