Skip to content

Commit

Permalink
Migrate marketing pages to Redocly
Browse files Browse the repository at this point in the history
adds events page, updates convert-template script

adds proper filter logic to events page, adds moment

converts history page

converts impact and xrpl-ledger-overview page

try getting animation on impact to work

converts xrp overview page and logic

adds contribute page, still needs typeform integration and animations

converts developer funding page

adds dev tools page

add missing image

adds code samples py conversion to js

adds hook to read current theme, adds animations to impact page

adds careers animations

adds correct animations for contribute page

adds light mode v of animations on contribute page

adds animations to uses page

adds modal logos and uses modal logic

completes uses page

more changes

Fix casing issues with use case files

fix grid issue on uses
  • Loading branch information
AKCodez authored and mDuo13 committed Dec 14, 2023
1 parent 457dfe8 commit 7f51ab4
Show file tree
Hide file tree
Showing 28 changed files with 209,800 additions and 200 deletions.
1 change: 0 additions & 1 deletion content/@theme/components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export function Navbar(props) {
// const [isOpen, setIsOpen] = useMobileMenu(false);
const themeConfig = useThemeConfig();
const { changeLanguage } = useI18n();

const menu = themeConfig.navbar?.items;
const logo = themeConfig.logo;

Expand Down
45 changes: 42 additions & 3 deletions content/@theme/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,53 @@
/**
* Slugify function, has to match the formula used in interactive-tutorial.js
*/
import { useEffect, useState } from 'react';

export const useThemeFromClassList = (classNames) => {
const [currentTheme, setCurrentTheme] = useState(null);

useEffect(() => {
// Function to update the theme based on the class list
const updateTheme = () => {
for (const className of classNames) {
if (document.documentElement.classList.contains(className)) {
setCurrentTheme(className);
return;
}
}
};

// Initial update
updateTheme();

// Create an observer instance linked to the callback function
const observer = new MutationObserver(() => {
updateTheme();
});

// Start observing the target node for configured mutations
observer.observe(document.documentElement, {
attributes: true, // Listen for attribute changes
attributeFilter: ['class'], // Specifically, listen only to "class" attribute changes
});

// Cleanup: Disconnect the observer
return () => {
observer.disconnect();
};
}, [classNames]);

return currentTheme;
};

export function slugify(s) {
const unacceptable_chars = /[^A-Za-z0-9._ ]+/g;
const whitespace_regex = /\s+/g;
s = s.replace(unacceptable_chars, '');
s = s.replace(whitespace_regex, '_');
s = s.replace(unacceptable_chars, "");
s = s.replace(whitespace_regex, "_");
s = s.toLowerCase();
if (!s) {
s = '_';
s = "_";
}
return s;
}
414 changes: 414 additions & 0 deletions content/ambassadors.page.tsx

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions content/code-samples.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const langIcons = {
go: require('./static/img/logos/golang.svg'),
java: require('./static/img/logos/java.svg'),
js: require('./static/img/logos/javascript.svg'),
php: require('./static/img/logos/php.svg'),
py: require('./static/img/logos/python.svg'),
http: require('./static/img/logos/globe.svg'),
};
Expand Down
Loading

0 comments on commit 7f51ab4

Please sign in to comment.