Skip to content

Commit ff0100b

Browse files
committed
merge with pr05/Migrate_client_components_final_rebuild
2 parents 839a8aa + 75bdd16 commit ff0100b

File tree

5 files changed

+35
-18
lines changed

5 files changed

+35
-18
lines changed

client/components/Menubar/contexts.tsx

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,26 @@ export const MenuOpenContext = createContext<string>('none');
77
interface MenubarContextType {
88
createMenuHandlers: (
99
id: string
10-
) => {
10+
) => Partial<{
1111
onMouseOver: (e: React.MouseEvent) => void;
1212
onClick: (e: React.MouseEvent) => void;
1313
onBlur: (e: React.FocusEvent) => void;
1414
onFocus: (e: React.FocusEvent) => void;
15-
};
15+
}>;
1616
createMenuItemHandlers: (
1717
id: string
18-
) => {
18+
) => Partial<{
1919
onMouseUp: (e: React.MouseEvent) => void;
2020
onBlur: (e: React.FocusEvent) => void;
2121
onFocus: (e: React.FocusEvent) => void;
22-
};
22+
}>;
2323
toggleMenuOpen: (id: string) => void;
2424
hasFocus: boolean;
2525
}
2626

2727
export const MenubarContext = createContext<MenubarContextType>({
28-
createMenuHandlers: () => ({
29-
onMouseOver: () => {},
30-
onClick: () => {},
31-
onBlur: () => {},
32-
onFocus: () => {}
33-
}),
34-
createMenuItemHandlers: () => ({
35-
onMouseUp: () => {},
36-
onBlur: () => {},
37-
onFocus: () => {}
38-
}),
28+
createMenuHandlers: () => ({}),
29+
createMenuItemHandlers: () => ({}),
3930
toggleMenuOpen: () => {},
4031
hasFocus: false
4132
});

client/index.jsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,31 @@ const script = document.createElement('script');
3434
script.src = 'https://foundation-donate-banner.netlify.app/static/js/main.js';
3535
document.body.appendChild(script);
3636

37+
if (window.location.href.indexOf('full') === -1) {
38+
const buttonScript = document.createElement('script');
39+
buttonScript.type = 'text/javascript';
40+
buttonScript.defer = true;
41+
buttonScript.id = 'donorbox-popup-button-installer';
42+
buttonScript.src = 'https://donorbox.org/install-popup-button.js';
43+
44+
buttonScript.setAttribute(
45+
'data-href',
46+
'https://donorbox.org/back-to-school-805292'
47+
);
48+
buttonScript.setAttribute(
49+
'data-style',
50+
// eslint-disable-next-line max-len
51+
'background: #f1678e; color: #fff; text-decoration: none; font-family: Verdana, sans-serif; display: flex; gap: 8px; width: fit-content; font-size: 16px; border-radius: 0 0 5px 5px; line-height: 24px; position: fixed; top: 50%; transform-origin: center; z-index: 9999; overflow: hidden; padding: 8px 22px 8px 18px; right: 20px; left: auto; transform: translate(50%, -50%) rotate(90deg)'
52+
);
53+
buttonScript.setAttribute('data-button-cta', 'Donate');
54+
buttonScript.setAttribute(
55+
'data-img-src',
56+
'https://donorbox.org/images/white_logo.svg'
57+
);
58+
59+
document.body.appendChild(buttonScript);
60+
}
61+
3762
const App = () => (
3863
<div>
3964
<Router history={browserHistory}>

common/p5Versions.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export const currentP5Version = '1.11.10'; // Don't update to 2.x until 2026
55
// JSON.stringify([...document.querySelectorAll('._132722c7')].map(n => n.innerText), null, 2)
66
// TODO: use their API for this to grab these at build time?
77
export const p5Versions = [
8+
'2.0.5',
89
'2.0.4',
910
'2.0.3',
1011
'2.0.2',

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "p5.js-web-editor",
3-
"version": "2.18.0",
3+
"version": "2.18.1",
44
"description": "The web editor for p5.js.",
55
"scripts": {
66
"clean": "rimraf dist",

0 commit comments

Comments
 (0)