Removed popup, added warnings instead

This commit is contained in:
Nicolas Munnich 2024-08-30 20:28:27 +02:00 committed by Cem Aksoylar
parent 51e18b44b2
commit d53e27d0d0
8 changed files with 16 additions and 121 deletions

View file

@ -3,6 +3,10 @@ title: Documentation
sidebar_label: Documentation
---
:::danger
Before reading this section, it is **vital** that you read through our [clean room policy](clean-room.md).
:::
This document outlines how to test your documentation changes locally and prepare the changes for a pull request.
The documentation is written with [Docusaurus](https://docusaurus.io/). The ZMK source code has all of the necessary Docusaurus dependencies included, but referencing their documentation can be helpful at times.

View file

@ -9,6 +9,10 @@ import KeymapExampleFile from "../../keymap-example-file.md";
import InterconnectTabs from "@site/src/components/interconnect-tabs";
import Metadata from "@site/src/data/hardware-metadata.json";
:::danger
Before reading this section, it is **vital** that you read through our [clean room policy](../contributing/clean-room.md).
:::
## Overview
This guide will walk through the steps necessary to add ZMK support for a keyboard that uses an add-on MCU board (e.g. Pro Micro compatible) to provide the microprocessor.
@ -60,13 +64,6 @@ Neither of these should be moved out of their parent directory. The other files
## New Shield Directory
:::note
This guide describes how to add a shield to an independently managed Zephyr module repository. This is the
preferred way to handle boards and shields moving forward in ZMK, although the tooling to make this easier
for users is still improving. ZMK does have a collection of boards/shields in the ZMK main repository, which are planned to be phased out, but until that is complete, there _may_ be a few select scenarios where adding your keyboard to ZMK itself is preferred. Due the volume of PRs and the focus of ZMK development not being merging of keyboard PRs, you are highly encouraged to use an out-of-tree Zephyr module repository to manage your definitions. Should you choose to try to get your keyboard included in ZMK main repository, the paths in the rest of the guide would be nested under the `app/` folder there instead. For example, `boards/shields/<keyboard_name>` should now be
`app/boards/shields/<keyboard_name>`.
:::
Shields in Zephyr module "board root" go into the `boards/shields/` directory; that means the new shield directory in your module repository should be:
```bash

View file

@ -6,6 +6,10 @@ sidebar_label: New Behavior Guide
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
:::danger
Before reading this section, it is **vital** that you read through our [clean room policy](./contributing/clean-room.md).
:::
## Overview
This document outlines how to develop a [behavior](../keymaps/behaviors/index.mdx) for ZMK and prepare the changes for a pull request.

View file

@ -8,6 +8,10 @@ ZMK Studio is still in active development, and the below information is for deve
:::
:::danger
Before reading this section, it is **vital** that you read through our [clean room policy](./contributing/clean-room.md).
:::
## Overview
The ZMK Studio UI communicates with ZMK devices using a custom RPC protocol developed to be robust and reliable, while remaining simple and easy to extend with future enhancements.

View file

@ -1,35 +0,0 @@
import { useEffect, useState } from "react";
import { useLocation } from "@docusaurus/router";
import Popup from "./popup";
const PopupManager = () => {
const location = useLocation();
const [showPopup, setShowPopup] = useState(false);
const categoryPath = "/docs/development";
const redirectPath = "/docs/development/contributing/clean-room";
useEffect(() => {
// Check if the current path is within the desired category
const isCategoryPage = location.pathname.startsWith(categoryPath);
if (isCategoryPage) {
// Check localStorage to see if the popup has been shown before
const hasSeenPopup = localStorage.getItem("hasSeenCleanRoomWarningPopup");
// If clean room is clicked directly no redirect necessary
if (window.location.pathname != redirectPath && !hasSeenPopup) {
setShowPopup(true);
localStorage.setItem("hasSeenCleanRoomWarningPopup", "true");
}
}
}, [location.pathname]);
const handleClose = () => {
window.location.href = redirectPath;
setShowPopup(false);
};
return showPopup ? <Popup onClose={handleClose} /> : null;
};
export default PopupManager;

View file

@ -1,35 +0,0 @@
import "../css/popup.css";
import PropTypes from "prop-types";
const Popup = ({ onClose }) => {
return (
<div className="popup-overlay">
<div
className="popup-content theme-admonition theme-admonition-danger admonition_node_modules-@docusaurus-theme-classic-lib-theme-Admonition-Layout-styles-module alert alert--danger"
role="alert"
>
<h1 className="centered-container"> Clean Room Policy </h1>
<div className="centered-container">
<p>
Before reading this section, it is <b>vital</b> that you read
through our clean room policy.
</p>
</div>
<div className="centered-container">
<button
className="button button--outline button--secondary"
onClick={onClose}
>
Take me there!
</button>
</div>
</div>
</div>
);
};
export default Popup;
Popup.propTypes = {
onClose: PropTypes.func.isRequired,
};

View file

@ -1,33 +0,0 @@
/* src/components/Popup.css */
.popup-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
}
.popup-content {
border-left: 4px solid var(--ifm-color-danger-dark); /* Border width, style, and color */
border-right: 4px solid var(--ifm-color-danger-dark); /* Border width, style, and color */
justify-content: center;
background: var(--ifm-alert-background-color);
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
max-width: 700px;
width: 100%;
}
.popup-content button {
margin-top: 10px;
}
.centered-container {
display: flex;
justify-content: center;
}

View file

@ -1,11 +0,0 @@
import Footer from "@theme-original/Footer";
import PopupManager from "../../components/popup-manager"; // Adjust path if necessary
export default function FooterWrapper(props) {
return (
<>
<PopupManager />
<Footer {...props} />
</>
);
}