Skip to content

Commit acc0054

Browse files
committed
revert image to embed. disable page scrolling while cursor hovers over embeds
1 parent 4ec0909 commit acc0054

File tree

2 files changed

+18
-3
lines changed
  • blog/2023-11-15-koordinates-and-stately-case-study
  • src/components/EmbedMachine

2 files changed

+18
-3
lines changed

blog/2023-11-15-koordinates-and-stately-case-study/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ The desktop app Koordinates provides also ships with **[Kart](https://github.com
4040
- **manage** branches for their datasets - creating, merging, and deleting them
4141
- **roll back** branches to previous commits, preserving changes made over time
4242

43-
In the case of Kart, many of these operations can be long-running and have **several** edge cases, making Stately’s tooling to visualize, understand, and execute logic from stateful diagrams a massive benefit.
43+
In the case of Kart, many of these operations can be long-running and have several edge cases, making Stately’s tooling to visualize, understand, and execute logic from stateful diagrams a massive benefit.
4444

4545
## Breaking complex UI’s into manageable components **
4646

47-
In the case of both their products, Koordinates was able to use Stately’s tooling to break their “big” problems down into several, distinct smaller ones. Taylor Lodge, an engineer on the core team, explained that with Stately’s visual editor and simulation tooling, they were able to break their application logic into several small, testable state machines. For example, the UI for Koordinates Cloud has several components, but the logic for loading elements in their list view is represented rather succinctly in this state machine:
47+
In the case of both their products, Koordinates was able to use Stately’s tooling to break their “big” problems down into several, distinct smaller ones. Taylor Lodge, an engineer on the core team, explained that with Sta tely’s visual editor and simulation tooling, they were able to break their application logic into several small, testable state machines. For example, the UI for Koordinates Cloud has several components, but the logic for loading elements in their list view is represented rather succinctly in this state machine:
4848

4949

5050
<EmbedMachine

src/components/EmbedMachine/index.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import React, { useState } from 'react';
22
import styles from './styles.module.css';
33
import { useColorMode } from '@docusaurus/theme-common';
44

@@ -7,9 +7,23 @@ type Embed = {
77
embedURL: string;
88
};
99

10+
1011
export default function EmbedMachine({ name, embedURL }: Embed) {
1112
const { colorMode } = useColorMode();
13+
14+
// keeps the whole page from scrolling when
15+
const handleMouseEnter = () => {
16+
document.body.style.overflow = 'hidden';
17+
}
18+
const handleMouseLeave = () => {
19+
document.body.style.overflow = 'auto';
20+
}
21+
1222
return (
23+
<div
24+
onMouseEnter={handleMouseEnter}
25+
onMouseLeave={handleMouseLeave}
26+
>
1327
<iframe
1428
loading="lazy"
1529
src={manageURL(embedURL, {
@@ -22,6 +36,7 @@ export default function EmbedMachine({ name, embedURL }: Embed) {
2236
</a>
2337
.
2438
</iframe>
39+
</div>
2540
);
2641
}
2742

0 commit comments

Comments
 (0)