Skip to content

Commit eab768b

Browse files
committed
better indicate cells with code using "</>" icon
1 parent ff2e86b commit eab768b

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/core/gridGL/graphics/CellPixiReact.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useCallback } from 'react';
22
import { Graphics, Container } from '@inlet/react-pixi';
3+
import { CodeIcon } from './primatives/CodeIcon';
34

45
import FastBitmapText from './primatives/FastBitmapText';
56

@@ -74,6 +75,9 @@ const CellPixiReact = (props: CellPixiReactProps) => {
7475
visible={props.renderText}
7576
/>
7677
<Graphics draw={draw_outline} />
78+
{props.type === 'PYTHON' && (
79+
<CodeIcon x_pos={x_pos} y_pos={y_pos}></CodeIcon>
80+
)}
7781
</Container>
7882
);
7983
};
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { BitmapText } from '@inlet/react-pixi';
2+
import { colors } from '../../../../theme/colors';
3+
4+
interface CodeIconProps {
5+
x_pos: number;
6+
y_pos: number;
7+
}
8+
9+
export const CodeIcon = (props: CodeIconProps) => {
10+
const { x_pos, y_pos } = props;
11+
12+
return (
13+
<BitmapText
14+
x={x_pos + 1}
15+
y={y_pos - 0.5}
16+
style={{ fontName: 'OpenSans', fontSize: 4 }}
17+
tint={colors.cellColorUserPython}
18+
align="left"
19+
text="</>"
20+
></BitmapText>
21+
);
22+
};

0 commit comments

Comments
 (0)