CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/frontend/chat/name.tsx
Views: 687
1
import { React } from "../app-framework";
2
3
const STYLE: React.CSSProperties = {
4
color: "#888",
5
marginBottom: "1px",
6
marginLeft: "10px",
7
right: 0,
8
whiteSpace: "nowrap",
9
overflow: "hidden",
10
textOverflow: "ellipsis", // see https://css-tricks.com/snippets/css/truncate-string-with-ellipsis/
11
position: "absolute", // using the "absolute in relative" positioning trick
12
left: 0,
13
top: 0,
14
};
15
16
export const Name: React.FC<{ sender_name: string }> = ({ sender_name }) => {
17
return (
18
<div style={{ position: "relative", height: "1.2em", width: "100%" }}>
19
<div className={"small"} style={STYLE}>
20
{sender_name}
21
</div>
22
</div>
23
);
24
};
25
26