Skip to content

Commit

Permalink
fix(docs): Fixed documentation homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotcourant committed May 19, 2024
1 parent 8b673b6 commit 4992a7c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 34 deletions.
8 changes: 0 additions & 8 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE
)

set(STORYBOOK_DOCS "${DOCUMENTATION_OUT_DIR}/_storybook")
set(STORY_OUTPUT ${CMAKE_BINARY_DIR}/stories/marketing)
file(GLOB STORY_FILES "${CMAKE_SOURCE_DIR}/stories/*.*")
add_custom_command(
OUTPUT ${DOCUMENTATION_DIST} ${CMAKE_CURRENT_SOURCE_DIR}/.next ${CMAKE_CURRENT_SOURCE_DIR}/out
BYPRODUCTS ${DOCUMENTATION_DIST} ${CMAKE_CURRENT_SOURCE_DIR}/.next ${CMAKE_CURRENT_SOURCE_DIR}/out
Expand All @@ -54,9 +51,6 @@ add_custom_command(
COMMAND ${NODE_EXECUTABLE} ${DOCS_SRC_DIR}/intl-temp.js ${CMAKE_CURRENT_SOURCE_DIR}/out
# This fixes an issue with github pages not liking underscore prefixed directories.
COMMAND ${CMAKE_COMMAND} -E touch ${DOCUMENTATION_OUT_DIR}/.nojekyll
COMMAND ${CMAKE_COMMAND} -E make_directory ${STORYBOOK_DOCS}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${STORY_OUTPUT}/ ${STORYBOOK_DOCS}
COMMAND ${CMAKE_COMMAND} -E copy ${STORY_OUTPUT}/mockServiceWorker.js ${CMAKE_SOURCE_DIR}/docs/out/mockServiceWorker.js
COMMENT "Building monetr.app documentation and website"
WORKING_DIRECTORY ${DOCS_SRC_DIR}
DEPENDS
Expand All @@ -65,8 +59,6 @@ add_custom_command(
${ALL_DOCS_FILES}
${PUBLIC_FILES}
${DOCS_CONFIG_FILES}
${STORY_FILES}
build.stories.marketing
)

add_custom_target(
Expand Down
Binary file added docs/src/assets/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 33 additions & 26 deletions docs/src/components/InterfaceExample.tsx
Original file line number Diff line number Diff line change
@@ -1,37 +1,44 @@
'use client';

import React, { useCallback, useEffect, useRef } from 'react';
import React from 'react';
import Image from 'next/image';

export default function InterfaceExample(): JSX.Element {
const ref = useRef<HTMLIFrameElement>(null);

const onLoad = useCallback(() => {
ref.current?.classList.remove('opacity-0');
ref.current?.classList.remove('scale-90');
ref.current?.classList.add('opacity-90');
ref.current?.classList.add('scale-100');
}, []);;

useEffect(() => {
if (!ref.current) {
return undefined;
}
import Screenshot from '@monetr/docs/assets/screenshot.png';

const current = ref.current;
ref.current.addEventListener('load', onLoad);

return () => {
current.removeEventListener('load', onLoad);
};
});
export default function InterfaceExample(): JSX.Element {
// const ref = useRef<HTMLImageElement>(null);
//
// const onLoad = useCallback(() => {
// ref.current?.classList.remove('opacity-0');
// ref.current?.classList.remove('scale-90');
// ref.current?.classList.add('opacity-90');
// ref.current?.classList.add('scale-100');
// }, []);;
//
// useEffect(() => {
// if (!ref.current) {
// return undefined;
// }
//
// });

return (
<iframe
ref={ ref }
<Image
title='monetr interface'
alt='Screenshot of the monetr interface'
loading='lazy'
className='w-full h-full translate-x-0 translate-y-0 scale-90 delay-150 duration-500 ease-in-out rounded-2xl mt-8 shadow-2xl z-10 backdrop-blur-md bg-black/90 transition-all opacity-0 pointer-events-none select-none max-w-[1280px] max-h-[720px] aspect-video-vertical md:aspect-video'
src='/_storybook/iframe.html?viewMode=story&id=new-ui--transactions&shortcuts=false&singleStory=true&args='
className='w-full h-full translate-x-0 translate-y-0 scale-100 delay-150 duration-500 ease-in-out rounded-2xl mt-8 shadow-2xl z-10 backdrop-blur-md bg-black/90 transition-all opacity-90 pointer-events-none select-none max-w-[1280px] max-h-[720px] aspect-video-vertical md:aspect-video'
src={ Screenshot }
/>
);

// return (
// <iframe
// ref={ ref }
// title='monetr interface'
// loading='lazy'
// className='w-full h-full translate-x-0 translate-y-0 scale-90 delay-150 duration-500 ease-in-out rounded-2xl mt-8 shadow-2xl z-10 backdrop-blur-md bg-black/90 transition-all opacity-0 pointer-events-none select-none max-w-[1280px] max-h-[720px] aspect-video-vertical md:aspect-video'
// src='/_storybook/iframe.html?viewMode=story&id=new-ui--transactions&shortcuts=false&singleStory=true&args='
// />
// );
}

0 comments on commit 4992a7c

Please sign in to comment.